[yt-svn] commit/yt: ngoldbaum: Merged in MatthewTurk/yt (pull request #1775)
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Mon Oct 5 11:30:16 PDT 2015
1 new commit in yt:
https://bitbucket.org/yt_analysis/yt/commits/a541ba83d787/
Changeset: a541ba83d787
Branch: yt
User: ngoldbaum
Date: 2015-10-05 18:29:47+00:00
Summary: Merged in MatthewTurk/yt (pull request #1775)
Convert h5py to on-demand import
Affected #: 50 files
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/analysis_modules/absorption_spectrum/absorption_spectrum.py
--- a/yt/analysis_modules/absorption_spectrum/absorption_spectrum.py
+++ b/yt/analysis_modules/absorption_spectrum/absorption_spectrum.py
@@ -15,7 +15,7 @@
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
import numpy as np
from .absorption_line import tau_profile
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/analysis_modules/absorption_spectrum/absorption_spectrum_fit.py
--- a/yt/analysis_modules/absorption_spectrum/absorption_spectrum_fit.py
+++ b/yt/analysis_modules/absorption_spectrum/absorption_spectrum_fit.py
@@ -1,4 +1,4 @@
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
import numpy as np
from yt.analysis_modules.absorption_spectrum.absorption_line import \
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/analysis_modules/cosmological_observation/light_cone/light_cone.py
--- a/yt/analysis_modules/cosmological_observation/light_cone/light_cone.py
+++ b/yt/analysis_modules/cosmological_observation/light_cone/light_cone.py
@@ -13,7 +13,7 @@
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
import numpy as np
import os
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/analysis_modules/cosmological_observation/light_ray/light_ray.py
--- a/yt/analysis_modules/cosmological_observation/light_ray/light_ray.py
+++ b/yt/analysis_modules/cosmological_observation/light_ray/light_ray.py
@@ -13,7 +13,7 @@
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
import numpy as np
from yt.analysis_modules.cosmological_observation.cosmology_splice import \
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/analysis_modules/halo_analysis/enzofof_merger_tree.py
--- a/yt/analysis_modules/halo_analysis/enzofof_merger_tree.py
+++ b/yt/analysis_modules/halo_analysis/enzofof_merger_tree.py
@@ -34,7 +34,7 @@
import numpy as np
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
import glob
import os
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/analysis_modules/halo_analysis/halo_callbacks.py
--- a/yt/analysis_modules/halo_analysis/halo_callbacks.py
+++ b/yt/analysis_modules/halo_analysis/halo_callbacks.py
@@ -13,7 +13,7 @@
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
import numpy as np
import os
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/analysis_modules/halo_analysis/halo_catalog.py
--- a/yt/analysis_modules/halo_analysis/halo_catalog.py
+++ b/yt/analysis_modules/halo_analysis/halo_catalog.py
@@ -13,7 +13,7 @@
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
import numpy as np
import os
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/analysis_modules/halo_finding/halo_objects.py
--- a/yt/analysis_modules/halo_finding/halo_objects.py
+++ b/yt/analysis_modules/halo_finding/halo_objects.py
@@ -14,7 +14,7 @@
#-----------------------------------------------------------------------------
import gc
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
import math
import numpy as np
import glob
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/analysis_modules/particle_trajectories/particle_trajectories.py
--- a/yt/analysis_modules/particle_trajectories/particle_trajectories.py
+++ b/yt/analysis_modules/particle_trajectories/particle_trajectories.py
@@ -22,7 +22,7 @@
from collections import OrderedDict
import numpy as np
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
class ParticleTrajectories(object):
r"""A collection of particle trajectories in time over a series of
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/analysis_modules/photon_simulator/photon_simulator.py
--- a/yt/analysis_modules/photon_simulator/photon_simulator.py
+++ b/yt/analysis_modules/photon_simulator/photon_simulator.py
@@ -35,7 +35,7 @@
communication_system, parallel_root_only, get_mpi_type, \
parallel_capable
from yt.units.yt_array import YTQuantity, YTArray, uconcatenate
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
from yt.utilities.on_demand_imports import _astropy
import warnings
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/analysis_modules/photon_simulator/spectral_models.py
--- a/yt/analysis_modules/photon_simulator/spectral_models.py
+++ b/yt/analysis_modules/photon_simulator/spectral_models.py
@@ -11,7 +11,7 @@
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
import numpy as np
import os
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/analysis_modules/spectral_integrator/spectral_frequency_integrator.py
--- a/yt/analysis_modules/spectral_integrator/spectral_frequency_integrator.py
+++ b/yt/analysis_modules/spectral_integrator/spectral_frequency_integrator.py
@@ -14,7 +14,7 @@
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
import numpy as np
import os
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/analysis_modules/star_analysis/sfr_spectrum.py
--- a/yt/analysis_modules/star_analysis/sfr_spectrum.py
+++ b/yt/analysis_modules/star_analysis/sfr_spectrum.py
@@ -16,7 +16,7 @@
import os
import numpy as np
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
import math
from yt.config import ytcfg
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/analysis_modules/two_point_functions/two_point_functions.py
--- a/yt/analysis_modules/two_point_functions/two_point_functions.py
+++ b/yt/analysis_modules/two_point_functions/two_point_functions.py
@@ -13,7 +13,7 @@
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
import numpy as np
from yt.funcs import mylog
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/data_objects/profiles.py
--- a/yt/data_objects/profiles.py
+++ b/yt/data_objects/profiles.py
@@ -13,7 +13,7 @@
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
import numpy as np
from yt.funcs import *
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/frontends/athena/data_structures.py
--- a/yt/frontends/athena/data_structures.py
+++ b/yt/frontends/athena/data_structures.py
@@ -13,7 +13,7 @@
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
import numpy as np
import weakref
import glob #ST 9/12
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/frontends/chombo/data_structures.py
--- a/yt/frontends/chombo/data_structures.py
+++ b/yt/frontends/chombo/data_structures.py
@@ -13,7 +13,7 @@
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
import re
import os
import weakref
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/frontends/eagle/data_structures.py
--- a/yt/frontends/eagle/data_structures.py
+++ b/yt/frontends/eagle/data_structures.py
@@ -15,7 +15,7 @@
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
import numpy as np
import types
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/frontends/enzo/data_structures.py
--- a/yt/frontends/enzo/data_structures.py
+++ b/yt/frontends/enzo/data_structures.py
@@ -13,7 +13,7 @@
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
import weakref
import numpy as np
import os
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/frontends/enzo/io.py
--- a/yt/frontends/enzo/io.py
+++ b/yt/frontends/enzo/io.py
@@ -22,7 +22,7 @@
from yt.utilities.logger import ytLogger as mylog
from yt.geometry.selection_routines import mask_fill, AlwaysSelector
from yt.extern.six import u, b, iteritems
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
import numpy as np
from yt.funcs import *
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/frontends/flash/data_structures.py
--- a/yt/frontends/flash/data_structures.py
+++ b/yt/frontends/flash/data_structures.py
@@ -13,7 +13,7 @@
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
import stat
import numpy as np
import weakref
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/frontends/flash/io.py
--- a/yt/frontends/flash/io.py
+++ b/yt/frontends/flash/io.py
@@ -14,7 +14,7 @@
#-----------------------------------------------------------------------------
import numpy as np
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
from yt.utilities.math_utils import prec_accum
from itertools import groupby
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/frontends/gadget/data_structures.py
--- a/yt/frontends/gadget/data_structures.py
+++ b/yt/frontends/gadget/data_structures.py
@@ -15,7 +15,7 @@
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
import numpy as np
import stat
import struct
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/frontends/gadget_fof/data_structures.py
--- a/yt/frontends/gadget_fof/data_structures.py
+++ b/yt/frontends/gadget_fof/data_structures.py
@@ -15,7 +15,7 @@
#-----------------------------------------------------------------------------
from collections import defaultdict
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
import numpy as np
import stat
import weakref
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/frontends/gadget_fof/io.py
--- a/yt/frontends/gadget_fof/io.py
+++ b/yt/frontends/gadget_fof/io.py
@@ -14,7 +14,7 @@
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
import numpy as np
from yt.utilities.exceptions import *
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/frontends/gdf/data_structures.py
--- a/yt/frontends/gdf/data_structures.py
+++ b/yt/frontends/gdf/data_structures.py
@@ -13,7 +13,7 @@
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
import types
import numpy as np
import weakref
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/frontends/gdf/io.py
--- a/yt/frontends/gdf/io.py
+++ b/yt/frontends/gdf/io.py
@@ -14,7 +14,7 @@
#-----------------------------------------------------------------------------
import numpy as np
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
from yt.funcs import \
mylog
from yt.utilities.io_handler import \
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/frontends/halo_catalog/data_structures.py
--- a/yt/frontends/halo_catalog/data_structures.py
+++ b/yt/frontends/halo_catalog/data_structures.py
@@ -14,7 +14,7 @@
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
import numpy as np
import stat
import weakref
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/frontends/halo_catalog/io.py
--- a/yt/frontends/halo_catalog/io.py
+++ b/yt/frontends/halo_catalog/io.py
@@ -14,7 +14,7 @@
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
import numpy as np
from yt.utilities.exceptions import *
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/frontends/moab/data_structures.py
--- a/yt/frontends/moab/data_structures.py
+++ b/yt/frontends/moab/data_structures.py
@@ -13,7 +13,7 @@
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
import os
import numpy as np
import weakref
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/frontends/owls/data_structures.py
--- a/yt/frontends/owls/data_structures.py
+++ b/yt/frontends/owls/data_structures.py
@@ -15,7 +15,7 @@
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
import types
import yt.units
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/frontends/owls/io.py
--- a/yt/frontends/owls/io.py
+++ b/yt/frontends/owls/io.py
@@ -15,7 +15,7 @@
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
import numpy as np
import os
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/frontends/owls/owls_ion_tables.py
--- a/yt/frontends/owls/owls_ion_tables.py
+++ b/yt/frontends/owls/owls_ion_tables.py
@@ -17,7 +17,7 @@
#-----------------------------------------------------------------------------
import sys
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
import numpy as np
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/frontends/owls_subfind/data_structures.py
--- a/yt/frontends/owls_subfind/data_structures.py
+++ b/yt/frontends/owls_subfind/data_structures.py
@@ -15,7 +15,7 @@
#-----------------------------------------------------------------------------
from collections import defaultdict
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
import numpy as np
import stat
import weakref
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/frontends/owls_subfind/io.py
--- a/yt/frontends/owls_subfind/io.py
+++ b/yt/frontends/owls_subfind/io.py
@@ -14,7 +14,7 @@
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
import numpy as np
from yt.utilities.exceptions import *
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/frontends/rockstar/io.py
--- a/yt/frontends/rockstar/io.py
+++ b/yt/frontends/rockstar/io.py
@@ -14,7 +14,7 @@
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
import numpy as np
from yt.utilities.exceptions import *
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/frontends/sdf/data_structures.py
--- a/yt/frontends/sdf/data_structures.py
+++ b/yt/frontends/sdf/data_structures.py
@@ -15,7 +15,7 @@
#-----------------------------------------------------------------------------
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
import numpy as np
import stat
import weakref
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/geometry/geometry_handler.py
--- a/yt/geometry/geometry_handler.py
+++ b/yt/geometry/geometry_handler.py
@@ -17,7 +17,7 @@
import os
from yt.extern.six.moves import cPickle
import weakref
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
import numpy as np
from yt.config import ytcfg
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/geometry/grid_geometry_handler.py
--- a/yt/geometry/grid_geometry_handler.py
+++ b/yt/geometry/grid_geometry_handler.py
@@ -14,7 +14,7 @@
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
import numpy as np
import weakref
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/utilities/amr_kdtree/amr_kdtree.py
--- a/yt/utilities/amr_kdtree/amr_kdtree.py
+++ b/yt/utilities/amr_kdtree/amr_kdtree.py
@@ -16,7 +16,7 @@
from yt.funcs import *
import numpy as np
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
from .amr_kdtools import \
receive_and_reduce, send_to_parent, scatter_image
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/utilities/file_handler.py
--- a/yt/utilities/file_handler.py
+++ b/yt/utilities/file_handler.py
@@ -13,7 +13,7 @@
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
from distutils.version import LooseVersion
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/utilities/grid_data_format/conversion/conversion_athena.py
--- a/yt/utilities/grid_data_format/conversion/conversion_athena.py
+++ b/yt/utilities/grid_data_format/conversion/conversion_athena.py
@@ -3,7 +3,7 @@
import os
import weakref
import numpy as np
-import h5py as h5
+from yt.utilities.on_demand_imports import _h5py as h5
from .conversion_abc import *
from glob import glob
from collections import \
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/utilities/grid_data_format/tests/test_writer.py
--- a/yt/utilities/grid_data_format/tests/test_writer.py
+++ b/yt/utilities/grid_data_format/tests/test_writer.py
@@ -15,7 +15,7 @@
import tempfile
import shutil
import os
-import h5py as h5
+from yt.utilities.on_demand_imports import _h5py as h5
from yt.testing import \
fake_random_ds, assert_equal
from yt.utilities.grid_data_format.writer import \
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/utilities/grid_data_format/writer.py
--- a/yt/utilities/grid_data_format/writer.py
+++ b/yt/utilities/grid_data_format/writer.py
@@ -15,7 +15,7 @@
import os
import sys
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
import numpy as np
from contextlib import contextmanager
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/utilities/io_handler.py
--- a/yt/utilities/io_handler.py
+++ b/yt/utilities/io_handler.py
@@ -19,7 +19,7 @@
from yt.funcs import mylog
from yt.extern.six.moves import cPickle
import os
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
import numpy as np
from yt.extern.six import add_metaclass
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/utilities/minimal_representation.py
--- a/yt/utilities/minimal_representation.py
+++ b/yt/utilities/minimal_representation.py
@@ -17,7 +17,7 @@
import abc
import json
import sys
-import h5py as h5
+from yt.utilities.on_demand_imports import _h5py as h5
import os
from uuid import uuid4
from yt.extern.six.moves import urllib
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/utilities/on_demand_imports.py
--- a/yt/utilities/on_demand_imports.py
+++ b/yt/utilities/on_demand_imports.py
@@ -166,3 +166,97 @@
return self._spatial
_scipy = scipy_imports()
+
+class h5py_imports:
+ _name = "h5py"
+
+ _File = None
+ @property
+ def File(self):
+ if self._File is None:
+ try:
+ from h5py import File
+ except ImportError:
+ File = NotAModule(self._name)
+ self._File = File
+ return self._File
+
+ _Group = None
+ @property
+ def Group(self):
+ if self._Group is None:
+ try:
+ from h5py import Group
+ except ImportError:
+ Group = NotAModule(self._name)
+ self._Group = Group
+ return self._Group
+
+ ___version__ = None
+ @property
+ def __version__(self):
+ if self.___version__ is None:
+ try:
+ from h5py import __version__
+ except ImportError:
+ __version__ = NotAModule(self._name)
+ self.___version__ = __version__
+ return self.___version__
+
+ _get_config = None
+ @property
+ def get_config(self):
+ if self._get_config is None:
+ try:
+ from h5py import get_config
+ except ImportError:
+ get_config = NotAModule(self._name)
+ self._get_config = get_config
+ return self._get_config
+
+ _h5f = None
+ @property
+ def h5f(self):
+ if self._h5f is None:
+ try:
+ import h5py.h5f as h5f
+ except ImportError:
+ h5f = NotAModule(self._name)
+ self._h5f = h5f
+ return self._h5f
+
+ _h5d = None
+ @property
+ def h5d(self):
+ if self._h5d is None:
+ try:
+ import h5py.h5d as h5d
+ except ImportError:
+ h5d = NotAModule(self._name)
+ self._h5d = h5d
+ return self._h5d
+
+ _h5s = None
+ @property
+ def h5s(self):
+ if self._h5s is None:
+ try:
+ import h5py.h5s as h5s
+ except ImportError:
+ h5s = NotAModule(self._name)
+ self._h5s = h5s
+ return self._h5s
+
+ _version = None
+ @property
+ def version(self):
+ if self._version is None:
+ try:
+ import h5py.version as File
+ except ImportError:
+ version = NotAModule(self._name)
+ self._version = File
+ return self._version
+
+_h5py = h5py_imports()
+
diff -r b33ee82ef8595c0d015ecf981fa398da9b234897 -r a541ba83d787b19a197045380d7e8229876be1fd yt/visualization/volume_rendering/image_handling.py
--- a/yt/visualization/volume_rendering/image_handling.py
+++ b/yt/visualization/volume_rendering/image_handling.py
@@ -12,7 +12,7 @@
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
-import h5py
+from yt.utilities.on_demand_imports import _h5py as h5py
import numpy as np
from yt.funcs import mylog
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