[yt-svn] commit/yt: 3 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Tue Apr 4 10:31:14 PDT 2017
3 new commits in yt:
https://bitbucket.org/yt_analysis/yt/commits/ac7df4e4f7b1/
Changeset: ac7df4e4f7b1
Branch: yt
User: mzingale
Date: 2017-04-03 13:48:15+00:00
Summary: add support for Nyx datasets without particles (e.g. Sedov)
Affected #: 1 file
diff -r 3fee41c2ea35fbe17c97ba1dc286d6e71f088716 -r ac7df4e4f7b18c1dc73999d814aae44be5d7eceb yt/frontends/boxlib/data_structures.py
--- a/yt/frontends/boxlib/data_structures.py
+++ b/yt/frontends/boxlib/data_structures.py
@@ -1204,17 +1204,18 @@
def __init__(self, ds, dataset_type='nyx_native'):
super(NyxHierarchy, self).__init__(ds, dataset_type)
- # extra beyond the base real fields that all Boxlib
- # particles have, i.e. the xyz positions
- nyx_extra_real_fields = ['particle_mass',
- 'particle_velocity_x',
- 'particle_velocity_y',
- 'particle_velocity_z']
+ if ("particles" in self.ds.parameters):
+ # extra beyond the base real fields that all Boxlib
+ # particles have, i.e. the xyz positions
+ nyx_extra_real_fields = ['particle_mass',
+ 'particle_velocity_x',
+ 'particle_velocity_y',
+ 'particle_velocity_z']
- is_checkpoint = False
+ is_checkpoint = False
- self._read_particles("DM", is_checkpoint,
- nyx_extra_real_fields[0:self.ds.dimensionality+1])
+ self._read_particles("DM", is_checkpoint,
+ nyx_extra_real_fields[0:self.ds.dimensionality+1])
class NyxDataset(BoxlibDataset):
https://bitbucket.org/yt_analysis/yt/commits/189d570c1518/
Changeset: 189d570c1518
Branch: yt
User: mzingale
Date: 2017-04-03 15:48:14+00:00
Summary: add Nyx field list test on particle-less dataset
Affected #: 1 file
diff -r ac7df4e4f7b18c1dc73999d814aae44be5d7eceb -r 189d570c15187e3f04f390cc83012d10982fe9d0 yt/frontends/boxlib/tests/test_outputs.py
--- a/yt/frontends/boxlib/tests/test_outputs.py
+++ b/yt/frontends/boxlib/tests/test_outputs.py
@@ -225,3 +225,26 @@
def test_units_override():
for test in units_override_check(rt):
yield test
+
+nyx_no_particles = "nyx_sedov_plt00086"
+ at requires_file(nyx_no_particles)
+def test_nyx_no_part():
+ assert isinstance(data_dir_load(nyx_no_particles), NyxDataset)
+
+ fields = sorted(
+ [('boxlib', 'H'), ('boxlib', 'He'), ('boxlib', 'MachNumber'),
+ ('boxlib', 'Ne'), ('boxlib', 'Rank'), ('boxlib', 'StateErr'),
+ ('boxlib', 'Temp'), ('boxlib', 'X(H)'), ('boxlib', 'X(He)'),
+ ('boxlib', 'density'), ('boxlib', 'divu'), ('boxlib', 'eint_E'),
+ ('boxlib', 'eint_e'), ('boxlib', 'entropy'), ('boxlib', 'forcex'),
+ ('boxlib', 'forcey'), ('boxlib', 'forcez'), ('boxlib', 'kineng'),
+ ('boxlib', 'logden'), ('boxlib', 'magmom'), ('boxlib', 'magvel'),
+ ('boxlib', 'magvort'), ('boxlib', 'pressure'), ('boxlib', 'rho_E'),
+ ('boxlib', 'rho_H'), ('boxlib', 'rho_He'), ('boxlib', 'rho_e'),
+ ('boxlib', 'soundspeed'), ('boxlib', 'x_velocity'), ('boxlib', 'xmom'),
+ ('boxlib', 'y_velocity'), ('boxlib', 'ymom'), ('boxlib', 'z_velocity'),
+ ('boxlib', 'zmom')])
+
+ ds = data_dir_load(nyx_no_particles)
+ assert_equal(sorted(ds.field_list, fields))
+
https://bitbucket.org/yt_analysis/yt/commits/51ca56bb7126/
Changeset: 51ca56bb7126
Branch: yt
User: mzingale
Date: 2017-04-04 16:47:08+00:00
Summary: fix parens
Affected #: 1 file
diff -r 189d570c15187e3f04f390cc83012d10982fe9d0 -r 51ca56bb7126b9be23edd0fe6f2bf281be7ee2d3 yt/frontends/boxlib/tests/test_outputs.py
--- a/yt/frontends/boxlib/tests/test_outputs.py
+++ b/yt/frontends/boxlib/tests/test_outputs.py
@@ -246,5 +246,6 @@
('boxlib', 'zmom')])
ds = data_dir_load(nyx_no_particles)
- assert_equal(sorted(ds.field_list, fields))
+ assert_equal(sorted(ds.field_list), fields)
+
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