Comments (9)
Thanks for pointing out a potential issue.
However, what do you mean by "assumes dump period == 1" in the title ? In the openPMD-example-datasets for instance, the dump period is 100 PIC cycles, and the openPMD-viewer can read it without problems.
I am unsure if this is what you mean, but note that current_i
is never directly used as the iteration, in the code. Instead, we use self.iterations[self.current_i]
, since, as you mentioned, current_i
represents the n-th output and not the iteration of that output.
Do you have maybe a concrete example to illustrate how the current code would fail?
from openpmd-viewer.
Ah the title is misleading, yes! I had a restarted simulation in PIConGPU that was running between steps [5'000:9'000]
and only contained those outputs. At some point in the post-processing, I wanted to know "what real time is it" for a certain iteration.
The variable current_i
, a publicly accessible member, is a bit ill-named (current_i: iteration, current_t: time) for the above mentioned usage. I also had no way to implement a ts.find_time(iteration)
function into OpenPMDTimeSeries
without reading a specific record and using its meta attributes.
from openpmd-viewer.
OK, thanks for the clarification.
Here are a few suggestions of what coud be changed:
-
Regarding the fact that
current_i
is a public attribute: note that, in Python, all class attribute are public. However, we can rename it as_current_i
(in Python-world, the underscore means that the attribute is intended to be private - although it is technically still public) -
Regarding the finding the time that corresponds to a given iteration, it can be done by:
t = ts.t[ ts.iterations == iteration ]
But we could also define a function find_time
that does this. What do you think?
from openpmd-viewer.
Yes close, but I would either store the real iteration
in current_i
or rename it to current_dump/file/...
because the name is confusing.
I can also provide a PR changing the content and usage of current_i
at all places to correct it, but I did not want to disrupt parallel developments without prior notice via an issue.
from openpmd-viewer.
How about doing the following changes:
- replacing
current_i
by_current_i
- adding a new attribute
current_iteration
. This would be more consistent thencurrent_i
, since for instance theget_particle
andget_field
API hast
anditeration
as arguments (hencecurrent_t
andcurrent_iteration
)
from openpmd-viewer.
If you are fine with the above, you can definitely implement it and do the corresponding PR.
from openpmd-viewer.
sorry for the late reply since I work-arounded the problem and it then suddenly fall in priority behind in the end-of-year madness.
I think it's a great idea to add an explicit
current_iteration
for naming & interface consistency.
I would suggest we rename current_i
to current_dump
or even better current_file_index
to make it self-explanatory, too. We can still _
hide it if you want.
from openpmd-viewer.
Thanks for the above comments. I agree with all of the above, and I slightly prefer current_file_index
over current_dump
.
You can go ahead with a PR if you have the time. Otherwise, I'll do it at some point later.
from openpmd-viewer.
Closed by #164
from openpmd-viewer.
Related Issues (20)
- Transition from Jupyter to Jupyter-lab HOT 1
- Momentum from .bp data HOT 13
- using tracking sentence at inization script HOT 1
- FieldProbe only outputs E and B field HOT 1
- warning when reading particle data HOT 11
- Issues installing via conda HOT 8
- Diagnostic (energy spectrum) HOT 1
- Investigating Performance Regression in ADIOS BP for HOT 17
- invalid value encountered in cast HOT 1
- IPython display deprecation
- Compatibility Issues HOT 1
- Explicit Series Close Call
- feature: VCR controls HOT 3
- feature: derived fields HOT 1
- feature: log-scaled colorbar
- Slider: `sidecar` option
- openViewer and Dask
- electron spectra (dQ/dE versus energy (MeV)
- How to open BP series?
- OpenPMDTimeSeries Slider and get_field incompatibility for Magnetic Field HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openpmd-viewer.