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

Python box model #147

Merged
merged 82 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
c78ab07
setting up a cmake structure for c++
K20shores Feb 22, 2024
24d93e4
python box model iniital classes
alexjamesgarza Feb 29, 2024
b72c48b
added method for generating species config
alexjamesgarza Mar 1, 2024
398d571
added relative tolerance to spec config
alexjamesgarza Mar 1, 2024
8edf3b9
added method to generate reaction config
alexjamesgarza Mar 1, 2024
c421e08
added generateConfig documentation and todo solve function
alexjamesgarza Mar 1, 2024
55815eb
added todo readfromjson function
alexjamesgarza Mar 1, 2024
6ad84c8
added params to reaction
alexjamesgarza Mar 1, 2024
d7e228a
updated Reaction and getReactionConfig to handle A B D E and Ea param…
alexjamesgarza Mar 1, 2024
70007b2
can mostly parse json file from UI
eadlg2 Mar 1, 2024
67a45b0
implemented skeleton logic for solver
alexjamesgarza Mar 3, 2024
a9b0781
extracted concentrations and reaction rates from evolving conditions
eadlg2 Mar 3, 2024
3adbc51
added initial reaction rates, need to verify
eadlg2 Mar 3, 2024
ecbe62a
made conversion functions to shorten code
eadlg2 Mar 4, 2024
f34bd93
tested parsing with example that had every option
eadlg2 Mar 20, 2024
a1d5370
added other reaction types and refactored some code
eadlg2 Mar 21, 2024
cb8a62e
fixed bug in species list
eadlg2 Mar 21, 2024
a5fa131
fixed bug in reaction list
eadlg2 Mar 21, 2024
4aea08c
generateReactionConfig accounts for the different types of reactions
eadlg2 Mar 23, 2024
37ac711
added funciton to create micm solver based on config
alexjamesgarza Mar 25, 2024
156a4d0
added funciton to create micm solver based on config
alexjamesgarza Mar 25, 2024
bbe8d0f
working towards box model test
alexjamesgarza Mar 25, 2024
74ee215
adds function to read config json and tests basic reaction
alexjamesgarza Mar 26, 2024
0a4f600
fixed solve to inc by seconds
alexjamesgarza Mar 26, 2024
e13b7ee
convert time steps to seconds
eadlg2 Mar 26, 2024
a2888c4
updated solve with new time units
alexjamesgarza Mar 26, 2024
2521880
Changed readFromJson to readFromUIJosn
alexjamesgarza Mar 26, 2024
a9dca12
convert_pressure converts to Pa now
eadlg2 Mar 26, 2024
128528b
outputs results to file and creates file for initial test
alexjamesgarza Mar 26, 2024
2819f1f
reads species name from config
alexjamesgarza Mar 26, 2024
a7bde7c
sets up test config and get analytical concentrations
alexjamesgarza Mar 26, 2024
1b41f3b
aserts concentrations
alexjamesgarza Mar 26, 2024
54e3595
fixed comment typo
alexjamesgarza Mar 28, 2024
0004cb8
fixed output outputted based on output time step
alexjamesgarza Mar 28, 2024
5681a1e
changed time in output to output step time
alexjamesgarza Mar 28, 2024
3a16c78
added hr to time conversion:
alexjamesgarza Mar 28, 2024
3ec21d0
removed print stat
alexjamesgarza Mar 28, 2024
cccd3b0
removed print statement
alexjamesgarza Mar 28, 2024
7073097
config files generatable
eadlg2 Mar 28, 2024
7848c9a
Merge branch 'python_box_model' of https://github.com/NCAR/music-box …
eadlg2 Mar 28, 2024
25d103b
initial reaction rates added to generate config
eadlg2 Mar 28, 2024
3056132
reads species from json from camp_data
alexjamesgarza Mar 28, 2024
e1be71b
Merge branch 'python_box_model' of https://github.com/NCAR/music-box …
alexjamesgarza Mar 28, 2024
1b69d32
box model pr
alexjamesgarza Mar 28, 2024
e29aa38
handle cases without pressure and temperature in evolving conditions …
eadlg2 Mar 28, 2024
ec067c1
Merge branch 'python_box_model' of https://github.com/NCAR/music-box …
eadlg2 Mar 28, 2024
2cb5e74
able to recreate test config in UI, parse it, and use in python_test_1
eadlg2 Apr 1, 2024
4d4f1ef
reads reaction list from config json
alexjamesgarza Apr 2, 2024
4e1d991
restructured functions
alexjamesgarza Apr 2, 2024
4552c4d
fixed missing reaction list param in from_config_JSON
alexjamesgarza Apr 2, 2024
0f6b434
can generate evolving_conditions.csv for config
eadlg2 Apr 2, 2024
6e6d568
implemented species and rate ordering in solve
alexjamesgarza Apr 2, 2024
c94bfa7
Merge branch 'python_box_model' of https://github.com/NCAR/music-box …
alexjamesgarza Apr 2, 2024
be0484d
moved where ordered arrays are computed
alexjamesgarza Apr 2, 2024
597c508
updated headers to match ordered array
alexjamesgarza Apr 2, 2024
8cea0c8
fixed evolving conditions not setting attributes correctly
alexjamesgarza Apr 2, 2024
a858456
fixed unit issue with pressure for setting up evolving conditions
eadlg2 Apr 2, 2024
3e59536
added reaction type prefixes in order_reaction_ratesz
alexjamesgarza Apr 2, 2024
c849c6f
changed evolving conditions to update in a while loop in case chem ti…
alexjamesgarza Apr 4, 2024
1facdae
updated python test 3
alexjamesgarza Apr 4, 2024
2b8bf84
creates test for chapman in python_test_3.py
alexjamesgarza Apr 4, 2024
8414a38
renamed tests to be more descriptive
alexjamesgarza Apr 4, 2024
66d2683
added test file for wall-loss
alexjamesgarza Apr 4, 2024
745d7d5
include base values for reactions, change C back to Ea
eadlg2 Apr 4, 2024
dbcbb9f
Merge branch 'python_box_model' of https://github.com/NCAR/music-box …
eadlg2 Apr 4, 2024
993fbdf
add species not present in initial conditions for order_species_conce…
eadlg2 Apr 4, 2024
0ad1d29
removed unused files
alexjamesgarza Apr 4, 2024
df7d99e
Merge branch 'python_box_model' of https://github.com/NCAR/music-box …
alexjamesgarza Apr 4, 2024
0db500e
removed unused files
alexjamesgarza Apr 4, 2024
81b820b
created .whl for music_box package
alexjamesgarza Apr 4, 2024
5315cc0
make sure time in evolving conditions is float
eadlg2 Apr 6, 2024
9663de5
check reaction names correctly for evolving conditions config, ensure…
eadlg2 Apr 6, 2024
b78fafc
added function to read from UI json string
alexjamesgarza Apr 6, 2024
2bcc8bf
Merge branch 'python_box_model' of https://github.com/NCAR/music-box …
alexjamesgarza Apr 6, 2024
9908e61
removing fortran things, using musica python module, creating install…
K20shores Apr 9, 2024
d290604
converting tests to pytest
K20shores Apr 9, 2024
5e11aa4
correcting setup python?
K20shores Apr 9, 2024
085e896
adding a space
K20shores Apr 9, 2024
9e50e85
strategy
K20shores Apr 9, 2024
d9820c8
installing music_box in CI
K20shores Apr 9, 2024
11bf7a4
newer checkout
K20shores Apr 9, 2024
81d22d6
pypi publish
K20shores Apr 9, 2024
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
18 changes: 0 additions & 18 deletions .dockerignore

