-
Notifications
You must be signed in to change notification settings - Fork 27
Load resource data from a folder without subdirectories of the resource type #462
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
base: develop
Are you sure you want to change the base?
Conversation
…older with a subdir named as the resource type
|
I think this pull request looks good! |
There is not a warning at the moment, I am not sure if a warning would break an optimization or design sweep if it was downloading resource data. Perhaps the behavior of the resource models could be documented in a doc page instead? What are your thoughts? |
I've been thinking about this, and I think what I actually want is if the user provides a file name variable, it gives a warning that it couldn't find that file. I can see if we're doing a sweep or want to specify a folder for the resource data we wouldn't want that warning, I was just thinking that if you actually specify a resource file name, it would be nice to know if it was using that or downloading data. |
…ectrolyzer models
I added in a UserWarning to resource_base.py (also required modifying the warnings filter in the electrolyzer models so that the warning is actually printed). |
Load resource data from a folder without subdirectories of the resource type
Before this PR, resource data files had to exist in a folder with the following format:
top_level_resource_dir/wind/ortop_level_resource_dir/solar. This PR allows for resource data to be loaded (but not saved to) from folderstop_level_resource_dir/resource_filename.ext. This PR would resolve Issue #329Section 1: Type of Contribution
Section 2: Draft PR Checklist
TODO:
N/A
Type of Reviewer Feedback Requested (on Draft PR)
Structural feedback:
Implementation feedback:
Other feedback:
Section 3: General PR Checklist
docs/files are up-to-date, or added when necessaryCHANGELOG.mdhas been updated to describe the changes made in this PRSection 3: Related Issues
#329
Section 4: Impacted Areas of the Software
Section 4.1: New Files
None
Section 4.2: Modified Files
h2integrate/resource/wind/test/test_nrel_developer_wtk_api.pytest_wind_resource_loaded_from_weather_dir: new test for added functionality/flexibility.h2integrate/resource/resource_base.pyResourceBaseAPIModel.get_data(): updated to check if a pre-downloaded file exists in a top-level resource folder. If that file doesn't exist, a subdirectory named as the resource type will be created (as before) and the resource file will be downloaded there.Section 5: Additional Supporting Information
Section 6: Test Results, if applicable
Section 7 (Optional): New Model Checklist
docs/developer_guide/coding_guidelines.mdattrsclass to define theConfigto load in attributes for the modelBaseConfigorCostModelBaseConfiginitialize()method,setup()method,compute()methodCostModelBaseClasssupported_models.pycreate_financial_modelinh2integrate_model.pytest_all_examples.pydocs/user_guide/model_overview.mddocs/section<model_name>.mdis added to the_toc.yml