Skip to content

Commit

Permalink
Merge pull request #53 from dlr-pa/dev
Browse files Browse the repository at this point in the history
Release of version 0.9.0
  • Loading branch information
stefan-voelk authored Dec 4, 2024
2 parents 5369c71 + 36e5f83 commit 64982a2
Show file tree
Hide file tree
Showing 40 changed files with 2,251 additions and 174 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/github-actions-demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: GitHub Actions Demo
run-name: ${{ github.actor }} is testing out GitHub Actions 🚀
on: [push]
jobs:
Explore-GitHub-Actions:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest"]
python-version: ["3.11.5"]
steps:
- name: Setup conda environment
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: false
python-version: ${{ matrix.python-version }}
miniforge-version: latest
- name: Conda info
run: |
conda info
conda list
- name: Set sys.path
run: |
python -c "import sys, os; sys.path.append(os.getcwd()); print(sys.path)"
50 changes: 50 additions & 0 deletions .github/workflows/install_and_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# This workflow will setup conda, create a virtual environment with required packages and dependencies,
# execute script utils/create_test_files.py,
# and run tests with pytest

name: Install and run tests

on:
push:
branches: [ "main", "dev" ]
pull_request:
branches: [ "main", "dev" ]

#permissions:
# contents: read

jobs:
build:
name: Install and test on (${{ matrix.os }}, Miniforge)
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest"]
python-version: ["3.11.5"]
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v4
- name: Setup conda environment
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: false
python-version: ${{ matrix.python-version }}
environment-file: environment_dev.yaml
activate-environment: oac
miniforge-version: latest
- name: Conda info
run: |
conda info
conda list
- name: Create test files
run: |
cd utils/
chmod a+x create_test_files.py
python create_test_files.py
cd ..
- name: Test with pytest
run: |
cd tests/
pytest
7 changes: 2 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@ __pycache__/
# ignore Jupyter Notebooks
/ipynb/

