Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adjusts validation rules for parameters and timesteppers and hardens parameter removal in the network parser.
- Removes built-in checks for
ConstantParameterandControlCurveParameterto allow alternative definitions - Stubs a new
rule_start_before_endinPywrTimestepper - Wraps deletion of attached parameters in
attach_reference_parameterswith atry/except
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| types/timestepper.py | Added stubbed rule_start_before_end for enforcing start/end ordering |
| types/parameter.py | Removed rule_constant_has_value and rule_cc_has_controlcurve checks |
| types/network.py | Wrapped deletion of self.parameters[...] in try/except to skip missing keys |
Comments suppressed due to low confidence (2)
pywrparser/types/timestepper.py:15
- Add unit tests for
rule_start_before_endto verify the new ordering validation once implemented.
def rule_start_before_end(self):
pywrparser/types/parameter.py:42
- The rules enforcing presence of
valueonconstantparameterandcontrol_curveoncontrolcurveparameterwere removed. Confirm this is intentional or introduce alternative validations for those required keys.
@match("controlcurveparameter")
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
pmslavin
approved these changes
Jul 2, 2025
Owner
pmslavin
left a comment
There was a problem hiding this comment.
Rules updates to match common usage for the controlcurveparameter and constantparameter. Note that some rules remain enforced for controlcurveparameter.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…r definitions