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

OPSIM-1149: bugfix to add cols_req to new stackers #409

Merged
merged 6 commits into from
Apr 29, 2024

Conversation

rhiannonlynne
Copy link
Member

Relatively small changes, but important for making the stackers conform to the expected API.

"cols_req" is a required attribute for stackers to run within the MAF framework. That is, in tests or if the data columns required are present anyway, these stackers will .run successfully, but in order for MAF to know what columns to pull from the database, the cols_req must be specified .. otherwise, the stacker will fail because the input columns won't necessarily be available.

While fixing this, I also added a unit test that just calls "BaseStacker.help(doc=True)" as this will print all stacker cols_req and cols_added as part of generating its help string - this will ensure that all registered stackers have these attributes.

I also updated some more ruff and docstring lines, and fixed a pandas future warning error (a simple fix, as the behavior we were previously doing matches the expected future behavior).

While stackers will run independently without this column, in order to know what data to query from the opsim database when using them with metrics, these columns must be provided.
Copy link
Collaborator

@ehneilsen ehneilsen left a comment

Choose a reason for hiding this comment

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

Looks fine, and the expanded comments included in this PR will be quite useful as well.

@rhiannonlynne rhiannonlynne merged commit 783a21b into main Apr 29, 2024
9 of 12 checks passed
@rhiannonlynne rhiannonlynne deleted the tickets/OPSIM-1149 branch April 29, 2024 18:30
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.

None yet

2 participants