[yt-svn] commit/yt: 3 new changesets

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Thu Sep 7 21:01:09 PDT 2017


3 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/30c7a49180c4/
Changeset:   30c7a49180c4
User:        jzuhone
Date:        2017-09-07 19:59:52+00:00
Summary:     Return dimensionless if we can't determine the field units
Affected #:  1 file

diff -r 8bed49af0634477ff8ec58b5a7d266fc593193a5 -r 30c7a49180c4988e5602752267e0ab236c5a6ed6 yt/frontends/fits/data_structures.py
--- a/yt/frontends/fits/data_structures.py
+++ b/yt/frontends/fits/data_structures.py
@@ -109,13 +109,15 @@
             # the right case by comparing against known units. This
             # only really works for common units.
             units = set(re.split(regex_pattern, field_units))
-            if '' in units: units.remove('')
+            if '' in units: 
+                units.remove('')
             n = int(0)
             for unit in units:
                 if unit in known_units:
                     field_units = field_units.replace(unit, known_units[unit])
                     n += 1
-            if n != len(units): field_units = "dimensionless"
+            if n != len(units) or n == 0:
+                field_units = "dimensionless"
             if field_units[0] == "/":
                 field_units = "1%s" % field_units
             return field_units


https://bitbucket.org/yt_analysis/yt/commits/34ae94fc971b/
Changeset:   34ae94fc971b
User:        jzuhone
Date:        2017-09-07 20:06:55+00:00
Summary:     Allow plot_2d to work with FITS datasets with celestial coordinates.
Affected #:  1 file

diff -r 30c7a49180c4988e5602752267e0ab236c5a6ed6 -r 34ae94fc971b475c1e5d27fadd17c4387f97c8a9 yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -2049,7 +2049,7 @@
     """
     if ds.dimensionality != 2:
         raise RuntimeError("plot_2d only plots 2D datasets!")
-    if ds.geometry == "cartesian" or ds.geometry == "polar":
+    if ds.geometry in ["cartesian", "polar", "spectral_cube"]:
         axis = "z"
     elif ds.geometry == "cylindrical":
         axis = "theta"


https://bitbucket.org/yt_analysis/yt/commits/fccca1fb4d58/
Changeset:   fccca1fb4d58
User:        ngoldbaum
Date:        2017-09-08 04:00:55+00:00
Summary:     Merge pull request #1553 from jzuhone/fix_fits_units

Return dimensionless if we can't determine the field units for FITS datasets
Affected #:  2 files

diff -r 8bed49af0634477ff8ec58b5a7d266fc593193a5 -r fccca1fb4d585d705867a553e7fd5ec94ac7181d yt/frontends/fits/data_structures.py
--- a/yt/frontends/fits/data_structures.py
+++ b/yt/frontends/fits/data_structures.py
@@ -109,13 +109,15 @@
             # the right case by comparing against known units. This
             # only really works for common units.
             units = set(re.split(regex_pattern, field_units))
-            if '' in units: units.remove('')
+            if '' in units: 
+                units.remove('')
             n = int(0)
             for unit in units:
                 if unit in known_units:
                     field_units = field_units.replace(unit, known_units[unit])
                     n += 1
-            if n != len(units): field_units = "dimensionless"
+            if n != len(units) or n == 0:
+                field_units = "dimensionless"
             if field_units[0] == "/":
                 field_units = "1%s" % field_units
             return field_units

diff -r 8bed49af0634477ff8ec58b5a7d266fc593193a5 -r fccca1fb4d585d705867a553e7fd5ec94ac7181d yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -2049,7 +2049,7 @@
     """
     if ds.dimensionality != 2:
         raise RuntimeError("plot_2d only plots 2D datasets!")
-    if ds.geometry == "cartesian" or ds.geometry == "polar":
+    if ds.geometry in ["cartesian", "polar", "spectral_cube"]:
         axis = "z"
     elif ds.geometry == "cylindrical":
         axis = "theta"

Repository URL: https://bitbucket.org/yt_analysis/yt/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.



More information about the yt-svn mailing list