Skip to content
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

Passing catchment id to CatchmentAggrDataSelector #480

Merged
merged 2 commits into from
Dec 21, 2022

Conversation

stcui007
Copy link
Contributor

Passing catchment id in place of an empty string in get_value function.

Additions

Removals

Changes

src/realizations/catchment/Simple_Lumped_Model_Realization.cpp
src/realizations/catchment/Tshirt_C_Realization.cpp
src/realizations/catchment/Tshirt_Realization.cpp

Testing

  1. Various Unit tests
  2. Run ngen

Screenshots

Notes

Todos

Checklist

  • [x ] PR has an informative and human-readable title
  • [x ] Changes are limited to a single goal (no scope creep)
  • [x ] Code can be automatically merged (no conflicts)
  • [x ] Code follows project standards (link if applicable)
  • Passes all existing automated tests
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future todos are captured in comments
  • Project documentation has been updated (including the "Unreleased" section of the CHANGELOG)
  • Reviewers requested with the Reviewers tool ➡️

Testing checklist (automated report can be put here)

Target Environment support

  • [x ] Linux

try {
precip = this->forcing->get_value(CatchmentAggrDataSelector("","precip_rate", t_unix, dt, "")); // classic forcing object/format
precip = this->forcing->get_value(CatchmentAggrDataSelector(this->id, CSDMS_STD_NAME_LIQUID_EQ_PRECIP_RATE, t_current, t_delta_s, ""), data_access::SUM);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

End result of this change is that the same thing is in thetry and catch blocks. I think that the new DataProviders will reconcile these two different names so the try/catch is now unnecessary... remove the try/catch block and replace with just the one line.

double precip;
time_t t_unix = this->forcing->get_data_start_time() + (t * 3600);
const std::string forcing_name = CSDMS_STD_NAME_LIQUID_EQ_PRECIP_RATE;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is never used anywhere, please remove.

@stcui007
Copy link
Contributor Author

stcui007 commented Dec 9, 2022 via email

@mattw-nws mattw-nws merged commit 45d403e into NOAA-OWP:master Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix legacy formulations to pass catchment ID to CatchmentAggrDataSelector
2 participants