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

Expand & automate testing system #31

Closed
aufdenkampe opened this issue Apr 19, 2020 · 9 comments
Closed

Expand & automate testing system #31

aufdenkampe opened this issue Apr 19, 2020 · 9 comments

Comments

@aufdenkampe
Copy link
Collaborator

As we discussed for our RESPEC-LimnoTech Collaborative Work Plan during our workshop (March 24-25, 2020), expanding and automating the testing of HSP2 vs. HSPF is an immediate priority.

Our objective for testing is to ensure that HSP2 provides the same results as HSPF for:

  • all HSP2 releases,
  • several relevant operating systems and software environments, and
  • a selected group of watershed models that have been calibrated and examined for real-world water management applications and that represent a range of watershed properties.

We decided that:

  • HSPF “reference” model runs should be added to repo and considered static/stable
  • HSP2 outputs will continually evolve, expanding as new process modules are implemented
  • Comparisons will be point-by-point for major output time series, to "byte-precision" of about 3 significant figures to allow for rounding errors
    • We can't do traditional unit testing of individual routines because HSPF doesn't save that data.

RESPEC has two test models to contribute:

  • Test10
  • Calleg

LimnoTech will add additional models:

  • We selected 2 watersheds that we’ve recently modeled in HSPF, and selected a single sub-watershed (to simplify running)
    • Grant River, MI. Relatively simple
    • Zumbro River, MN. More complicated. Full water quality suite.
  • Hydrological Response Unit (HRU) testing
    • 5-10 micro watersheds (1 HRU + a few stream reaches)

Let's use this issue to track progress on all the smaller tasks required to complete this.
We have already added some reference models and testing code with 49c71f3, 60378a7, and LimnoTech@130bef2.

cc: @rheaphy, @PaulDudaRESPEC, @steveskrip, @ptomasula,

@rheaphy
Copy link
Collaborator

rheaphy commented Apr 19, 2020 via email

@JasonLoveRespec
Copy link
Contributor

JasonLoveRespec commented Apr 19, 2020 via email

@aufdenkampe
Copy link
Collaborator Author

Here's a suggestion from @PaulDudaRESPEC for potential tests that we can adapt from the HSPF testing list:

I went back to our archive of standard HSPF tests to see what we have available there. I’ve summarized them below, and I highlighted the ones that I think might be helpful. They are all available here:
https://github.com/respec/FORTRAN/tree/master/test/hspf/standard/Current

I’m pretty sure you’re already using Test10, which has a lot of WQ in it. The other ones I suggest would be Test07 and Test08, which exercise most of the PERLND WQ modules. The only hitch is that they also use Special Actions, and since I don’t think we have an equivalent to Special Actions yet in HSP2 we may need to comment out that part of the UCIs – for the purposes of matching the HSP2 results to the HSPF results.


Here’s the list of standard test runs:

TEST01.uci, TEST02.uci, TEST03.uci – Importing data to WDM (MUTSIN, COPY)

TEST04.uci – Display of data in WDM

TEST05.uci – PERLND with SNOW, PWATER

TEST06.uci – DURANL (duration analysis)

TEST07.uci – PERLND with ATMP, SNOW, PWATER, SEDMNT, PSTEMP, PWTGAS, PQUAL, MSTLAY, PEST, and Special Actions

TEST08.uci – PERLND with SNOW, PWATER, SEDMNT, PSTEMP, MSTLAY, NITR, PHOS, TRACER, and Special Actions

TEST09.uci – PERLND with SNOW, PWATER,
RCHRES HYDR

TEST10.uci – PERLND with SNOW, PWATER, PSTEMP, PWTGAS,
IMPLND with SNOW, IWATER, SOLIDS, IWTGAS, IQUAL,
RCHRES with HYDR, ADCALC, CONS, HTRCH, SEDTRN, GQUAL, OXRX, NUTRX, PLANK, PHCARB

