Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
a977ae7
freezing this version as the base comparison for the refactoring of t…
ray-chew Oct 3, 2024
f4ac3b4
checkpoint in restructuring and making the package more pythonic in s…
ray-chew Dec 18, 2024
5e995b8
done with restructuring the initialisation and preparation steps in _…
ray-chew Dec 18, 2024
91008f4
moved blending from main() into its own submodule
ray-chew Dec 18, 2024
c72f9a9
code runs until analysis step
ray-chew Dec 18, 2024
61e48c2
main has been restructured and all three dynamics tests passed
ray-chew Dec 18, 2024
3141e13
updated readme on how to run a single simulation
ray-chew Dec 18, 2024
8f5ac66
updated changelog
ray-chew Dec 18, 2024
37cfa63
updated run.py to run rising bubble test case
ray-chew Dec 18, 2024
91e0b53
Merge branch 'develop' into refactor
ray-chew Dec 18, 2024
527fcfe
refactored diagnostics.py a little
ray-chew Dec 18, 2024
55a8a16
cleaned up blending related code in the flow solver
ray-chew Dec 22, 2024
acdb0bc
renamed the dycore subpackage to flow_solver for consistency
ray-chew Dec 22, 2024
7f0b676
updated data structures for a proper sol_ens and simulation integrati…
ray-chew Dec 23, 2024
ee51566
updated thermodynamics data structure.
ray-chew Dec 23, 2024
91a1018
done refactoring the preparation and initialisation steps
ray-chew Dec 23, 2024
468f10c
updated analysis with new ensemble structure
ray-chew Dec 23, 2024
23a7817
reinstated a few changes in time_update; updating mem with solution a…
ray-chew Dec 23, 2024
5ca4174
updated docs from dycore to flow_solver
ray-chew Dec 23, 2024
bd2ede2
updated changelog
ray-chew Dec 23, 2024
a153faf
#6 diagnostics now compute either the sum or the norm as a target
ray-chew Dec 23, 2024
9b32880
reinstated run.py with refactored package structure
ray-chew Jan 3, 2025
7aba2e1
renamed test_dycore to test_flow_solver
ray-chew Jan 3, 2025
e6e043d
commented out validation attempt in user_data
ray-chew Jan 3, 2025
2165bed
working towards a first test case for the blending module
ray-chew Jan 6, 2025
9433f76
flow solver tests now work with the new diagnostics data structure
ray-chew Jan 6, 2025
c7ff474
cleaned up blending module; do_blending_bef_timestep accepts mem data…
ray-chew Jan 10, 2025
a4c7b5c
fixed failing flow solver tests
ray-chew Jan 12, 2025
8068cd2
blending routine runs with new data structures
ray-chew Jan 12, 2025
613a20f
WIP: generalised generate target for diagnostics and reinstated plot_…
ray-chew Jan 12, 2025
bc67edc
minor refactoring of utils.io and utils.prepare
ray-chew Jan 12, 2025
035e8a0
fixed bug with discrepancy between generated target and test values
ray-chew Jan 12, 2025
823c1a7
update all test ICs to support updating target; test_targets.yml upda…
ray-chew Jan 12, 2025
228a2aa
added comments for DiagnosticState attributes
ray-chew Jan 13, 2025
2fdade9
extended diagnostics module to output more sensible plots
ray-chew Jan 15, 2025
6957aa0
black formatted whole repo
ray-chew May 27, 2025
ca350c6
updated test diagnostics to compute L2 and max norms as errors, toler…
ray-chew May 31, 2025
df7bf1c
fixed pressure imprint bug #34
ray-chew May 31, 2025
efe180f
latest yml targets
ray-chew May 31, 2025
e3666b3
moved diagnostics tolerance check to the max abs error. all tests pass.
ray-chew May 31, 2025
d374d83
fully separated the blending module (#3)
ray-chew Jun 1, 2025
0977398
created debug writer object
ray-chew Jun 1, 2025
4afbf21
removed deprecated functions to run with modern Python
ray-chew Jun 4, 2025
30c46ff
updated requirements.txt
ray-chew Jun 4, 2025
3d951e3
first attempt at reinstating unstable lamb IC (#37)
ray-chew Jun 4, 2025
23c18fc
unstable lamb wave test (#37) is getting close to Chew et al. 2022
ray-chew Jun 5, 2025
a022975
fixed non-fatal bug in UserDataInit
ray-chew Jun 5, 2025
9c7fe8d
refactor io import run scripts
ray-chew Jun 5, 2025
6519911
fixed typo in EnsembleState.get_grid
ray-chew Jun 5, 2025
3303b48
renamed LAMB_BDRY with ATMOSPHERIC_EXTENSION
ray-chew Jun 5, 2025
3fc6f1a
fixed typo in the unstable lamb test
ray-chew Jun 5, 2025
8cf995a
rethought the flow solver tests
ray-chew Jun 5, 2025
a7bcf18
extended hydrostatics module to integrate or provide analytical backg…
ray-chew Jun 5, 2025
3fae733
make the rising bubble test work with the intergrated hydrostatic module
ray-chew Jun 5, 2025
c5a1575
moved tests to a specific subdirectory
ray-chew Jun 6, 2025
b43d1f9
moved rayleigh boundary handling to boundary.py (#36)
ray-chew Jun 6, 2025
1aca178
added a skeleton .coveragerc file
ray-chew Jun 6, 2025
bbabcbe
updated workflow file for tests, coverage, and doc deployment
ray-chew Jun 6, 2025
af39d8b
added stripped target outputs for CI tests
ray-chew Jun 7, 2025
f7fd1f2
updated test IC files to be consistent with target outputs
ray-chew Jun 7, 2025
308396f
fixed issues in deploy.yml
ray-chew Jun 7, 2025
c8d9be9
added postprocessing interface method to strip target files
ray-chew Jun 7, 2025
02bac19
this approach with pyproject.toml might work more generally
ray-chew Jun 7, 2025
32edb8a
updated .gitignore
ray-chew Jun 7, 2025
7f49709
updated requirements.txt to no longer install ancient dependencies
ray-chew Jun 7, 2025
a2064b4
cleaned up time_update.py
ray-chew Jun 7, 2025
4e38157
overlooked a few issues that would cause CI to fail
ray-chew Jun 7, 2025
944b922
Using the default src layout for setuptools auto discovery
ray-chew Jun 7, 2025
bf172d9
reducing the number of timesteps and increasing tolerance for unstabl…
ray-chew Jun 7, 2025
4a1bccb
extended diagnostics for the time increments in blending tests
ray-chew Jun 7, 2025
554fa54
latest target file for the unstable lamb test
ray-chew Jun 7, 2025
539df0b
reinstate all tests in deploy.yml
ray-chew Jun 7, 2025
ef4d9eb
added target file for the blending warm bubble test
ray-chew Jun 7, 2025
f35b911
CI to also upload logs into artifact
ray-chew Jun 7, 2025
643b52e
further increase tolerance for unstable lamb test
ray-chew Jun 7, 2025
cbb54a1
removing docs compilation for now until refactoring is done
ray-chew Jun 7, 2025
cac7ffb
added commands for coverage and profiler to readme; updated gitignore
ray-chew Jun 7, 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
20 changes: 20 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[run]
source = src
omit =
src/data_assimilation/*
src/inputs/*
src/utils/debug_helpers.py
*/tests/*
*/test_*
setup.py

[report]
exclude_lines =
pragma: no cover
def __repr__
raise AssertionError
raise NotImplementedError
if __name__ == .__main__.:

[html]
directory = htmlcov
94 changes: 94 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: deploy

on: [push, pull_request, workflow_dispatch]

permissions:
contents: write

jobs:
integration-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

# Skip setup-python if running under act
- name: Set up Python (GitHub only)
if: ${{ !env.ACT }}
uses: actions/setup-python@v5
with:
python-version: '3.10'

# Show system Python version when running under act
- name: Use system Python (act)
if: ${{ env.ACT }}
run: |
echo "Using system Python"
which python
python --version

- name: Install dependencies
run: |
pip install -r dev-requirements.txt
pip install .

- name: Run tests without coverage
run: |
# pytest --cov=src --cov-report=xml --cov-report=html --cov-report=term
pytest ./test_scripts/test_blending.py
pytest ./test_scripts/test_flow_solver.py

# - name: Upload coverage HTML report
# if: ${{ !env.ACT }}
# uses: actions/upload-artifact@v4
# with:
# name: coverage-html
# path: htmlcov/

- name: Upload test plots and logs
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v4
with:
name: test-outputs
path: |
outputs/**/*.png
logs/**/*.log
!outputs/**/*.dat
!outputs/**/*.h5

# docs:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4

# - uses: ConorMacBride/install-package@v1
# with:
# apt: graphviz

# - uses: actions/setup-python@v5
# with:
# python-version: '3.10'

# - uses: actions/cache@v4
# with:
# path: ~/.cache/pip
# key: ${{ runner.os }}-pip-${{ hashFiles('**/dev-requirements.txt') }}
# restore-keys: |
# ${{ runner.os }}-pip-

# - name: Install dependencies
# run: |
# pip install -r dev-requirements.txt
# pip install .

# - name: Sphinx build
# run: |
# sphinx-build docs/source _build

# - name: Deploy to GitHub Pages
# uses: peaceiris/actions-gh-pages@v4
# if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
# with:
# publish_branch: gh-pages
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: _build/
# force_orphan: true
33 changes: 0 additions & 33 deletions .github/workflows/documentation.yml

This file was deleted.

12 changes: 11 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,19 @@
**dask-worker-space*
*.ipynb_checkpoints*
*.egg-info*
*.coverage*
profile.html
profile.json

# Ignore everything under outputs/
outputs/**

# Do not ignore directories (so unignore rules can match their contents)
!outputs/
!outputs/**/
!outputs/**/*_stripped.h5

# Ignore local development and output subdirectories
**outputs*
**build*
**changelog.d*

Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
0.60.0 (2024-12-23)
-------------------

Changed
^^^^^^^

- Restructured outermost looping in main() (23a7817db225fe2188bcf3045cfdc863435b6888)


0.50.6 (2024-12-10)
-------------------

Changed
^^^^^^^

- Cleaned __main__ with restructuring of code (61e48c2c60e32aa8ac7699979a9836c8d17ded64)


0.50.5 (2024-03-24)
-------------------

Expand Down
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,13 @@ A simple test can be found in [`run_scripts.test_dycore`](https://github.com/ray
pytest ./run_scripts/test_dycore.py -v
```

However, the codebase is structured such that the user can easily assemble a run script to define their own experiments. Refer to the documentation for the [available APIs](https://ray-chew.github.io/pyBELLA/apis.html).
To run a simulation:
```console
pybella -ic rb -N 1
```
Note that only the rising bubble initial condition is implemented for now with ensemble size of 1.

The codebase is structured such that the user can easily assemble a run script to define their own experiments. Refer to the documentation for the [available APIs](https://ray-chew.github.io/pyBELLA/apis.html).

## License

Expand All @@ -86,3 +92,14 @@ Refer to the [open issues](https://github.com/ray-chew/pyBELLA/issues), in parti

Any changes, improvements, or bug fixes can be submitted from your remote to upstream via a pull request.

## To be tidied up

### Profiler
```bash
$ PYTHONPATH=src scalene -m pybella -ic test_lamb_wave -N 1
```

### Coverage
```bash
$ pytest --cov test_scripts/ --cov-report=html
```
30 changes: 14 additions & 16 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
dask==2022.7.0
dask[distributed]==2022.7.0
dill==0.3.6
h5py==3.7.0
matplotlib==3.5.1
numba==0.56.4
numpy==1.22.1
pyemd==1.0.0
pytest==8.1.1
PyYAML==6.0
scipy==1.7.3
termcolor==2.4.0
dill
h5py
matplotlib
numba
numpy
pytest
scipy
dask
pytest
pytest-cov
# dependencies for documentation
sphinx==7.2.6
sphinx_changelog==1.5.0
sphinx-math-dollar==1.2.1
furo==2024.1.29
sphinx
sphinx_changelog
sphinx-math-dollar
furo
32 changes: 0 additions & 32 deletions docs/source/apis/src.dycore.discretisation.rst

This file was deleted.

36 changes: 0 additions & 36 deletions docs/source/apis/src.dycore.physics.gas_dynamics.rst

This file was deleted.

33 changes: 0 additions & 33 deletions docs/source/apis/src.dycore.physics.low_mach.rst

This file was deleted.

33 changes: 0 additions & 33 deletions docs/source/apis/src.dycore.physics.rst

This file was deleted.

Loading