Implement particle selection
In this merge request, I am adding the argument part_ids
to the function get_particle_data
. It allows to request specific particles to the logger.
Edited by Loic Hausammann
Merge request reports
Activity
changed milestone to %Continuous Simulation Data Stream
added enhancement i/o python labels
- Resolved by Loic Hausammann
added 8 commits
-
03a4415e...0b866c55 - 7 commits from branch
master
- 4288332b - Implement particle selection
-
03a4415e...0b866c55 - 7 commits from branch
- Resolved by Loic Hausammann
added 1 commit
- c87b71dc - Cleanup and deal properly with particles removed
Okay, a few things here:
- You may want to implement your gas_type as an enum? Or have it provided as metadata in the log file. Personally, I really dislike the
PartType0
convention, but this might be difficult to do in practice. - In the case where no particles are found, you should probably raise an exception (as this is probably undesired behaviour). A custom exception is probably a good call here, like
ParticlesNotFoundError
or something. - In the case where some of the particles were not found, I think you just carry on as if nothing has happened. You could add another parameter called strict_search or something where if not all of the particle IDs were found you still raise
ParticlesNotFoundError
. - I'm not sure that having to provide exactly len(particle_types) lists is the best way to structure all of this. Have you considered having a separate
reader
object, or e.g.reader.X
for each particle type? I think that would make the API a lot easier to understand.
- You may want to implement your gas_type as an enum? Or have it provided as metadata in the log file. Personally, I really dislike the
- Resolved by Matthieu Schaller
Thanks for your comments!
- I agree with you, I will try to create some enum.
- It is easy to do, I will implement this.
- I am not sure to really see the use case. I think that the user can simply check it by himself.
- I am not really convinced by your idea (but neither by mine), but it is something worth exploring. Any comment about it? @nnrw56 and @matthieu.
- Resolved by Loic Hausammann
- Resolved by Loic Hausammann
- Resolved by Loic Hausammann
- Resolved by Loic Hausammann
added 1 commit
- a79cb6c8 - Python return dict not list anymore + format
Please register or sign in to reply