Skip to content

Allowing default values for missing required parameters#956

Merged
Bachibouzouk merged 8 commits intodevfrom
feature/default-values-parameters
Oct 24, 2022
Merged

Allowing default values for missing required parameters#956
Bachibouzouk merged 8 commits intodevfrom
feature/default-values-parameters

Conversation

@Bachibouzouk
Copy link
Copy Markdown
Collaborator

@Bachibouzouk Bachibouzouk commented Oct 14, 2022

Related to open-plan-tool/gui#38

Changes proposed in this pull request:

  • PARAMETER_DOC in utils can be used to get information about a parameter directly from the csv file docs/MVS_parameters_list.csv
  • When a required parameter is missing its default value, defined in docs/MVS_parameters_list.csv, is used instead of raising an error

The following steps were realized, as well (if applies):

  • Use in-line comments to explain your code
  • Write docstrings to your code (example docstring)
  • For new functionalities: Explain in readthedocs
  • Write test(s) for your new patch of code (pytests, assertion debug messages)
  • Update the CHANGELOG.md
  • Apply black (black . --exclude docs/)
  • Check if benchmark tests pass locally (EXECUTE_TESTS_ON=master pytest)

This is an object with methods to get the default, value, description,
unit, type of a given parameter from the .csv file listing all
parameters properties
If set_default is set to True, the parameter comparator will then set
any missing required parameter by their default value
@Bachibouzouk Bachibouzouk marked this pull request as ready for review October 14, 2022 11:05
@Bachibouzouk Bachibouzouk force-pushed the feature/default-values-parameters branch from 3c70c06 to cb42b8f Compare October 14, 2022 11:18
@Bachibouzouk Bachibouzouk force-pushed the feature/default-values-parameters branch 2 times, most recently from 9c64548 to 94f29ad Compare October 16, 2022 14:46
- The if statement for adapting `MAXIMUM_CAP` for non-dispatchable production assets is now based on the value of `DISPATCHABILITY` and not on the existence of the key `FILENAME` in the `asset_dict` (#939)
- The default values for the constraints are now located in `src/constants.py` under the variable `DEFAULT_CONSTRAINT_VALUES` (#953)

- When a required parameter is missing its default value, defined in `docs/MVS_parameters_list.csv`, is used instead of raising an error (#956)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
- When a required parameter is missing its default value, defined in `docs/MVS_parameters_list.csv`, is used instead of raising an error (#956)
- When a required parameter is missing a value, a default value defined in `docs/MVS_parameters_list.csv` is used instead of raising an error (#956)

@Bachibouzouk Bachibouzouk merged commit a7a7c16 into dev Oct 24, 2022
@Bachibouzouk Bachibouzouk deleted the feature/default-values-parameters branch October 24, 2022 15:43
@Bachibouzouk Bachibouzouk mentioned this pull request Apr 27, 2024
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