-
Notifications
You must be signed in to change notification settings - Fork 51
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
Abstract network update #600
Abstract network update #600
Conversation
… from input argument for AbstractNetwork
…on into read_geo_file function for HyFeatures
I've missed a few things related to these modules, but the last commit caught my eye. Why is column mapping explicit in the hy features network yet is still part of the abstract superclass construction? Also, is there some reasoning as to why the utilities are not implemented as either instance or class methods? |
Column mapping has been removed from the abstract construction, it's now
only done in the subclasses.
No, and I like the idea of implementing these as instance or class methods.
I suppose the reason we've been using the '...utilities.py' files is for
backwards compatibility. But if that is not a concern I'm happy to migrate
these functions into the network objects.
…On Fri, Dec 16, 2022 at 3:06 PM Nels ***@***.***> wrote:
I've missed a few things related to these modules, but the last commit
caught my eye. Why is column mapping explicit in the hy features network
yet is still part of the abstract superclass construction?
Also, is there some reasoning as to why the utilities are not implemented
as either instance or class methods?
—
Reply to this email directly, view it on GitHub
<#600 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AYSH2PIVWCCOBZU7TLQNZJLWNTRVPANCNFSM6AAAAAATBHGQ5E>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
…as inherent functions
@hellkite500 I moved functions from ...preprocess.py files into the network files as inherent functions (830c6ef). Is that what you had in mind? |
* t-route on larger hyfeature domain with hybrid routing * remove debug line Co-authored-by: Dong Kim <donghakim@cheyenne4.cheyenne.ucar.edu>
@hellkite500 @kumdonoaa I've updated this from a Draft to being ready for review. Please take one final look so I can merge it, thanks! |
|
||
forcing_glob_filter = forcing_parameters.get("qlat_file_pattern_filter", "*.NEXOUT") | ||
|
||
if forcing_glob_filter=="nex-*": |
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 might want a quick tag up to discuss this functionality.
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.
Sure thing.
rconn, | ||
wbody_conn, | ||
reaches_bytw, | ||
network, |
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.
There is a case to be made about keeping this call the same as before and expanding the args from the network at the calling code. It might be worth discussing the merits and/or a possible proxy to maintain the compute_nhd_routing_v02
backwards compatibility and possibly deprecate it in the future.
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.
Happy to discuss this further. Calling the main routing function has a couple levels and I can see the utility in keeping the bottom levels the same to maintain backwards compatibility. But I do think minimizing these inputs makes the code much more readable and would help with future maintenance.
@shorvath-noaa Can you rebase this locally to resolve the conflicts? I left a few minor comments that can be addressed in follow up PR's, but we will need to get the conflicts resolved before this can merge. |
… from input argument for AbstractNetwork
…on into read_geo_file function for HyFeatures
…as inherent functions
…ess.py is no longer needed
|
||
return run_sets | ||
|
||
def nex_files_to_binary(nexus_files, binary_folder): |
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, this is HYFeatures specific, and as such this function should exist in that sublcass, not the abstract class.
@@ -654,3 +658,201 @@ def _try_parsing_date(text): | |||
"channel initial states complete in %s seconds."\ | |||
% (time.time() - start_time) | |||
) | |||
|
|||
def build_forcing_sets(self,): |
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.
Should probably look at factoring out the common code and the network specific code in this function.
This update moves many of the common functions in HYFeatures_network and NHDNetwork objects into the parent Abstract_network object. It also generalizes functions when necessary to work with either (and hopefully new) networks.
The key differences in individual networks is how they read in files to create the self._dataframe (param_df) objects and various waterbody dataframes. Once these are created t-route should run the same for any network, creating the diffusive domain, initial warmstate, forcing data, etc, so those functions have been moved to the Abstract_network.
Additions
Removals
Changes
Testing
Screenshots
Notes
Todos
Checklist
Testing checklist
Target Environment support
Accessibility
Other