-
Notifications
You must be signed in to change notification settings - Fork 0
Remove unused code in forecasting pipeline #84
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
Conversation
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.
Pull Request Overview
This pull request restructures the package from a lib/ directory-based approach to a proper Python package structure under src/nemo_spinup_forecast/, while removing unused code and updating configuration files for modern Python packaging practices.
Key Changes:
- Migrated code from
lib/tosrc/nemo_spinup_forecast/package structure - Removed unused utility scripts (shell scripts in
tools/) and standalone Python files - Replaced
setup.py+requirements.txt+pytest.iniwith modernpyproject.toml - Added new test infrastructure (
download_test_data.sh) and expanded test coverage
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
tools/xarray_to_CMIP.sh |
Deleted unused shell script for coordinate renaming |
tools/rename.sh |
Deleted unused shell script for directory reorganization |
tools/CMIP_to_xarray.sh |
Deleted unused shell script for coordinate transformation |
standalone/restarter_V2.py |
Deleted unused standalone restart file manipulation script |
standalone/restarter.py |
Deleted unused standalone restart file manipulation script |
lib/restart.py |
Deleted old library file (functionality not migrated to new package) |
lib/optimization.py |
Deleted unused optimization utilities |
setup.py |
Deleted legacy setup file in favor of pyproject.toml |
requirements.txt |
Deleted in favor of pyproject.toml dependencies |
pytest.ini |
Deleted in favor of pyproject.toml test configuration |
main_restart.py |
Deleted unused restart processing script |
pyproject.toml |
Added modern Python package configuration with build system, dependencies, and dev tools |
tests/download_test_data.sh |
Added script to download test data from GitHub releases |
tests/test_forecast.py |
Expanded with new NetCDF file creation and testing functions |
tests/*.py |
Updated imports from lib.* to src.nemo_spinup_forecast.* |
src/nemo_spinup_forecast/forecast_method.py |
New file containing forecaster base classes and implementations |
src/nemo_spinup_forecast/dimensionality_reduction.py |
New file with PCA and Kernel PCA implementations |
src/nemo_spinup_forecast/density.py |
Migrated from lib/, cleaned up numpy imports and added grav constant |
src/nemo_spinup_forecast/utils.py |
Updated import path for Simulation class |
src/nemo_spinup_forecast/forecast.py |
Removed unnecessary noqa comment |
main.py |
Updated imports to use new package structure |
ruff.toml |
Updated file exclusions to match new structure |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
We want the |
|
Everything seems good to me ! |
a2b1201 to
46bbd0a
Compare
isaacaka
left a comment
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.
Also remove Notebooks/Restart.ipynb
- restart code and scripts - optimization step - tools directory - restart notebook These scripts/tools sit outside the forecasting pipeline.
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
isaacaka
left a comment
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.
Good to merge
The unused code removal can be separated into three distinct categories.
Unused optimization code
src/nemo_spinup_forecast/optimization.pyDeletions relating to restart (relevant parts will be moved to another repo)
src/nemo_spinup_forecast/restart.pyrestart_toolbox.shstandalone/restarter.pystandalone/restarter_V2.pyUnused tools
Fixes #79 #80