TEST11.uci – PERLND SNOW and PWATER with metric units

TEST12.uci – PERLND with SNOW, PWATER, SEDMNT, PSTEMP, MSTLAY, NITR, PHOS
IMPLND with SNOW, IWATER, SOLIDS, IWTGAS, IQUAL
RCHRES with HYDR, ADCALC, HTRCH, SEDTRN, OXRX, NUTRX, PLANK
*Uses DSS, conditional, user defined and distributed special actions

TEST13.uci – RCHRES HYDR with water categories and conditional special actions

TEST14.uci – Inputting test data to DSS

TEST15.uci – PERLND PWATER with IHM changes and binary output

TEST16.uci – PERLND SNOW, PWATER, SEDMNT, PSTEMP, PWTGAS
IMPLND SNOW, IWATER, SOLIDS, IWTGAS
RCHRES HYDR, ADCALC, HTRCG, SEDTRN
*uses multiple canopy layer enhancement

TEST17.uci – PERLND with SNOW, PWATER, PSTEMP, PWTGAS,
IMPLND with SNOW, IWATER, SOLIDS, IWTGAS, IQUAL,
RCHRES with HYDR, ADCALC, CONS, HTRCH, SEDTRN, GQUAL, OXRX, NUTRX, PLANK, PHCARB
*same as TEST10 except uses DO in PRECIP RCHRES enhancement

cc: @steveskrip, @benjamincrary

@aufdenkampe
Copy link
Collaborator Author

For our records...

In Bob's May 14 "HSP2 status update" email, he shares the following:

Yesterday morning I updated the HSPsquared GitHub main branch repository. For the Calleg test case, PWATER is now as accurate as in HSPF (worst case was 0.0003 percent difference or almost exact to 6 significant digits) and RCHRES HYDR improved so the worst case is 0.0207 percent difference. IWATER was already an exact match to HSPF to single precision accuracy.

I found the two bugs when testing HSP2 for indelt times under 1 hour. I am still improving my testing to insure HSP2 works at any reasonable indelt. (I am currently testing 5 hour and 20 minute along with the original I hour tests.

In Bob's May 14 "HSP2 HTML image of calleg test run" email, he wrote:

I am attaching a zip compressed HTML file which is an HTML export of the Jupyterlab Notebook for the Calleg test - in case anyone wants the details for my previous email.

I added TESTcalleg.html to the repo on May 19 via 9882d83 as part of PR #34.
We do not yet have a copy of the TESTcalleg.ipynb that created those results.

@aufdenkampe
Copy link
Collaborator Author

I just discovered that Bob emailed @steveskrip the file on May 28 in "Re: calleg HSPF results" thread.

I just committed it with LimnoTech@f112f9e.

@aufdenkampe
Copy link
Collaborator Author

aufdenkampe commented Apr 23, 2021

@TongZhai, thanks for all your recent commits (c556ff7, 15f111b, 8a2dce7, 503e95a, 5d32b3e) toward building a unit testing / regression testing system!

Are these ready for us to use?

I created this Pull Request (LimnoTech#36) to the cumulative changes with your code.

@TongZhai
Copy link
Contributor

So far, the test is implemented for testing conversion codes. I put an instruction as commit in this thread. Yes, it is currently functional in conversion testing. It is intended to be a full suite of testing protocols.

aufdenkampe pushed a commit that referenced this issue Apr 28, 2021
Merge from respec/HSPsquared-develop Branch on 3/5/2021
@aufdenkampe aufdenkampe removed this from the Release 1.0! milestone Aug 20, 2021
@aufdenkampe
Copy link
Collaborator Author

aufdenkampe commented Oct 1, 2021

PR #61 includes:

@aufdenkampe
Copy link
Collaborator Author

Although this is a long-term goal, we have sufficiently established a performant and flexible testing system that this issue can be closed with release 0.9.3.

We'll open new issues for specific additional enhancements to the testing system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants