-
Notifications
You must be signed in to change notification settings - Fork 0
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
Refactored main and restructured code #31
base: develop
Are you sure you want to change the base?
Conversation
…tructure there are still a lot of broken imports and references, so the code does not run yet.
…_main__.py still untested as I have to move the analysis steps to the DA subpackage before this will run
also created a placeholder for the parallel integrator tests planned
the restructuring continues
DA and blending are not covered in the tests, will look into them after refactoring the flow solver
since I removed all initial conditions except this
this is with the new ensemble data structure; the flow solver runs; yet to be tested.
…rrays at the end of the flow solver's looping this is because the tests were failing with a discrepancy.
validation step will be moved to dataclass structure
I will review. Are the docs checks supposed to succeed? |
Thank you. The checks broke due to the renaming of the subpackages. This issue has been resolved with the latest commits. But the pytests are broken now, as I am in the midst of restructuring the diagnostics module to accept more general definitions of test cases. |
more cleaning up is due for the diagnostics modules, but at least now the tests are no longer hardcoded. the blending has potential problems with failing tests, will look into this next.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not appear to work, at least out of the box:
[nhad@ac6-101 pyBELLA]$ pybella -ic rb -N 1
Traceback (most recent call last):
File "/home/nhad/.local/bin/pybella", line 8, in <module>
sys.exit(main())
^^^^^^
File "/etc/ecmwf/nfs/dh1_home_b/nhad/pyBELLA/src/__main__.py", line 30, in main
sim_state = prepare.initialise()
^^^^^^^^^^^^^^^^^^^^
File "/etc/ecmwf/nfs/dh1_home_b/nhad/pyBELLA/src/utils/prepare.py", line 43, in initialise
ud.coriolis_strength = np.array(ud.coriolis_strength)
^^^^^^^^^^^^^^^^^^^^
AttributeError: 'UserDataInit' object has no attribute 'coriolis_strength'
@@ -1,16 +0,0 @@ | |||
import pytest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 74 in the README
Line 74 in 2165bed
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not appear to work, at least not out of the box:
[nhad@ac6-101 pyBELLA]$ pybella -ic rb -N 1
Traceback (most recent call last):
File "/home/nhad/.local/bin/pybella", line 8, in <module>
sys.exit(main())
^^^^^^
File "/etc/ecmwf/nfs/dh1_home_b/nhad/pyBELLA/src/__main__.py", line 30, in main
sim_state = prepare.initialise()
^^^^^^^^^^^^^^^^^^^^
File "/etc/ecmwf/nfs/dh1_home_b/nhad/pyBELLA/src/utils/prepare.py", line 43, in initialise
ud.coriolis_strength = np.array(ud.coriolis_strength)
^^^^^^^^^^^^^^^^^^^^
AttributeError: 'UserDataInit' object has no attribute 'coriolis_strength'
@@ -0,0 +1,123 @@ | |||
import logging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With a view to the forthcoming published version, I would propose removing commented code lines sooner rather than later unless still part of prototyping (which probably should not end up in develop anyway?) or there is another very compelling reason to keep them in.
mpv, | ||
t, | ||
sst, | ||
mem, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice and compact
"PyYAML==6.0", | ||
"scipy==1.7.3", | ||
"termcolor==2.4.0" | ||
"dask", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2024.2.1
@@ -3,15 +3,15 @@ name = "pyBELLA" | |||
version = "0.50.1" | |||
|
|||
dependencies = [ | |||
"dask==2022.7.0", | |||
"dill==0.3.6", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0.3.8
@@ -3,15 +3,15 @@ name = "pyBELLA" | |||
version = "0.50.1" | |||
|
|||
dependencies = [ | |||
"dask==2022.7.0", | |||
"dill==0.3.6", | |||
"h5py==3.7.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3.12.1
"dask==2022.7.0", | ||
"dill==0.3.6", | ||
"h5py==3.7.0", | ||
"matplotlib==3.5.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3.8.4
"dill==0.3.6", | ||
"h5py==3.7.0", | ||
"matplotlib==3.5.1", | ||
"numba==0.56.4", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0.60.0
"h5py==3.7.0", | ||
"matplotlib==3.5.1", | ||
"numba==0.56.4", | ||
"numpy==1.22.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1.26.4
"matplotlib==3.5.1", | ||
"numba==0.56.4", | ||
"numpy==1.22.1", | ||
"PyYAML==6.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6.0.2
"numba==0.56.4", | ||
"numpy==1.22.1", | ||
"PyYAML==6.0", | ||
"scipy==1.7.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1.14.1
"numpy==1.22.1", | ||
"PyYAML==6.0", | ||
"scipy==1.7.3", | ||
"termcolor==2.4.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2.4.0
I was not updating mem attributes in the time update while loop. This means that everytime the blending scheme sees mem, it resets the solution fields to the beginning of the assimilation window.
I have not yet checked if the initial blending results are correct; will do this via the diagnostics module, but it does not work yet, as I have not yet generalised the target generation features.
…compare nothing really works yet, because there seems to be a discrepancy between the target saved and the test values computed and compared against the target values. This has something to do with how the time steps are counted. Will need to carry on debugging.
the generalised target generation in the diagnostics module now works, the problem was with writing the output before the mem attributes were correctly updated.
…ted with warm bubble test values blending is still switched off, but this commit allows for blending to be tested as a next step. woohoo.
__main__.py
is now cleaned, and all the initialisation and analysis steps have been moved to their respective modules or subpackages.