generated from NOAA-OWP/owp-open-source-project-template
-
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
Update for usace issue #768
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
src/troute-network/troute/nhd_io.py
Outdated
|
||
all_empty = all(df.empty for tuple in timeslice_dataframes for df in tuple) | ||
if all_empty: | ||
LOG.debug(f'DataFrames in the list are empty.') |
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.
Can you specify what 'dataframes' or 'list' are being referred to here?
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.
Updated
I'm weighing in here, b/c I'm presently working on the related
pydantic check of the gage folders.
We do have situations where all of the USACE files are empty, including our
beloved Lower Colorado test example. I would advise against throwing an
error in such situations. I believe the user needs to be told somewhere if
all the USACE files are empty, but there is no reason not to run the
simulation.
…On Fri, May 24, 2024 at 2:21 PM Amin Torabi ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/troute-network/troute/nhd_io.py
<#768 (comment)>:
> + if all_empty:
+ LOG.debug(f'DataFrames in the list are empty.')
+ return pd.DataFrame()
it ends the function. if its all empty we don't need to continue, we can
just return empty dataframe (similar to else: statement)
—
Reply to this email directly, view it on GitHub
<#768 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/BBPBYNIF2XXLOFJMQCRISPDZD6VNJAVCNFSM6AAAAABIGEC5N2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDANZYGA3TEMJTGA>
.
You are receiving this because your review was requested.Message ID:
***@***.***>
|
To be more specific: I understand that we could just turn off reservoir
persistence for usace, but if we have a situation where someone wants
to run the same model over a long and then a shorter time period, and we
happen to not have gage data over the shorter period, then the
simulation would throw an error if we disallow empty gage files. Which
would be difficult to understand for a user.
On Fri, May 24, 2024 at 2:40 PM Jurgen Zach - NOAA Affiliate <
***@***.***> wrote:
… I'm weighing in here, b/c I'm presently working on the related
pydantic check of the gage folders.
We do have situations where all of the USACE files are empty, including
our beloved Lower Colorado test example. I would advise against throwing an
error in such situations. I believe the user needs to be told somewhere if
all the USACE files are empty, but there is no reason not to run the
simulation.
On Fri, May 24, 2024 at 2:21 PM Amin Torabi ***@***.***>
wrote:
> ***@***.**** commented on this pull request.
> ------------------------------
>
> In src/troute-network/troute/nhd_io.py
> <#768 (comment)>:
>
> > + if all_empty:
> + LOG.debug(f'DataFrames in the list are empty.')
> + return pd.DataFrame()
>
> it ends the function. if its all empty we don't need to continue, we can
> just return empty dataframe (similar to else: statement)
>
> —
> Reply to this email directly, view it on GitHub
> <#768 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/BBPBYNIF2XXLOFJMQCRISPDZD6VNJAVCNFSM6AAAAABIGEC5N2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDANZYGA3TEMJTGA>
> .
> You are receiving this because your review was requested.Message ID:
> ***@***.***>
>
|
shorvath-noaa
approved these changes
May 28, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
in the config file
usace_timeslices_folder : usace_timeslices/
the letter 's' was missing and that was causing the t-rout skip usace_timeslices folder. By adding 's' it would go through the folder but since the usace files are all empty it throw an error and couldn't process it. So the update innhd_io.py
checks if the size is zero then return empty dataframeAdditions
Removals
Changes
Testing
Screenshots
Notes
Todos
Checklist
Testing checklist
Target Environment support
Accessibility
Other