Skip to content
Snippets Groups Projects

Implement particle selection

Merged Loic Hausammann requested to merge logger_add_particle_selection into master

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

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loic Hausammann added 8 commits

    added 8 commits

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • added 1 commit

    • 38afe127 - Update kwarg and fix id search

    Compare with previous version

  • added 1 commit

    • c87b71dc - Cleanup and deal properly with particles removed

    Compare with previous version

  • Okay, a few things here:

    1. 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.
    2. 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.
    3. 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.
    4. 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.
    • Resolved by Matthieu Schaller

      Thanks for your comments!

      1. I agree with you, I will try to create some enum.
      2. It is easy to do, I will implement this.
      3. I am not sure to really see the use case. I think that the user can simply check it by himself.
      4. 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.
  • Pedro Gonnet
  • added 1 commit

    Compare with previous version

  • added 1 commit

    • a79cb6c8 - Python return dict not list anymore + format

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • Loic Hausammann unmarked as a Work In Progress

    unmarked as a Work In Progress

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading