Skip to content
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

v2.6.0 #300

Merged
merged 23 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
bdafc56
adding zenodo badge
K20shores Nov 8, 2024
825c560
Added netcdf (#273)
montythind Nov 12, 2024
3e3f542
Auto-format code using Clang-Format (#276)
github-actions[bot] Nov 12, 2024
7079073
Updated CI_Tests.yml to setup codecov (#280)
adityakiran1423 Nov 23, 2024
d886fe1
getting code coverage for src instead of tests (#281)
K20shores Nov 23, 2024
67be9a4
testing main directly so that codecov get check coverage of main
K20shores Nov 23, 2024
70601c3
fixing main.py tests
K20shores Nov 23, 2024
8e28e47
adding test for waccm script
K20shores Nov 23, 2024
50c801d
trying to correct ci?
K20shores Nov 23, 2024
6830146
Auto-format code using Clang-Format (#282)
github-actions[bot] Nov 23, 2024
8bd10e1
Update pep8_autoformat.yml
K20shores Nov 23, 2024
e2fcc2d
appended National Science Foundation wherever required (#283)
adityakiran1423 Nov 27, 2024
383e938
Fix indentation (#285)
adityakiran1423 Nov 27, 2024
89d1627
Replace initial condition to evolving condition (#277)
montythind Dec 2, 2024
11207c6
Auto-format code using pep8 (#287)
github-actions[bot] Dec 2, 2024
0d566a2
abstracting plotting (#278)
K20shores Dec 2, 2024
73f4a53
4 space indentation
K20shores Dec 2, 2024
1d7fe7c
Auto-format code using pep8 (#289)
github-actions[bot] Dec 2, 2024
ee8950a
Multiple plots (#294)
K20shores Dec 19, 2024
e4d0f18
Auto-format code using pep8 (#295)
github-actions[bot] Dec 19, 2024
ca54b94
Plot units (#296)
K20shores Dec 20, 2024
6b7536c
Auto-format code using pep8 (#297)
github-actions[bot] Dec 20, 2024
8db4180
updating to most recent musica version (#298)
K20shores Jan 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions .github/workflows/CI_Tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,28 @@ jobs:
- name: Install this package
run: pip install -e '.[dev]'

- name: Run pytest
run: pytest
- name: Install gnuplot
if: runner.os == 'Linux'
run: sudo apt-get install gnuplot

- name: Install gnuplot
if: runner.os == 'macOS'
run: brew install gnuplot

- name: Install gnuplot
if: runner.os == 'Windows'
run: choco install gnuplot

- name: Run tests and generate coverage reports
run: pytest --cov src/

- name: Upload coverage reports to codecov
if: runner.os == 'Linux'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.info

- name: Run the smoke tests
run: |
music_box -c src/acom_music_box/examples/configs/analytical/my_config.json -o output.csv
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pep8_autoformat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: autopep8
uses: peter-evans/autopep8@v2
with:
args: --recursive --in-place --aggressive --aggressive --max-line-length 180 .
args: --recursive --in-place --aggressive --max-line-length 180 --indent-size=4 .

- name: Check for changes
id: check-changes
Expand All @@ -28,7 +28,7 @@ jobs:
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
git commit -am "Auto-format code using Clang-Format" || echo "No changes to commit"
git commit -am "Auto-format code using pep8" || echo "No changes to commit"

- name: Push changes to main-autopep8 branch
if: steps.check-changes.outcome != 'success'
Expand All @@ -42,4 +42,4 @@ jobs:
commit-message: "Auto-format code using autopep8"
title: "Auto-format code by autopep8"
body: "This is an auto-generated PR with fixes by autopep8."
branch: main-autopep8
branch: main-autopep8
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ __pycache__/
*.pyc
dist

.vscode/
.vscode/
.coverage
src/acom_music_box/examples/configs/ts1/initial_config.json
4 changes: 3 additions & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cff-version: 1.2.0
message: If you use this software, please cite it as below.
title: MusicBox
version: v2.5.5
version: v2.6.0
authors:
- family-names: Dawson
given-names: Matthew
Expand All @@ -19,5 +19,7 @@ authors:
given-names: Brendan
- family-names: Drews
given-names: Carl
- family-names: Kiran
given-names: Aditya
license: Apache-2.0
url: "https://github.com/NCAR/music-box"
68 changes: 63 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ MusicBox: A MUSICA model for boxes and columns.

[![License](https://img.shields.io/github/license/NCAR/music-box.svg)](https://github.com/NCAR/music-box/blob/main/LICENSE)
[![CI Status](https://github.com/NCAR/music-box/actions/workflows/CI_Tests.yml/badge.svg)](https://github.com/NCAR/music-box/actions/workflows/CI_Tests.yml)
[![codecov](https://codecov.io/github/NCAR/music-box/graph/badge.svg?token=OR7JEQJSRQ)](https://codecov.io/github/NCAR/music-box)
[![PyPI version](https://badge.fury.io/py/acom-music-box.svg)](https://badge.fury.io/py/acom-music-box)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.14008358.svg)](https://doi.org/10.5281/zenodo.14008358)

Copyright (C) 2020 National Center for Atmospheric Research

Copyright (C) 2020 National Science Foundation - National Center for Atmospheric Research

# Installation
```
Expand All @@ -30,22 +33,77 @@ Run an example. Notice that the output, in csv format, is printed to the termina
music_box -e Chapman
```

Output can be saved to a csv file and printed to the terminal.

```
music_box -e Chapman -o output.csv
```

Output can be saved to a csv file and the terminal output can be suppressed by specifying the `--output-format`

```
music_box --output-format csv -e Chapman -o output.csv
```

Output can be saved to a file as netcdf file when `--output-format` netcdf is passed

```
music_box --output-format netcdf -e Chapman -o output.nc
```

Output can be saved to a file in csv format when a filename is not specified. In this case a timestamped csv file is made

```
music_box --output-format csv -e Chapman
```

Output can be saved to a file in netcdf format when a filename is not specified. In this case a timestamped netcdf file is made

```
music_box --output-format netcdf -e Chapman
```

You can also run your own configuration

```
music_box -c my_config.json
```

Output can be saved to a file
## Plotting
Some basic plots can be made to show concentrations throughout the simulation

### matplotlib

```
music_box -e Chapman -o output.csv
music_box -e Chapman -o output.csv --plot O1D
```

You can also make multiple plots by specifying groupings of species

```
music_box -e TS1 --plot O3 --plot PAN,HF
```

Note that the windows may overlap each other

By default all plot units are in `mol m-3`. You can see a list of unit options to specify with `--plot-output-unit`

```
music_box -h
```

It is used like this

```
music_box -e TS1 --output-format csv --plot O3 --plot-output-unit "ppb"
```

And, if you have gnuplot installed, some basic plots can be made to show some resulting concentrations
### gnuplot
If you want ascii plots (maybe you're running over ssh and can't view a graphical window), you can set
the plot tool to gnuplo (`--plot-tool gnuplot`) to view some output

```
music_box -e Chapman -o output.csv --color-output --plot CONC.O1D
music_box -e Chapman -o output.csv --plot O1D --plot-tool gnuplot
```

# Development and Contributing
Expand Down
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

version = acom_music_box.__version__
project = f'Music Box ({version})'
copyright = f'2024-{datetime.datetime.now().year}, NCAR/UCAR'
author = 'NCAR/UCAR'
copyright = f'2024-{datetime.datetime.now().year}, NSF-NCAR/UCAR'
author = 'NSF-NCAR/UCAR'

suffix = os.getenv("SWITCHER_SUFFIX", "")
release = f'{version}{suffix}'
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ classifiers = ["License :: OSI Approved :: Apache Software License"]
dynamic = ["version", "description"]

dependencies = [
"musica==0.8.1",
"musica==0.9.0",
"xarray",
"colorlog",
"pandas",
Expand All @@ -41,5 +41,6 @@ waccmToMusicBox = "acom_music_box.tools.waccmToMusicBox:main"
[project.optional-dependencies]
dev = [
"pytest",
"pytest-mock"
"pytest-mock",
"pytest-cov"
]
4 changes: 3 additions & 1 deletion src/acom_music_box/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
This package contains modules for handling various aspects of a music box,
including species, products, reactants, reactions, and more.
"""
__version__ = "2.5.5"
__version__ = "2.6.0"

from .utils import convert_time, convert_pressure, convert_temperature, convert_concentration
from .model_options import BoxModelOptions
Expand All @@ -13,3 +13,5 @@
from .evolving_conditions import EvolvingConditions
from .music_box import MusicBox
from .examples import Examples
from .data_output import DataOutput
from .plot_output import PlotOutput
Loading
Loading