Closed peckhams closed 1 year ago
Also bug fixes, extra docs and improved Jupyter notebooks.
@peckhams Which bugs? Fix #32 & Fix #29 ?
Created a Python package for the LSTM model (within lstm folder) and tested it within NextGen.
@peckhams Which, if any "standalone", scripts did you test?
We will need to edit README.md, specifically Running BMI LSTM, info, links, etc. @peckhams Can you expand more on standalone mode here?
Also, README2.md is more focused on lstm_bmi as a package, perhaps rename?
Also bug fixes, extra docs and improved Jupyter notebooks.
@peckhams Which bugs? Fix #32 & Fix #29 ?
Yes, #32 is fixed, and #29 was fixed previously and should still be.
Created a Python package for the LSTM model (within lstm folder) and tested it within NextGen.
@peckhams Which, if any "standalone", scripts did you test?
Do you mean a script that tests the LSTM model in "standalone mode"? If so, when you run LSTM via: % python -m lstm, it runs entirely outside of NextGen and uses "__main__.py" in the lstm package folder. Most of the testing was done running LSTM inside of NextGen, however.
We will need to edit README.md, specifically Running BMI LSTM, info, links, etc. @peckhams Can you expand more on standalone mode here?
Also, README2.md is more focused on lstm_bmi as a package, perhaps rename?
Yes, we should update README.md, and should probably rename README2.md to something more descriptive. Let's discuss this in our next LSTM call.
Created a Python package for the LSTM model (within lstm folder) and tested it within NextGen.
@peckhams Which, if any "standalone", scripts did you test?
Do you mean a script that tests the LSTM model in "standalone mode"? If so, when you run LSTM via: % python -m lstm, it runs entirely outside of NextGen and uses "main.py" in the lstm package folder. Most of the testing was done running LSTM inside of NextGen, however.
Thanks for clarifying, I am running into some pathing mishaps with this "standalone" approach. I'll continue to work through and post any major roadblocks here. -thx
@peckhams why was input variable atmosphere_water__time_integral_of_precipitation_mass_flux
changed back to atmosphere_water__liquid_equivalent_precipitation_rate
?
Created a Python package for the LSTM model (within lstm folder) and tested it within NextGen. Also bug fixes, extra docs and improved Jupyter notebooks.
Additions
ngen_files is a new folder that contains files that must be present in the ngen repo in order to use this new lstm (or lstm_py) repo.
Added __init__.py, __main__.py, and run_lstm_with_bmi_v2.py in the lstm package folder. The latter two make it possible to run an LSTM test at an OS prompt with the command: % python -m lstm
Added README2.md with info on how to create a Python package.
Added 2 text files to the docs folder.
Removals
Removed src folder in favor of new lstm package folder to allow "import lstm"
Removed numerous, unused instances of "from torch import nn"
Changes
Fixed bugs in lstm/bmi_lstm.py. Mainly in functions: create_scaled_input_tensor(), get_static_attributes(), and initialize_forcings(). This fixed a known problem with the output hydrographs, issue #32.
Made changes to the 2 Jupyter notebooks to improve speed and readability.
Testing
Screenshots
Notes
It might be good to rename the repo to "lstm_py", since we'd like to use "lstm" for the Python package, which is a subfolder of the repo, and it may be less confusing if the repo and package don't have the same name.
Since NextGen does not yet support virtual environments properly (ngen issue #441), the work-around is to use the export command to set the environment variable PYTHONPATH so that the "lstm" package can be found.
Todos
-
Checklist
Testing checklist
Target Environment support
Accessibility
Other