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

Validator improvements #350

Merged
merged 10 commits into from
Aug 31, 2022
Merged

Validator improvements #350

merged 10 commits into from
Aug 31, 2022

Conversation

hdunham
Copy link
Collaborator

@hdunham hdunham commented Aug 5, 2022

Please check if the PR fulfills these requirements

  • CHANGELOG.md is updated
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce?

Bug fixes

What is the current behavior?

ElectricTariff key is never required, even for on-grid
ElectricUtility model not created if not provided in inputs of an on-grid analysis
ElectricUtility silently ignored if provided in inputs for an off-grid analysis

What is the new behavior (if this is a feature change)?

Require ElectricTariff key for on-grid
Create and save ElectricUtility model if not provided in inputs of an on-grid analysis, in order to have the default inputs
Warn that ignoring ElectricUtility if provided in inputs for an off-grid analysis
Add test to ensure errors returned when required keys are missing

Does this PR introduce a breaking change?

no

Other information:

@hdunham hdunham requested a review from rathod-b August 5, 2022 22:49
@hdunham hdunham marked this pull request as ready for review August 12, 2022 20:29
@hdunham hdunham requested a review from zolanaj August 18, 2022 21:50
Copy link
Collaborator

@zolanaj zolanaj left a comment

Choose a reason for hiding this comment

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

@hdunham Thanks, this looks great! I added the following tests to yours:

  • Assert that the starting post doesn't trigger any missing required input errors, with post["Settings"]["off_grid_flag"] set to True and False (might be overkill, but could be helpful if we add separate required inputs to either ongrid or offgrid in the future)
  • When post["Settings"]["off_grid_flag"] = True, assert that "ElectricTariff" inputs do not show up in the validation errors, even if missing

If you agree with this, please go ahead and merge. Thanks again!

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.

2 participants