-
Notifications
You must be signed in to change notification settings - Fork 50
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
update of NHDNetwork class for ngen t-route #580
base: master
Are you sure you want to change the base?
update of NHDNetwork class for ngen t-route #580
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.
A couple things we really need to address before this moves forward further. Please see the comments regarding the internal file versioning semantics as well as the file name versioning.
@@ -1,4 +1,4 @@ | |||
from .AbstractNetwork import AbstractNetwork | |||
from .AbstractNetwork import AbstractNetwork |
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 extra space at the beginning of the line may cause some issues...either way, for consistency it should be removed.
@@ -0,0 +1,318 @@ | |||
from .AbstractNetwork import AbstractNetwork |
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 file should simply replace the existing NHDNetwork.py file. This way the changes from one version to the next are marked in the version control. A well crafted commit message for this single change will make going back into the history and finding the old version straight forward, and we don't have multiple files to maintain.
@@ -28,6 +33,689 @@ | |||
|
|||
LOG = logging.getLogger('') | |||
|
|||
''' |
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.
we really don't need to maintain v02 main, as long as the functionality of v04 main works as needed. I would propose dropping v02 main and make sure v04 (which should probably just be main
) is functional.
LOG.debug("process complete in %s seconds." % (time.time() - main_start_time)) | ||
|
||
if showtiming: | ||
print('************ TIMING SUMMARY ************') |
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.
Since task_times contains all the relevant info, I would pull this logic into a function and pass in task_times
if v_args[0].input_version == 3: | ||
LOG.info("Running main v03 - looping") | ||
main_v03(v_args[1]) | ||
if v_args[0].input_version == 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.
Again, let's try to get to a single main function. If backwards compatibility is important, we can discuss ways to support that, but with 4 versions of main and an async v3 interface, it is reasonably confusing.
[Short description explaining the high-level reason for the pull request]
As part of goal for integrating t-route model developed for NMW v3.0 into Next Gen Water Modeling Framework, NHDNetwork class is modified to produce needed network and input forcing data for eventually running t-route through BMI. In the process, functions in preprocess.py are directly called inside NHDNetwork.py for initial time loop. For subsequent time loops, main.py was refactored to update forcing data by directly calling functions in preprocess.py. t-route with these refactored files produced the exactly same results as t-route from t-route main branch.
Additions
NHDNetwork_v4.py is used instead of NHDNetwork.py only for test purpose.
Removals
Changes
Testing
Screenshots
Notes
Todos
Checklist
Testing checklist
Target Environment support
Accessibility
Other