-
Notifications
You must be signed in to change notification settings - Fork 20
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
Use one single model module #22
Comments
Some notes for upcoming PR... There are three versions of the L96 python module:
The smallest difference is between
Replacing all The larger differences are between
I suggest we adopt the extended model and then shorten the name back to |
Two versions of L96_model_XYtrend.py differed due to the addition of an optional argument (advect=True) in the latest version: ``` $ find . -name "L96*trend.py" | xargs md5sum | sort 01fb2a1bb99e26d2a8785d7f30b8e368 ./04Subgrid-parametrization-pytorch/L96_model_XYtend.py 01fb2a1bb99e26d2a8785d7f30b8e368 ./06Different-ML-models/L96_model_XYtend.py 01fb2a1bb99e26d2a8785d7f30b8e368 ./07-Interpretability-of-ML/L96_model_XYtend.py c4d6e77fd3185920d182f7e113cc34eb ./08-Implementation/L96_model_XYtend.py ``` This replaces the all versions with a single version. Partly addresses m2lines#22
- A second version of L96_model.py had been added solely to obtain the tendency of X through the coupling term. - This adds a new function to calculate the coupling term and an optional argument to the `.run()` method that returns the tendency due to coupling. - Removed second copies of L96 model (L96_model_XYtend.py). - Updated notebooks to use correct model and with necessary optional argument. - All L96_model.py files are now identical. - Addresses m2lines#22
Two versions of L96_model_XYtrend.py differed due to the addition of an optional argument (advect=True) in the latest version: ``` $ find . -name "L96*trend.py" | xargs md5sum | sort 01fb2a1bb99e26d2a8785d7f30b8e368 ./04Subgrid-parametrization-pytorch/L96_model_XYtend.py 01fb2a1bb99e26d2a8785d7f30b8e368 ./06Different-ML-models/L96_model_XYtend.py 01fb2a1bb99e26d2a8785d7f30b8e368 ./07-Interpretability-of-ML/L96_model_XYtend.py c4d6e77fd3185920d182f7e113cc34eb ./08-Implementation/L96_model_XYtend.py ``` This replaces the all versions with a single version. Partly addresses m2lines#22
- A second version of L96_model.py had been added solely to obtain the tendency of X through the coupling term. - This adds a new function to calculate the coupling term and an optional argument to the `.run()` method that returns the tendency due to coupling. - Removed second copies of L96 model (L96_model_XYtend.py). - Updated notebooks to use correct model and with necessary optional argument. - All L96_model.py files are now identical. - Addresses m2lines#22
Two versions of L96_model_XYtend.py differed due to the addition of an optional argument (advect=True) in the last version: ``` md5sum */L96_model_XYtend.py 09796cc98b8707628e40ce23faf4de5e 04Subgrid-parametrization-pytorch/L96_model_XYtend.py 09796cc98b8707628e40ce23faf4de5e 06Different-ML-models/L96_model_XYtend.py 09796cc98b8707628e40ce23faf4de5e 07-Interpretability-of-ML/L96_model_XYtend.py 820867dc282f9837ca1c1b3734978a0d 08-Implementation/L96_model_XYtend.py ``` Simply copying the last version over the earlier three reduces the total number of version of the L96 model from three to two: ``` md5sum */L96*.py 2ae7140bceff4a350cd79804c3edd6f8 01Intro/L96_model.py 2ae7140bceff4a350cd79804c3edd6f8 02type-of-parametrization/L96_model.py 2ae7140bceff4a350cd79804c3edd6f8 03Data-Assimilation/L96_model.py 820867dc282f9837ca1c1b3734978a0d 04Subgrid-parametrization-pytorch/L96_model_XYtend.py 2ae7140bceff4a350cd79804c3edd6f8 05Offline-DA-increments/L96_model.py 2ae7140bceff4a350cd79804c3edd6f8 06Different-ML-models/L96_model.py 820867dc282f9837ca1c1b3734978a0d 06Different-ML-models/L96_model_XYtend.py 820867dc282f9837ca1c1b3734978a0d 07-Interpretability-of-ML/L96_model_XYtend.py 820867dc282f9837ca1c1b3734978a0d 08-Implementation/L96_model_XYtend.py ``` This is one step toward addressing m2lines#22 goal of having one single L96 module file.
There were two versions of the L96 model module that differd in whether they returned the coupling term. The coupling term is now returned from the L96s.run() method if the option return_coupling=True is provided. - Updated all L96_model*.py to be identical - Updated notebook where changes were needed - Removed one unused copy of L96_model.py Still todo for m2lines#22: [ ] change name of L96 module py files to be the same [ ] move all files to the same directory
There were two versions of the L96 model module that differd in whether they returned the coupling term. The coupling term is now returned from the L96s.run() method if the option return_coupling=True is provided. - Updated all L96_model*.py to be identical - Updated notebook where changes were needed - Removed one unused copy of L96_model.py - Notebook 04Subgrid-parametrization-pytorch/Neural_network_for_Lorenz96.ipynb was incomplete due to a path issue so has new figures for some cells Still todo for m2lines#22: [ ] change name of L96 module py files to be the same [ ] move all files to the same directory
There were two versions of the L96 model module that differd in whether they returned the coupling term. The coupling term is now returned from the L96s.run() method if the option return_coupling=True is provided. - Updated all L96_model*.py to be identical - Updated notebook where changes were needed - Removed one unused copy of L96_model.py - Notebook 04Subgrid-parametrization-pytorch/Neural_network_for_Lorenz96.ipynb was incomplete due to a path issue so has new figures for some cells Still todo for m2lines#22: [ ] change name of L96 module py files to be the same [ ] move all files to the same directory
There were two versions of the L96 model module that differd in whether they returned the coupling term. The coupling term is now returned from the L96s.run() method if the option return_coupling=True is provided. - Updated all L96_model*.py to be identical - Updated notebook where changes were needed - Removed one unused copy of L96_model.py - Notebook 04Subgrid-parametrization-pytorch/Neural_network_for_Lorenz96.ipynb was incomplete due to a path issue so has new figures for some cells Still todo for m2lines#22: [ ] change name of L96 module py files to be the same [ ] move all files to the same directory
- All notebooks moved to top directory - Associated files (e.g. network files or figures) moved upwards also - Redundant files removed (copies of L96_model.py) - PDF files grouped into pdf/ directory Still todo for m2lines#22 [ ] do something about LRP_gradient.py and DA_methods.py (which should be in notebooks)
- All notebooks moved to top directory - Associated files (e.g. network files or figures) moved upwards also - Redundant files removed (copies of L96_model.py) - PDF files grouped into pdf/ directory - Fixed two relative paths Note: requirements.txt moved form 04Subgrid-parameterization-pytorch to top directory. Still todo for m2lines#22 [ ] do something about LRP_gradient.py and DA_methods.py (which should be in notebooks)
- All notebooks moved to single directory ("notebooks") - Associated files (e.g. network files or figures) moved also - Redundant files removed (copies of L96_model.py) - PDF files grouped into pdf/ directory - Fixed two relative paths Note: requirements.txt moved form 04Subgrid-parameterization-pytorch to top directory. Still todo for m2lines#22 [ ] do something about LRP_gradient.py and DA_methods.py (which should be in notebooks)
commit 1af111e Author: Alistair Adcroft <aadcroft@princeton.edu> Date: Sat May 7 17:17:45 2022 -0400 Moved notebooks into same directory - All notebooks moved to single directory ("notebooks") - Associated files (e.g. network files or figures) moved also - Redundant files removed (copies of L96_model.py) - PDF files grouped into pdf/ directory - Fixed two relative paths Note: requirements.txt moved form 04Subgrid-parameterization-pytorch to top directory. Still todo for m2lines#22 [ ] do something about LRP_gradient.py and DA_methods.py (which should be in notebooks) commit b3219fd Author: Alistair Adcroft <aadcroft@princeton.edu> Date: Sat May 7 16:48:58 2022 -0400 Added generated files to .gitignore Some notebooks are storing data and images that are not reproducible and do not need to be version controlled. I've added them to .gitignore but we might want to stop storing/saving some of these files instead. commit d3a937a Author: Alistair Adcroft <aadcroft@princeton.edu> Date: Sat May 7 15:47:25 2022 -0400 Renamed L96_model_XYtend.py to L96_model.py Renames four files and updates associated notebooks. This is in preparation for moving all notebooks into the same directory. commit a34f3a3 Author: Alistair Adcroft <aadcroft@princeton.edu> Date: Sat May 7 14:56:15 2022 -0400 Reconciled all versions of L96 models There were two versions of the L96 model module that differd in whether they returned the coupling term. The coupling term is now returned from the L96s.run() method if the option return_coupling=True is provided. - Updated all L96_model*.py to be identical - Updated notebook where changes were needed - Removed one unused copy of L96_model.py - Notebook 04Subgrid-parametrization-pytorch/Neural_network_for_Lorenz96.ipynb was incomplete due to a path issue so has new figures for some cells Still todo for m2lines#22: [ ] change name of L96 module py files to be the same [ ] move all files to the same directory commit 6bb2122 Author: Alistair Adcroft <aadcroft@princeton.edu> Date: Sat May 7 12:32:42 2022 -0400 Replaced L96_model_XYtend.py variants with same version Two versions of L96_model_XYtend.py differed due to the addition of an optional argument (advect=True) in the last version: ``` md5sum */L96_model_XYtend.py 09796cc98b8707628e40ce23faf4de5e 04Subgrid-parametrization-pytorch/L96_model_XYtend.py 09796cc98b8707628e40ce23faf4de5e 06Different-ML-models/L96_model_XYtend.py 09796cc98b8707628e40ce23faf4de5e 07-Interpretability-of-ML/L96_model_XYtend.py 820867dc282f9837ca1c1b3734978a0d 08-Implementation/L96_model_XYtend.py ``` Simply copying the last version over the earlier three reduces the total number of version of the L96 model from three to two: ``` md5sum */L96*.py 2ae7140bceff4a350cd79804c3edd6f8 01Intro/L96_model.py 2ae7140bceff4a350cd79804c3edd6f8 02type-of-parametrization/L96_model.py 2ae7140bceff4a350cd79804c3edd6f8 03Data-Assimilation/L96_model.py 820867dc282f9837ca1c1b3734978a0d 04Subgrid-parametrization-pytorch/L96_model_XYtend.py 2ae7140bceff4a350cd79804c3edd6f8 05Offline-DA-increments/L96_model.py 2ae7140bceff4a350cd79804c3edd6f8 06Different-ML-models/L96_model.py 820867dc282f9837ca1c1b3734978a0d 06Different-ML-models/L96_model_XYtend.py 820867dc282f9837ca1c1b3734978a0d 07-Interpretability-of-ML/L96_model_XYtend.py 820867dc282f9837ca1c1b3734978a0d 08-Implementation/L96_model_XYtend.py ``` This is one step toward addressing m2lines#22 goal of having one single L96 module file.
- All notebooks moved to single directory ("notebooks") - Associated files (e.g. network files or figures) moved also - Redundant files removed (copies of L96_model.py) - PDF files grouped into pdf/ directory - Fixed two relative paths Note: requirements.txt moved form 04Subgrid-parameterization-pytorch to top directory. Still todo for m2lines#22 [ ] do something about LRP_gradient.py and DA_methods.py (which should be in notebooks)
This was fixed by #32. |
The original
L96_model.py
file has been copied between every different section. This is a potential source of errors and inconsistencies. Here is a list of all of the modules in the repoWe should try to consolidate around a single file.
Steps:
Furthermore, we should try to eliminate the use of modules for anything other than L96 itself. This means
L96_model_XYtend.py
,LRP_gradient.py
,DA_methods.py
: all of this should be in notebooks, not modules.The text was updated successfully, but these errors were encountered: