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

1220 filter and handle missing entries in the validation module #1223

Conversation

EinarElen
Copy link
Contributor

@EinarElen EinarElen commented Nov 2, 2023

I am updating ldmx-sw, here are the details.

I've added two new command line parameters for the validation module, one which lets you specify exactly which files you want to compare (as opposed to all files in the input data directory). You can either specify the name of a file in the input directory or give the entire path to the file. The other parameter lets you filter the list of root-files (a use-case for this in my case would be filtering on the number of events in a pile of files).

Also added an exception handling step in Differ to handle missing histograms gracefully.

Example usage:
Assuming you have three files in the hists/ folder

  • ecal_trunk_10000_events.root
  • ecal_trunk_100_events.root
  • ecal_PR_10000_events.root
  • hcal_trunk_10000_events.root

Running

ldmx python3 -m Validation hists --input-files ecal_trunk_10000_events.root hists/ecal_PR_10000_events.root  ...

Would only plot the two ecal files with 10k events
Running

ldmx python3 -m Validation hists --input-file-filter="ecal" ...

Would use the three files including "ecal" in the name

etc

What are the issues that this addresses?

Hint: Use the phrase 'This resolves #< issue number >' so that they are linked automatically.
This resolves #1220

Check List

  • I successfully compiled ldmx-sw with my developments

  • I ran my developments and the following shows that they are successful.
    Tested both the new parameters and handling of missing histograms. Worked like a charm :)

  • I attached any sub-module related changes to this PR.
    N/A

Related Sub-Module PRs

N/A

This lets the user specify which files in the data-directory to use.
Can be by name in the input directory or as a path
This lets the user filter the files in the input directory by a regex
@EinarElen EinarElen linked an issue Nov 2, 2023 that may be closed by this pull request
Copy link
Member

@tomeichlersmith tomeichlersmith left a comment

Choose a reason for hiding this comment

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

I have one suggestion but it is minor and may not be worth it.

In general, I like this feature improvement and I'm glad to see that folks are using the Validation module!

Validation/src/Validation/_file.py Outdated Show resolved Hide resolved
@tomeichlersmith tomeichlersmith merged commit c3fd353 into trunk Nov 3, 2023
1 check passed
@tomeichlersmith tomeichlersmith deleted the 1220-filter-and-handle-missing-entries-in-the-validation-module branch November 3, 2023 15:14
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.

Filter and handle missing entries in the validation module
2 participants