-
Notifications
You must be signed in to change notification settings - Fork 2
Remove references to hydra base, and add several updates #57
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
Open
knoxsp
wants to merge
2
commits into
master
Choose a base branch
from
remove_hydra_base
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,12 +38,13 @@ def run_file(filename, domain, output_file): | |
| pfr.run_pywr_model(output_file) | ||
|
|
||
|
|
||
| def run_network_scenario(client, scenario_id, template_id, domain, | ||
| solver=None, data_dir='/tmp'): | ||
| def run_network_scenario(client, scenario_id, template_id, | ||
| solver=None, data_dir='/tmp', use_cache=False, **kwargs): | ||
|
Comment on lines
+41
to
+42
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How do we set |
||
|
|
||
| runner = PywrHydraRunner.from_scenario_id(client, scenario_id, | ||
| template_id=template_id, | ||
| data_dir=data_dir) | ||
| data_dir=data_dir, | ||
| use_cache=use_cache) | ||
| runner.setup(solver=solver) | ||
| runner.run_pywr_model() | ||
| runner.save_pywr_results() | ||
|
|
@@ -91,7 +92,7 @@ def load_pywr_model_from_file(self, filename, solver=None): | |
| if warnings: | ||
| for component, warns in warnings.items(): | ||
| for warn in warns: | ||
| log.info(warn) | ||
| log.warning(warn) | ||
|
|
||
| if errors: | ||
| for component, errs in errors.items(): | ||
|
|
@@ -531,21 +532,15 @@ def _add_node_flagged_recorders(self, model): | |
| name = '__{}__:{}'.format(node.name, 'simulated_volume') | ||
| NumpyArrayStorageRecorder(model, node, name=name) | ||
| else: | ||
| import warnings | ||
| warnings.warn('Unrecognised node subclass "{}" with name "{}" for timeseries recording. Skipping ' | ||
| 'recording this node.'.format(node.__class__.__name__, node.name), | ||
| RuntimeWarning) | ||
| log.warning(f'Unrecognised node subclass "{node.__class__.__name__}" with name "{node.name}" for timeseries recording. Skipping recording this node.') | ||
|
|
||
| elif flag == 'deficit': | ||
| if isinstance(node, Node): | ||
| deficit_parameter = DeficitParameter(model, node) | ||
| name = '__{}__:{}'.format(node.name, 'simulated_deficit') | ||
| NumpyArrayParameterRecorder(model, deficit_parameter, name=name) | ||
| else: | ||
| import warnings | ||
| warnings.warn('Unrecognised node subclass "{}" with name "{}" for deficit recording. Skipping ' | ||
| 'recording this node.'.format(node.__class__.__name__, node.name), | ||
| RuntimeWarning) | ||
| log.warning(f'Unrecognised node subclass "{node.__class__.__name__}" with name "{node.name}" for deficit recording. Skipping recording this node.') | ||
|
|
||
| def _add_parameter_flagged_recorders(self, model): | ||
| for parameter_name, flags in self._parameter_recorder_flags.items(): | ||
|
|
@@ -774,6 +769,10 @@ def generate_array_recorder_resource_scenarios(self): | |
| except NotImplementedError: | ||
| continue | ||
|
|
||
| if len(df.columns) == 0: | ||
| log.warning(f"Recorder {recorder.name} has no data to save.") | ||
| continue | ||
|
|
||
| columns = [] | ||
| for name in df.columns.names: | ||
| columns.append([f'{name}: {v}' for v in df.columns.get_level_values(name)]) | ||
|
|
@@ -792,6 +791,7 @@ def generate_array_recorder_resource_scenarios(self): | |
| new_col_names.append(colname.split(':')[1].strip()) | ||
| df.columns = new_col_names | ||
|
|
||
|
|
||
| if "__:" in recorder.name: | ||
| try: | ||
| nodename, attrname = parse_reference_key(recorder.name) | ||
|
|
||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Certain types of dict datasets are classed as 'descriptor' depending on their keys?