[yt-svn] commit/yt: ngoldbaum: Merged in MatthewTurk/yt (pull request #1743)
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Mon Sep 14 11:06:41 PDT 2015
1 new commit in yt:
https://bitbucket.org/yt_analysis/yt/commits/1e1fc6fb63d4/
Changeset: 1e1fc6fb63d4
Branch: yt
User: ngoldbaum
Date: 2015-09-14 18:06:29+00:00
Summary: Merged in MatthewTurk/yt (pull request #1743)
Remove some stub functions
Affected #: 2 files
diff -r 98fd66d8cfb26fd6ab648b5ca2982bc177970f26 -r 1e1fc6fb63d4dd5fc7183a3900902a0c0638ae9a yt/convenience.py
--- a/yt/convenience.py
+++ b/yt/convenience.py
@@ -32,18 +32,6 @@
match, at which point it returns an instance of the appropriate
:class:`yt.data_objects.api.Dataset` subclass.
"""
- if len(args) == 0:
- try:
- from yt.extern.six.moves import tkinter
- import tkinter, tkFileDialog
- except ImportError:
- raise YTOutputNotIdentified(args, kwargs)
- root = tkinter.Tk()
- filename = tkFileDialog.askopenfilename(parent=root,title='Choose a file')
- if filename != None:
- return load(filename)
- else:
- raise YTOutputNotIdentified(args, kwargs)
candidates = []
args = [os.path.expanduser(arg) if isinstance(arg, str)
else arg for arg in args]
@@ -100,32 +88,6 @@
mylog.error(" Possible: %s", c)
raise YTOutputNotIdentified(args, kwargs)
-def projload(ds, axis, weight_field = None):
- # This is something of a hack, so that we can just get back a projection
- # and not utilize any of the intermediate index objects.
- class ProjMock(dict):
- pass
- import h5py
- f = h5py.File(os.path.join(ds.fullpath, ds.parameter_filename + ".yt"))
- b = f["/Projections/%s/" % (axis)]
- wf = "weight_field_%s" % weight_field
- if wf not in b: raise KeyError(wf)
- fields = []
- for k in b:
- if k.startswith("weight_field"): continue
- if k.endswith("_%s" % weight_field):
- fields.append(k)
- proj = ProjMock()
- for f in ["px","py","pdx","pdy"]:
- proj[f] = b[f][:]
- for f in fields:
- new_name = f[:-(len(weight_field) + 1)]
- proj[new_name] = b[f][:]
- proj.axis = axis
- proj.ds = ds
- f.close()
- return proj
-
def simulation(parameter_filename, simulation_type, find_outputs=False):
"""
Loads a simulation time series object of the specified
diff -r 98fd66d8cfb26fd6ab648b5ca2982bc177970f26 -r 1e1fc6fb63d4dd5fc7183a3900902a0c0638ae9a yt/data_objects/static_output.py
--- a/yt/data_objects/static_output.py
+++ b/yt/data_objects/static_output.py
@@ -691,8 +691,7 @@
"""
from yt.units.dimensions import length
- if hasattr(self, "cosmological_simulation") \
- and getattr(self, "cosmological_simulation"):
+ if getattr(self, "cosmological_simulation", False):
# this dataset is cosmological, so add cosmological units.
self.unit_registry.modify("h", self.hubble_constant)
# Comoving lengths
@@ -705,16 +704,15 @@
self.set_code_units()
- if hasattr(self, "cosmological_simulation") \
- and getattr(self, "cosmological_simulation"):
+ if getattr(self, "cosmological_simulation", False):
# this dataset is cosmological, add a cosmology object
- setattr(self, "cosmology",
+ self.cosmology = \
Cosmology(hubble_constant=self.hubble_constant,
omega_matter=self.omega_matter,
omega_lambda=self.omega_lambda,
- unit_registry=self.unit_registry))
- setattr(self, "critical_density",
- self.cosmology.critical_density(self.current_redshift))
+ unit_registry=self.unit_registry)
+ self.critical_density = \
+ self.cosmology.critical_density(self.current_redshift)
self.scale_factor = 1.0 / (1.0 + self.current_redshift)
def get_unit_from_registry(self, unit_str):
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