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

Configuration parameter for pulse series name #168

Merged
merged 45 commits into from
Apr 5, 2023
Merged

Conversation

mlincett
Copy link
Collaborator

@mlincett mlincett commented Apr 3, 2023

There are many hardcoded occurrences of pulsesName = SplitUncleanedInIcePulses, i.e. the name identifying the pulse series used in the reconstruction.

Note that prepare_frames() used to support the passing of a different pulsesName but in a bad way: the user-selected pulse series would be used to overwrite the data of SplitUncleanedInIcePulses, so to match all the hardcoded values downstream.

With this PR:

  • the value of pulsesName is specified in config.py as cfg.INPUT_PULSES_NAME;
  • pulsesName becomes an optional argument of extract_json_message() defaulting to the value specified in config;
  • defaults are removed from all the functions called by extract_json_message();
  • pepare_frames() no longer supports overriding/overwriting the default pulse series.

PR is draft for now , as I am evaluating the opportunity of making the pulse series dependent on reco_algo. (Also, need to fix failing checks.)

Comments are welcome.

UPDATE: at this moment, it makes sense to make Skymap Scanner stick to SplitUncleanedInIcePulses as an input, and take care of pulse cleaning as part of the frame preparation / reco segments.

@mlincett mlincett changed the title Parameterize pulse series selection Configuration parameter for pulse series name Apr 4, 2023
@mlincett mlincett marked this pull request as ready for review April 4, 2023 13:04
@mlincett mlincett requested review from tianluyuan and ric-evans April 4, 2023 13:10
Copy link
Contributor

@tianluyuan tianluyuan left a comment

Choose a reason for hiding this comment

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

Looks good to me. Maybe we should open an issue to move some of the reco-specific input/output names into the reco-specific modules?

skymap_scanner/config.py Show resolved Hide resolved
@ric-evans
Copy link
Member

ric-evans commented Apr 4, 2023

defaults are removed from all the functions

🥳

@ric-evans ric-evans added the enhancement New feature or request label Apr 4, 2023
Copy link
Member

@ric-evans ric-evans left a comment

Choose a reason for hiding this comment

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

a few things. Do we want to move to Python 3.11 as the minimum version? I'd support that decision

skymap_scanner/utils/extract_json_message.py Outdated Show resolved Hide resolved
skymap_scanner/utils/extract_json_message.py Outdated Show resolved Hide resolved
skymap_scanner/utils/prepare_frames.py Outdated Show resolved Hide resolved
@mlincett
Copy link
Collaborator Author

mlincett commented Apr 5, 2023

a few things. Do we want to move to Python 3.11 as the minimum version? I'd support that decision

I would agree, but when I tried to install the package in a Python 3.11 environment some WIPAC dependencies were not available. I would stick to 3.10 style for this PR and see about moving to 3.11 in a new issue.

@mlincett mlincett mentioned this pull request Apr 5, 2023
@mlincett mlincett requested a review from ric-evans April 5, 2023 09:14
Copy link
Member

@ric-evans ric-evans left a comment

Choose a reason for hiding this comment

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

Other than the PEP8 thing, it looks good

Comment on lines 105 to 107
pulsesName : str,
cache_dir : str,
GCD_dir : str,
Copy link
Member

Choose a reason for hiding this comment

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

Please excuse the pedantry for a moment. For pep8-compliance, there should be no space before :, like pulsesName: str instead of pulsesName : str. Looks like there are several places with this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No worries, but how come black 23.1 is not enforcing this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not even autopep8 (2.0.2, pycodestyle 2.10.0) suggests changes. I took care of it manually.

Copy link
Member

Choose a reason for hiding this comment

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

# fmt: off is at the top of the file. I put that there to limit needless diffs

@mlincett mlincett requested a review from ric-evans April 5, 2023 17:44
@mlincett mlincett merged commit 5329f6b into main Apr 5, 2023
@mlincett mlincett deleted the pulse-series-selection branch April 5, 2023 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants