Skip to content

Commit 904578e

Browse files
authored
Merge pull request #8 from entity-toolkit/1.2.0rc
1.2.0rc
2 parents 7bfe840 + db0b704 commit 904578e

File tree

10 files changed

+606
-135
lines changed

10 files changed

+606
-135
lines changed

dist/nt2py-1.2.0-py3-none-any.whl

38.8 KB
Binary file not shown.

dist/nt2py-1.2.0.tar.gz

33.6 KB
Binary file not shown.

nt2/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "1.1.0"
1+
__version__ = "1.2.0"
22

33
import nt2.containers.data as nt2_data
44

nt2/containers/data.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,8 @@ def makeMovie(
242242
if time is None:
243243
if self.fields_defined:
244244
time = self.fields.t.values
245-
elif self.particles_defined:
246-
species = sorted(list(self.particles.keys()))
247-
time = self.particles[species[0]].t.values
245+
elif self.particles_defined and self.particles is not None:
246+
time = list(self.particles.times)
248247
else:
249248
raise ValueError("No time values found.")
250249
assert time is not None, "Time values must be provided."
@@ -311,14 +310,13 @@ def compactify(lst: list[Any] | KeysView[Any]) -> str:
311310
string += f" - total size: {ToHumanReadable(self.fields.nbytes)}\n\n"
312311
else:
313312
string += "Fields: empty\n\n"
314-
if self.particles_defined:
315-
species = sorted(list(self.particles.keys()))
313+
if self.particles_defined and self.particles is not None:
314+
species = sorted(self.particles.species)
316315
string += "Particle species:\n"
317316
string += f" - species: {compactify(species)}\n"
318-
string += f" - timesteps: {len(self.particles[species[0]].t)}\n"
319-
string += f" - quantities: {compactify(self.particles[species[0]].data_vars.keys())}\n"
320-
string += f" - max # per species: {[self.particles[sp].idx.shape[0] for sp in species]}\n"
321-
string += f" - total size: {ToHumanReadable(sum([self.particles[sp].nbytes for sp in species]))}\n\n"
317+
string += f" - timesteps: {len(self.particles.times)}\n"
318+
string += f" - quantities: {compactify(self.particles.columns)}\n"
319+
string += f" - total size: {ToHumanReadable(self.particles.nbytes)}\n\n"
322320
else:
323321
string += "Particles: empty\n\n"
324322

0 commit comments

Comments
 (0)