Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working base #389

Merged
merged 42 commits into from
Feb 21, 2023
Merged

Working base #389

merged 42 commits into from
Feb 21, 2023

Conversation

Aske-Rosted
Copy link
Collaborator

Addition of several features used with neutrino-generator-21220 data, which seems to differ slightly compared to previously used data sets.

added functionality includes

  • Skipping frame in I3 file in case of missing pulsemap (In the files I have only every other physics frame seems to be relevant)
  • A warning message for when a frame is skipped.
  • Added option for when the MCTree is named differently in my case "I3MCTree_preMuonProp" standard option still "I3MCTree"
  • Implementation of a function which renames detector features given a list of strings. (This one is throwing a pre-commit error that I could not handle on my own)
  • allows for passing name of features to perform coarsening on. Automatically finds the "time" feature assuming time is in the name of the feature.
  • adds a function which returns a random fraction of data without any specific selection criteria
  • adds functionality for loading data with with missing input values by forcing float (Warning message is printed. This might be a bit "hacky")
  • add an extractor for pulling zenith and azimuth comparisons from other algorithms.

Sorry about this being a bit a bunched up collection of added functionality.

@asogaard asogaard assigned Aske-Rosted and asogaard and unassigned asogaard and Aske-Rosted Feb 14, 2023
Copy link
Collaborator

@asogaard asogaard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Aske-Rosted!

src/graphnet/models/detector/detector.py Outdated Show resolved Hide resolved
src/graphnet/models/detector/icecube.py Outdated Show resolved Hide resolved
src/graphnet/models/model.py Outdated Show resolved Hide resolved
src/graphnet/training/utils.py Outdated Show resolved Hide resolved
src/graphnet/data/dataset.py Outdated Show resolved Hide resolved
src/graphnet/data/extractors/i3splinempeextractor.py Outdated Show resolved Hide resolved
src/graphnet/data/extractors/i3splinempeextractor.py Outdated Show resolved Hide resolved
src/graphnet/data/extractors/__init__.py Outdated Show resolved Hide resolved
src/graphnet/data/sqlite/sqlite_selection.py Outdated Show resolved Hide resolved
src/graphnet/models/coarsening.py Outdated Show resolved Hide resolved
@asogaard asogaard assigned Aske-Rosted and unassigned asogaard Feb 14, 2023
Aske-Rosted and others added 6 commits February 15, 2023 11:11
Co-authored-by: Andreas Søgaard <andreas.sogaard@gmail.com>
Co-authored-by: Andreas Søgaard <andreas.sogaard@gmail.com>
Co-authored-by: Andreas Søgaard <andreas.sogaard@gmail.com>
Co-authored-by: Andreas Søgaard <andreas.sogaard@gmail.com>
Co-authored-by: Andreas Søgaard <andreas.sogaard@gmail.com>
Co-authored-by: Andreas Søgaard <andreas.sogaard@gmail.com>
Aske-Rosted and others added 4 commits February 21, 2023 13:12
Co-authored-by: Andreas Søgaard <andreas.sogaard@gmail.com>
Co-authored-by: Andreas Søgaard <andreas.sogaard@gmail.com>
Co-authored-by: Andreas Søgaard <andreas.sogaard@gmail.com>
Co-authored-by: Andreas Søgaard <andreas.sogaard@gmail.com>
@Aske-Rosted
Copy link
Collaborator Author

Hmm, the "unintended behavior" that you are describing is precisely the behavior I am looking for. Is there any scenario where you need information from a P-frame where one (or more) of your pulse maps is missing?

@Aske-Rosted
Copy link
Collaborator Author

I should now have addressed all the suggestions and corrections. I have implemented the handling of NullSplit frames in the way suggsted by @RasmusOrsoe as well as added some extra extraction features for the I3ParticleExtractor.

@asogaard
Copy link
Collaborator

Hmm, the "unintended behavior" that you are describing is precisely the behavior I am looking for. Is there any scenario where you need information from a P-frame where one (or more) of your pulse maps is missing?

Yes, see "Expected behaviour" here. :)

Copy link
Collaborator

@asogaard asogaard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Aske-Rosted,

Thanks for this nice PR. I am approving it now, but before merging I would like you to have a look at:

  • One suggestion to update a docstring.
  • One comment regarding the way NullSplit frames are skipped.

I'll leave it to you whether and how to resolve these. :)

src/graphnet/data/extractors/i3particleextractor.py Outdated Show resolved Hide resolved
@@ -427,11 +427,13 @@ def _extract_data(self, fileset: FileSet) -> List[OrderedDict]:
while i3_file_io.more():
try:
frame = i3_file_io.pop_physics()
assert self._is_not_null_split_frame(frame)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I mention here, I am not particularly fond of this solution, and would propose (1) amore general frame-skipping method and (2) separating this logic from whether the frame is a P-frame. But the proposed code works and is not unreasonable, so I'll leave it at your discretion, @Aske-Rosted.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Aske-Rosted I think Andreas suggestion is better than what I mentioned earlier.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the latest commit satisfactory? I am not 100% certain that all exceptions coming from the I3 modules will contain I3 in the exception name, but I would hope that they do...

Aske-Rosted and others added 2 commits February 21, 2023 19:11
Co-authored-by: Andreas Søgaard <andreas.sogaard@gmail.com>
@asogaard
Copy link
Collaborator

All good, @Aske-Rosted! :)

@asogaard asogaard assigned Aske-Rosted and unassigned asogaard Feb 21, 2023
@Aske-Rosted Aske-Rosted merged commit 983818a into graphnet-team:main Feb 21, 2023
@Aske-Rosted Aske-Rosted deleted the working_base branch February 22, 2023 02:06
RasmusOrsoe pushed a commit to RasmusOrsoe/graphnet that referenced this pull request Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants