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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Wed Apr 20 11:11:01 PDT 2016


3 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/3f2a40faefc1/
Changeset:   3f2a40faefc1
Branch:      yt
User:        xarthisius
Date:        2016-04-18 19:04:11+00:00
Summary:     Add close() to HDF5FileHandler. Move h5py import inside HDF5FileHandler class definition. Closes #1211
Affected #:  1 file

diff -r d8eec89b2c86f300ce9cfb0205b97cefb5dd0c45 -r 3f2a40faefc1d9ead14a7f9eb1cae8c92d6bda85 yt/utilities/file_handler.py
--- a/yt/utilities/file_handler.py
+++ b/yt/utilities/file_handler.py
@@ -13,14 +13,13 @@
 # The full license is in the file COPYING.txt, distributed with this software.
 #-----------------------------------------------------------------------------
 
-from yt.utilities.on_demand_imports import _h5py as h5py
-
 from distutils.version import LooseVersion
 
 class HDF5FileHandler(object):
     handle = None
 
     def __init__(self, filename):
+        from yt.utilities.on_demand_imports import _h5py as h5py
         self.handle = h5py.File(filename, 'r')
 
     def __del__(self):
@@ -51,6 +50,10 @@
     def items(self):
         return list(self.handle.items())
 
+    def close(self):
+        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/0980bb9a7261/
Changeset:   0980bb9a7261
Branch:      yt
User:        xarthisius
Date:        2016-04-18 20:18:17+00:00
Summary:     Revert import move
Affected #:  1 file

diff -r 3f2a40faefc1d9ead14a7f9eb1cae8c92d6bda85 -r 0980bb9a7261173a70bbf6e1548aa5dc37b341bb yt/utilities/file_handler.py
--- a/yt/utilities/file_handler.py
+++ b/yt/utilities/file_handler.py
@@ -13,13 +13,13 @@
 # The full license is in the file COPYING.txt, distributed with this software.
 #-----------------------------------------------------------------------------
 
+from yt.utilities.on_demand_imports import _h5py as h5py
 from distutils.version import LooseVersion
 
 class HDF5FileHandler(object):
     handle = None
 
     def __init__(self, filename):
-        from yt.utilities.on_demand_imports import _h5py as h5py
         self.handle = h5py.File(filename, 'r')
 
     def __del__(self):


https://bitbucket.org/yt_analysis/yt/commits/605942cb9f98/
Changeset:   605942cb9f98
Branch:      yt
User:        jzuhone
Date:        2016-04-20 18:10:40+00:00
Summary:     Merged in xarthisius/yt (pull request #2128)

Add close() to HDF5FileHandler. Closes #1211
Affected #:  1 file

diff -r 27481b513244c9c7bb15578ed5381a812983e567 -r 605942cb9f98aaa215ee0bd67b0293bdd2302598 yt/utilities/file_handler.py
--- a/yt/utilities/file_handler.py
+++ b/yt/utilities/file_handler.py
@@ -14,7 +14,6 @@
 #-----------------------------------------------------------------------------
 
 from yt.utilities.on_demand_imports import _h5py as h5py
-
 from distutils.version import LooseVersion
 
 class HDF5FileHandler(object):
@@ -51,6 +50,10 @@
     def items(self):
         return list(self.handle.items())
 
+    def close(self):
+        if self.handle is not None:
+            self.handle.close()
+
 class FITSFileHandler(HDF5FileHandler):
     def __init__(self, filename):
         from yt.utilities.on_demand_imports import _astropy

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-svn-spacepope.org/attachments/20160420/2978edb9/attachment.html>


More information about the yt-svn mailing list