Science Score: 85.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 3 DOI reference(s) in README -
✓Academic publication links
Links to: zenodo.org -
✓Committers with academic emails
6 of 15 committers (40.0%) from academic institutions -
✓Institutional organization owner
Organization ncar has institutional domain (ncar.ucar.edu) -
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.3%) to scientific vocabulary
Keywords from Contributors
Repository
A box/column model using MICM chemistry
Basic Info
- Host: GitHub
- Owner: NCAR
- License: apache-2.0
- Language: Jupyter Notebook
- Default Branch: main
- Homepage: https://ncar.github.io/music-box/branch/main/
- Size: 28.7 MB
Statistics
- Stars: 35
- Watchers: 9
- Forks: 15
- Open Issues: 17
- Releases: 33
Metadata Files
README.md
MusicBox
MusicBox: A MUSICA model for boxes and columns.
Copyright (C) 2020 National Science Foundation - National Center for Atmospheric Research
Installation
pip install acom_music_box
If you would like GPU support, you must first add the NVIDIA pypi index and then you can specify the gpu install option for music box.
pip install --upgrade setuptools pip wheel
pip install nvidia-pyindex
pip install acom_music_box[gpu]
Using the MusicBox API
MusicBox makes its chemical mechanism analysis and visualization available through a Python API. The following example works through solving a simple chemistry system. Please refer to the official documentation for further tutorials and examples. ```python
Import MusicBox, MusicBox conditions, and Musica mechanisms:
from acommusicbox import MusicBox, Conditions import musica.mechanism_configuration as mc
Define the chemical system of interest
MusicBox uses Musica (https://ncar.github.io/musica/index.html) to create specific chemical species and phases of interest for chemical mechanisms.
A = mc.Species(name="A") B = mc.Species(name="B") C = mc.Species(name="C")
species = {"A":A, "B":B, "C":C}
gas = mc.Phase(name="gas", species=list(species.values()))
Define a mechanism of interest
Through Musica, several different mechanisms can be explored to define reaction rates. Here, we use the Arrhenius equation as a simple example.
arr1 = mc.Arrhenius(name="A->B", A=4.0e-3, C=50,reactants=[species["A"]], products=[species["B"]], gas_phase=gas)
arr2 = mc.Arrhenius(name="B->C", A=1.2e-4, B=2.5, C=75, D=50, E=0.5, reactants=[species["B"]], products=[species["C"]], gas_phase=gas)
mechanism = mc.Mechanism(name="test_mechanism", species=list(species.values()),phases=[gas], reactions=[arr1, arr2])
Create a box model
To create a box model, including its mechanisms, conditions, length, time, and step times:
boxmodel = MusicBox() boxmodel.load_mechanism(mechanism)
In the box model, the initial set of conditions represent the starting environment for the reactions.
Both initial and evolving conditions are typically created alongside the creation of the box model:
boxmodel.initialconditions = Conditions(temperature=300.0, pressure=101000.0, species_concentrations={ "A": 1.0, "B": 3.0, "C": 5.0})
Evolving conditions represent a set of environmental and species values or rate constants that the box model should use at a specific time step.
The following adds an evolving condition to the model, the first float represents the time when the condition evolves:
boxmodel.addevolvingcondition(300.0,Conditions(temperature=290.0, pressure=100200.0, speciesconcentrations={"A": 1.0, "B": 3.0, "C": 10.0}))
boxmodel.boxmodeloptions.simulationlength = 20 # total simulation time boxmodel.boxmodeloptions.chemsteptime = 1 # time step for chemical reaction boxmodel.boxmodeloptions.outputsteptime = 4 # time step between each output
Solve your newly-created box model and view results:
df = box_model.solve() print(df)
To visualize specific results:
import matplotlib.pyplot as plt
df.plot(x='time.s', y=['CONC.A.mol m-3', 'CONC.B.mol m-3', 'CONC.C.mol m-3'], title='Concentration over time', ylabel='Concentration (mol m-3)', xlabel='Time (s)') plt.show()
```
Command line tool
MusicBox provides a command line tool that can run configurations as well as some pre-configured examples. Basic plotting can be done with matplotlib.
Checkout the command line options
music_box -h
Run an example. Notice that the output, in csv format, is printed to the terminal.
music_box -e Chapman
Output can be saved to a csv file (the default format) and printed to the terminal.
music_box -e Chapman -o output
Output can be saved to a csv file by specifying the .csv extension for Comma-Separated Values.
music_box -e Chapman -o output.csv
Output can be saved to a file as netcdf file by specifying the .nc file extension.
music_box -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 -e Chapman
You may also specify multiple output files with different formats, using the file extension.
music_box -e Analytical -o results.csv -o results.nc
You can also run your own configuration
music_box -c my_config.json
Plotting
Some basic plots can be made to show concentrations throughout the simulation using matplotlib.
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 --plot O3 --plot-output-unit "ppb"
Development and Contributing
For local development, install music-box as an editable installation:
pip install -e '.[dev]'
Tests
pytest
Owner
- Name: NSF National Center for Atmospheric Research
- Login: NCAR
- Kind: organization
- Location: Boulder, CO
- Website: http://ncar.ucar.edu
- Repositories: 934
- Profile: https://github.com/NCAR
NSF NCAR is sponsored by the U.S. National Science Foundation and managed by the University Corporation for Atmospheric Research.
Citation (CITATION.cff)
cff-version: 1.2.0
message: If you use this software, please cite it as below.
title: MusicBox
version: v2.9.1
authors:
- family-names: Dawson
given-names: Matthew
- family-names: Shores
given-names: Kyle
- family-names: Conley
given-names: Andrew
- family-names: De la Garza
given-names: Evan
- family-names: Drury
given-names: Walker
- family-names: Garza
given-names: Alexander
- family-names: Fattig
given-names: Brendan
- family-names: Drews
given-names: Carl
- family-names: Thind
given-names: Montek
- family-names: Kiran
given-names: Aditya
- family-names: Winney
given-names: Aidan
- family-names: Pak
given-names: Angela
license: Apache-2.0
url: "https://github.com/NCAR/music-box"
GitHub Events
Total
- Create event: 62
- Release event: 4
- Issues event: 67
- Watch event: 27
- Delete event: 56
- Member event: 4
- Issue comment event: 162
- Push event: 337
- Pull request review comment event: 190
- Pull request event: 119
- Pull request review event: 241
- Fork event: 5
Last Year
- Create event: 62
- Release event: 4
- Issues event: 67
- Watch event: 27
- Delete event: 56
- Member event: 4
- Issue comment event: 162
- Push event: 337
- Pull request review comment event: 190
- Pull request event: 119
- Pull request review event: 241
- Fork event: 5
Committers
Last synced: 9 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Matthew Dawson | m****n@u****u | 128 |
| Kyle Shores | k****4@g****m | 94 |
| s-omas | 4****s | 66 |
| github-actions[bot] | 4****] | 31 |
| Carl Drews | d****s@u****u | 12 |
| alexjamesgarza | 1****a | 6 |
| Andrew Conley | a****y@u****u | 5 |
| Montek Thind | m****d@u****u | 5 |
| Jiwon Gim | j****m@u****u | 5 |
| matchaSamurai | 9****3 | 3 |
| GitHub Actions | a****s@g****m | 3 |
| Mudassir Chapra | 3****0 | 1 |
| Evan De la Garza | 1****2 | 1 |
| AshayV04 | 1****4 | 1 |
| Matthew Dawson | m****n@m****u | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 137
- Total pull requests: 219
- Average time to close issues: 11 months
- Average time to close pull requests: 6 days
- Total issue authors: 13
- Total pull request authors: 18
- Average comments per issue: 0.76
- Average comments per pull request: 0.8
- Merged pull requests: 181
- Bot issues: 0
- Bot pull requests: 39
Past Year
- Issues: 52
- Pull requests: 120
- Average time to close issues: 17 days
- Average time to close pull requests: 2 days
- Issue authors: 9
- Pull request authors: 12
- Average comments per issue: 0.58
- Average comments per pull request: 1.1
- Merged pull requests: 93
- Bot issues: 0
- Bot pull requests: 29
Top Authors
Issue Authors
- mattldawson (51)
- K20shores (33)
- AndrewJConley (16)
- boulderdaze (10)
- angelapak (7)
- carl-drews (6)
- aidan-winney (5)
- marybarthbrock (2)
- adityakiran1423 (2)
- SancyW (2)
- kkowalsk (1)
- sjsprecious (1)
- jolsolsen (1)
Pull Request Authors
- K20shores (58)
- mattldawson (44)
- github-actions[bot] (39)
- carl-drews (14)
- aidan-winney (11)
- s-omas (11)
- angelapak (10)
- montythind (6)
- alexjamesgarza (6)
- boulderdaze (6)
- adityakiran1423 (3)
- AndrewJConley (3)
- DeeGrant (2)
- AshayV04 (2)
- eadlg2 (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 410 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 27
- Total maintainers: 3
pypi.org: acom-music-box
An atmospheric chemistry box model. Powered by MUSICA.
- Homepage: https://github.com/NCAR/music-box
- Documentation: https://acom-music-box.readthedocs.io/
- License: Apache Software License
-
Latest release: 2.9.1
published 8 months ago
Rankings
Maintainers (3)
Dependencies
- actions/checkout v2 composite
- fedora 35 build
- actions/checkout v2 composite
- docker/build-push-action v5 composite
- docker/login-action f054a8b539a109f9f41c372932f1ae047eff08c9 composite
- docker/metadata-action 98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 composite