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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Mon Jul 31 08:35:49 PDT 2017


4 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/6ee676c2474d/
Changeset:   6ee676c2474d
User:        StatMarianne
Date:        2017-07-28 01:14:00+00:00
Summary:     Let NetCDF-4 Classic files trigger warn_netcdf() as well
Affected #:  1 file

diff -r 71d0f9b7951cd8562f219d1a610d505a6d256873 -r 6ee676c2474d4e00db95d071b9aad168ccbffab9 yt/utilities/file_handler.py
--- a/yt/utilities/file_handler.py
+++ b/yt/utilities/file_handler.py
@@ -99,7 +99,12 @@
 
 
 def warn_netcdf(fn):
-    needs_netcdf = valid_netcdf_classic_signature(fn)
+    # There are a few variants of the netCDF format.
+    classic = valid_netcdf_classic_signature(fn)
+    # NetCDF-4 Classic files are HDF5 files constrained to the Classic
+    # data model used by netCDF-3.
+    netcdf4_classic = valid_hdf5_signature(fn) and fn.endswith('.nc')
+    needs_netcdf = classic or netcdf4_classic
     from yt.utilities.on_demand_imports import _netCDF4 as netCDF4
     if needs_netcdf and isinstance(netCDF4.Dataset, NotAModule):
         raise RuntimeError("This appears to be a netCDF file, but the "


https://bitbucket.org/yt_analysis/yt/commits/62d592ababe2/
Changeset:   62d592ababe2
User:        StatMarianne
Date:        2017-07-28 01:34:44+00:00
Summary:     pep8 file_handler file
Affected #:  1 file

diff -r 6ee676c2474d4e00db95d071b9aad168ccbffab9 -r 62d592ababe23977a25b24d169c8915d7c803fbe yt/utilities/file_handler.py
--- a/yt/utilities/file_handler.py
+++ b/yt/utilities/file_handler.py
@@ -17,6 +17,7 @@
 from yt.utilities.on_demand_imports import NotAModule
 from contextlib import contextmanager
 
+
 def valid_hdf5_signature(fn):
     signature = b'\x89HDF\r\n\x1a\n'
     try:
@@ -63,6 +64,7 @@
         if self.handle is not None:
             self.handle.close()
 
+
 class FITSFileHandler(HDF5FileHandler):
     def __init__(self, filename):
         from yt.utilities.on_demand_imports import _astropy


https://bitbucket.org/yt_analysis/yt/commits/df89f5422a8e/
Changeset:   df89f5422a8e
User:        StatMarianne
Date:        2017-07-28 16:58:06+00:00
Summary:     Add possible file extension .nc4 for NetCDF-4 files
Affected #:  1 file

diff -r 62d592ababe23977a25b24d169c8915d7c803fbe -r df89f5422a8eab1744b8d5c8944d5e2bdaad5dbf yt/utilities/file_handler.py
--- a/yt/utilities/file_handler.py
+++ b/yt/utilities/file_handler.py
@@ -105,7 +105,7 @@
     classic = valid_netcdf_classic_signature(fn)
     # NetCDF-4 Classic files are HDF5 files constrained to the Classic
     # data model used by netCDF-3.
-    netcdf4_classic = valid_hdf5_signature(fn) and fn.endswith('.nc')
+    netcdf4_classic = valid_hdf5_signature(fn) and fn.endswith(('.nc', '.nc4'))
     needs_netcdf = classic or netcdf4_classic
     from yt.utilities.on_demand_imports import _netCDF4 as netCDF4
     if needs_netcdf and isinstance(netCDF4.Dataset, NotAModule):


https://bitbucket.org/yt_analysis/yt/commits/c4e4d3969767/
Changeset:   c4e4d3969767
User:        ngoldbaum
Date:        2017-07-31 15:35:35+00:00
Summary:     Merge pull request #1513 from mkcor/netcdf4-classic

Let NetCDF-4 Classic files trigger warn_netcdf() as well
Affected #:  1 file

diff -r a673272de688dee5a0fefa787adc001d5065c381 -r c4e4d396976743a3a1f9736e148c296f0d572ed7 yt/utilities/file_handler.py
--- a/yt/utilities/file_handler.py
+++ b/yt/utilities/file_handler.py
@@ -17,6 +17,7 @@
 from yt.utilities.on_demand_imports import NotAModule
 from contextlib import contextmanager
 
+
 def valid_hdf5_signature(fn):
     signature = b'\x89HDF\r\n\x1a\n'
     try:
@@ -63,6 +64,7 @@
         if self.handle is not None:
             self.handle.close()
 
+
 class FITSFileHandler(HDF5FileHandler):
     def __init__(self, filename):
         from yt.utilities.on_demand_imports import _astropy
@@ -99,7 +101,12 @@
 
 
 def warn_netcdf(fn):
-    needs_netcdf = valid_netcdf_classic_signature(fn)
+    # There are a few variants of the netCDF format.
+    classic = valid_netcdf_classic_signature(fn)
+    # NetCDF-4 Classic files are HDF5 files constrained to the Classic
+    # data model used by netCDF-3.
+    netcdf4_classic = valid_hdf5_signature(fn) and fn.endswith(('.nc', '.nc4'))
+    needs_netcdf = classic or netcdf4_classic
     from yt.utilities.on_demand_imports import _netCDF4 as netCDF4
     if needs_netcdf and isinstance(netCDF4.Dataset, NotAModule):
         raise RuntimeError("This appears to be a netCDF file, but the "

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