This file was deleted.

61 changes: 22 additions & 39 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,35 @@
name: Create and publish a Docker image
name: Publish a pypi package

on:
push:
branches: ['release']
tags:
- '*'

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
release:
types: [created]

jobs:
build-and-push-image:
publish_to_pypi:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: recursive

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to the Container repository
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
uses: actions/checkout@v4

- name: Build and push Docker image
uses: docker/build-push-action@v5
- name: Set up Python
uses: actions/setup-python@v2
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
python-version: '3.9'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Build and publish package
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
pipx run build
pipx run twine check dist/*
python -m twine upload --repository pypi dist/*
35 changes: 27 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,36 @@
name: build

on: [push, pull_request]
on: [push, workflow_dispatch]

jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]

runs-on: ubuntu-latest

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2

- uses: actions/checkout@v4
with:
submodules: recursive
- name: build Docker image
run: docker build -t music-box-test . --build-arg TAG_ID=chapman
- name: run tests in container
run: docker run --name test-container -t music-box-test bash -c 'cd /music-box/build; make test'

- uses: actions/setup-python@v5
with:
python-version: '3.9'
cache: 'pip'

- run: pip install -r requirements.txt

- name: Install this package
run: pip install -e .

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Run tests
run: |
cd tests
pytest
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ CMakeFiles/
doc/html/
doc/latex/
data/
__pycache__/
*.pyc
dist
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

35 changes: 0 additions & 35 deletions CMakeLists.txt

This file was deleted.

84 changes: 0 additions & 84 deletions Dockerfile

This file was deleted.

Loading