# ignore REPOSITORIES
example/repository/*.nc
# exceptions
!example/repository/co2_bg.nc
!example/repository/resp_RF.nc
# ignore repositories and input data
example/input/*.nc
tests/repository/*.*
tests/repository/cache
# exceptions
Expand Down
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Changelog

## [0.9.0] - 2024-12-04

### Added

- Species: $O_3$, $CH_4$, PMO and Contrails

### Limitations

- Limited resolution of response surfaces and pending validation for species $O_3$, $CH_4$ and PMO
- Stratospheric Water Vapor (SWV) not considered in this version
- Contrails module: AirClim 2.1 methodology including simulations for $H_2$ from AHEAD project
- Climate impact of longer species lifetimes in the stratosphere not considered
- Overhanging effect on next year not considered for species lifetimes in the order of time step (year)

### Updates

- Change of versioning scheme to [semantic versioning](https://semver.org/)
- Move repository directory
- Integrate default configuration settings

## [2.8.3] - 2024-09-04

### Added
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# OpenAirClim

[![DOI](https://zenodo.org/badge/851165490.svg)](https://zenodo.org/doi/10.5281/zenodo.13682728)
![Install and Test workflow](https://github.com/dlr-pa/oac/actions/workflows/install_and_test.yml/badge.svg)


## Description

Expand Down Expand Up @@ -153,7 +155,9 @@ Major planned software releases and milestones for the project planning are:
## References
- Grewe, V., & Stenke, A. (2008). AirClim: an efficient tool for climate evaluation of aircraft technology. Atmospheric Chemistry and Physics, 8(16), 4621-4639.
- Dahlmann, K. (2011). A method for the efficient evaluation of climate optimisation measures for air transport [Eine Methode zur effizienten Bewertung von Maßnahmen zur Klimaoptimierung des Luftverkehrs] (Doctoral dissertation, Ph. D. Thesis, Ludwig-Maximilians-Universität München, Munich).
- Hüttenhofer, L. (2013). Parametrisierung von Kondensstreifenzirren für AirClim 2.0 (Bachelor Thesis, Ludwig-Maximilians-Universität München, Munich).
- Dahlmann, K., Grewe, V., Frömming, C., & Burkhardt, U. (2016). Can we reliably assess climate mitigation options for air traffic scenarios despite large uncertainties in atmospheric processes?. Transportation Research Part D: Transport and Environment, 46, 40-55.
- Grewe, V., Bock, L., Burkhardt, U., et al. (2017). Assessing the climate impact of the AHEAD multi-fuel blended wing body. Meteorologische Zeitschrift, 26(6), 711-725.
- Leipold, A. et al. (2021) DEPA 2050 – Development Pathways for Aviation up to 2050 (Final Report). https://elib.dlr.de/142185/


Expand Down
16 changes: 16 additions & 0 deletions docs/source/openairclim.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ openairclim package
Submodules
----------

openairclim.calc\_ch4 module
----------------------------

.. automodule:: openairclim.calc_ch4
:members:
:undoc-members:
:show-inheritance:

openairclim.calc\_co2 module
----------------------------

Expand All @@ -12,6 +20,14 @@ openairclim.calc\_co2 module
:undoc-members:
:show-inheritance:

openairclim.calc\_cont module
----------------------------

.. automodule:: openairclim.calc_cont
:members:
:undoc-members:
:show-inheritance:

openairclim.calc\_dt module
---------------------------

Expand Down
3 changes: 2 additions & 1 deletion environment_dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ dependencies:
- isort
- scipy
- ipympl
- openpyxl
- openpyxl
- deepmerge
1 change: 1 addition & 0 deletions environment_minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ dependencies:
- xarray
- netcdf4
- scipy
- deepmerge

58 changes: 46 additions & 12 deletions example/example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
# Species considered
[species]
# Species defined in emission inventories
# possible values: "CO2", "H2O", "NOx"
inv = ["CO2", "H2O", "NOx"]
# possible values: "CO2", "H2O", "NOx", "distance"
inv = ["CO2", "H2O", "NOx", "distance"]
# Assumed NOx species in emission inventory
# possible values: "NO", "NO2"
nox = "NO"
# Output / response species
# possible values: "CO2", "H2O"
out = ["CO2", "H2O"]
# possible values: "CO2", "H2O", "O3", "CH4", "PMO", "cont"
out = ["CO2", "H2O", "O3", "CH4", "PMO", "cont"]

# Emission inventories
[inventories]
dir = "repository/"
dir = "input/"
files = [
"rnd_inv_2020.nc",
"rnd_inv_2030.nc",
Expand All @@ -28,6 +28,15 @@ files = [
# "rnd_inv_2110.nc",
# "rnd_inv_2120.nc",
]
# base emission inventories, only considered if rel_to_base = true
rel_to_base = false
base.dir = "input/"
base.files = [
"rnd_inv_2020.nc",
"rnd_inv_2030.nc",
"rnd_inv_2040.nc",
"rnd_inv_2050.nc",
]

# Output options
[output]
Expand All @@ -42,32 +51,51 @@ concentrations = false

# Time settings
[time]
dir = "repository/"
dir = "../repository/"
# Time range in years: t_start, t_end, step, (t_end not included)
range = [2020, 2051, 1]
# Time evolution of emissions
# either type "scaling" or type "norm"
#file = "time_scaling_example.nc"
#file = "time_norm_example.nc"

# Background concentrations
# Global background concentrations
[background]
CO2.file = "repository/co2_bg.nc"
dir = "../repository/"
CO2.file = "co2_bg.nc"
CO2.scenario = "SSP2-4.5"
#CO2.scenario = "SSP1-1.9"
#CO2.scenario = "SSP4-6.0"
#CO2.scenario = "SSP3-7.0"
CH4.file = "ch4_bg.nc"
CH4.scenario = "SSP2-4.5"
N2O.file = "n2o_bg.nc"
N2O.scenario = "SSP2-4.5"

# Response options
[responses]
dir = "../repository/"
CO2.response_grid = "0D"
CO2.conc.method = "Sausen&Schumann"
CO2.rf.method = "IPCC_2001_1" # IPCC 2001, Table 6.2 first row
#CO2.rf.method = "IPCC_2001_2" # IPCC 2001, Table 6.2 second row
#CO2.rf.method = "IPCC_2001_3" # IPCC 2001, Table 6.2 third row
# RF method based on Etminan et al. 2016 is used by default.
#CO2.rf.method = "Etminan_2016"

H2O.response_grid = "2D"
H2O.rf.file = "repository/resp_RF.nc"
H2O.rf.file = "resp_RF.nc" # AirClim response surface

O3.response_grid = "2D"
O3.rf.file = "resp_RF_O3.nc" # tagging
#O3.rf.file = "resp_RF.nc" # AirClim response surface, requires adjustment of CORR_RF_O3 !

CH4.response_grid = "2D"
CH4.tau.file = "resp_ch4.nc" # tagging
CH4.rf.method = "Etminan_2016"

cont.response_grid = "cont"
cont.resp.file = "resp_cont.nc"
cont.G_comp = 0.04 # conventional: 0.04; hydrogen: 0.12
cont.eff_fac = 1.0 # efficiency factor compared to kerosene (1.0)
cont.PMrel = 1.0 # relative PM emissions compared to kerosene (1.0)

# Temperature options
[temperature]
Expand All @@ -79,11 +107,17 @@ CO2.lambda = 0.73
# Efficacies, Ponater et al. 2006, Table 1
H2O.efficacy = 1.14
O3.efficacy = 1.37
PMO.efficacy = 1.37
CH4.efficacy = 1.14
cont.efficacy = 0.59

# Climate metrics options
[metrics]
# iterate over elements in lists types t_0 and H
types = ["AGWP", "ATR", "AGTP"] # valid climate metrics: AGTP, AGWP, ATR
H = [31] # Time horizon, t_final = t_0 + H - 1
t_0 = [2020] # Start time for metrics calculation

# aircraft defined in inventory
[aircraft]
types = ["KER", "SAF", "LH2"]
5 changes: 5 additions & 0 deletions example/run.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
"""Demonstration of OpenAirClim simulation run"""

# if you have not added the oac folder to your PATH, then you also need to
# import sys and append to PATH using sys.path.append(`.../oac`)
import os
import openairclim as oac

# change directory to match current file
os.chdir(os.path.dirname(os.path.abspath(__file__)))
oac.run("example.toml")
2 changes: 1 addition & 1 deletion openairclim/__about__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


__title__ = "OpenAirClim"
__version__ = "2.8.3"
__version__ = "0.9.0"
__author__ = "OpenAirClim Team"
__email__ = "[email protected]"
__license__ = "Apache 2.0"
Expand Down
2 changes: 2 additions & 0 deletions openairclim/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
from openairclim.interpolate_time import * # noqa: F401, F403
from openairclim.calc_response import * # noqa: F401, F403
from openairclim.calc_co2 import * # noqa: F401, F403
from openairclim.calc_ch4 import * # noqa: F401, F403
from openairclim.calc_cont import * # noqa: F401, F403
from openairclim.calc_dt import * # noqa: F401, F403
from openairclim.calc_metric import * # noqa: F401, F403
from openairclim.uncertainties import * # noqa: F401, F403
Expand Down
Loading

0 comments on commit 64982a2

Please sign in to comment.