User-defined Output Folder#238
Draft
elenya-grant wants to merge 8 commits intoNatLabRockies:developfrom
Draft
Conversation
…itten to non-default output_dir
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.
User-defined Output Folder
Before, the outputs of a Hercules simulation were written to
Path.cwd()/"outputs". This PR introduces the flexibility to define an output folder and output filenames. If one is not input, the default behavior is the same as before. This PR also enables the user to specify more logging options.This impacts the output
.h5file location and the logger file location. The introduces some new inputs to the Hercules input file:TO-DO
Requested Feedback from Reviewers/Questions
prepare_output_directoryshould either be called inHerculesModel.__init__()so that it can use the output dir specified in the input dictionary. Thoughts? If so - I think that another user-input parameter in the input dictionary should dictate whether that's called or not, like below:Or - remove the function all together and put the
shutil.rmtree(output_dir)logic inHerculesModel.__init__()Files that were modified
examples/hercules_input_example.yamlhercules/hercules_model.pyHerculesModel.__init__()self._setup_logging()HerculesModel._setup_logging(): updated to take in (optional) other user-specified logger inputshercules/utilities.pysetup_logging()hercules/plant_components/component_base.pyComponentBase.__init__()self._setup_logging()ComponentBase._setup_logging(): updated to take in (optional) other user-specified logger inputs for the componenttests/hercules_model_test.py: updated some strings toPathobjects.test_specified_outputs_dir(): new test for user-specified output dir