-
Notifications
You must be signed in to change notification settings - Fork 2
Feature/h2 #85
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
Draft
stefan-voelk
wants to merge
27
commits into
main
Choose a base branch
from
feature/h2
base: main
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.
Draft
Feature/h2 #85
Conversation
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
Uncommented ROOT_DIR from __init__.py
- Added TensorFlow to development and minimal environment files. - Updated .gitignore to exclude the new repository/h2 directory. - Added new fuel consumption scenario CSV files for BAU and CurTec. - Updated CHANGELOG with a fix for `PermissionError` when example input directory does not exist. - Incremented version number to 0.11.1 in __about__.py.
- Introduced multiple new Keras model files for surrogate models in the h2 and o3 directories. - Added new fuel consumption scenario CSV files for BAU and CurTec. - Updated .gitignore to exclude specific files related to the new models.
The calc_h2.py module depends on the python package tensorflow. For Windows systems, special requirements have to be met for the installation of tensorflow. The environment files create dedicated conda environments for the execution of calc_h2.py commands. Installation instructions are added to the documentation in hydrogen.md.
calc_h2.py automatically reformatted with black formatter, module added to init imports.
Environment file environment_h2.yaml changed to support python version 3.12, documentation hydrogen.md updated and Getting started added (Where to download background SSP scenarios).
Renaming of function run_case() to run_h2_case() to be more specific and avoiding misunderstandings when used system-wide.
Usage section added
Reference Gunter (2024) added.
calc_h2 module will not be imported automatically with oac package anymore since this would throw an error if the oac package was loaded with "normal" oac conda environment (without tensorflow package). Instead calc_h2 module should be loaded separately. Function name changed back to run_case() since this would be called together with the module, e.g. calc_h2.run_case(). Documentation hydrogen.md and sphinx updated.
Module docstrings revised, Floris added as __author__
Refactor code, correct pylint errors, move hard-coded variables to CONSTANTS section in the beginning of the module, add stubs packages to environment files
import keras instead of tensorflow. Note: tensorflow package must be still installed. keras is a subpackage of tensorflow.
Replace functions load_o3 and load_lstm by unified function load_surrogate_model
load_lstm and load_o3 functions removed due to previous refactoring. The two functions have been merged to function load_surrogate_model. Renaming of very short variable names in order to be more descriptive. Reference added to header section.
Unit tests for module calc_h2.py. These tests are disabled if not run in an environment with tensorflow and keras packages installed.
Update header, revisions done by Stefan
Ignore netCDF files in repository/h2/SSP_scenarios rather than the folder itself.
Otherwise the empty directory would not be recognized by git/GitHub.
Ignore configuration files from the continue extension.
fixed fuel consumption scenarios
Fix load_surrogate_model: usage of return_fn get_fn arguments. BAU2040 is a fixed consumption scenario with fuel usage as for BAU scenario at year 2040.
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.
Before you get started
Description
The new module
calc_h2.pymodule is added to the framework. The work is based on Floris Gunter Master Thesis The Climate Impact of Hydrogen Leakage in Aviation - A Machine Learning Approach to Long-Term Scenario Forecastinghttps://resolver.tudelft.nl/uuid:67633521-cd00-4565-a5d6-5536d497acb9
The module calculates the climate response of (global) hydrogen fugitive emissions. Output are RF changes and species concentration changes. The module runs "stand-alone" with minimum interfaces to the overall OpenAirClim framework.
Special dependencies have to be met, in order to be able to install the module. Therefore, it is recommended to run the functions of this module in a separate conda environment, e.g.
oac_h2as described in the provided workflow documentation. Additional environment files have been added to facilitate the installation process.Note: During the refactoring of this module, it was discovered that the general OpenAirClim framework (not the calc_h2 module) works without restricting the environment to a particular python version. Therefore, an additional change not related to this module was performed and this restriction was released in the environment files
environment_dev.yamlandenvironment_minimal.yaml.Type of change
How has this been tested?
There have been added unit tests for following functions:
calculate_hydrogen_adoption_fraction()prepare_dataTest configuration:
calc_h2_test.pyqueries if the keras package is available. Otherwise, the tests are not executed. Thus, the tests run only in a conda environment meeting the special requirements of this module. The existing GitHub workflow Install and run tests should omit these tests.Checklist
__about__.pyaccording to the semantic versioning scheme