IDEMSInternational / epicsawrap

GNU Lesser General Public License v3.0
0 stars 0 forks source link

Adding functions and tests for extremes #59

Closed lilyclements closed 10 months ago

lilyclements commented 10 months ago

fixes #52

ChrisMarsh82 commented 9 months ago

@lilyclements There is a problem if extremes_rain isn't passed into the procedure. I also don't get any metadata for tmin and tmax for test_1. Is this all just a data issue? If so can we get some sample data just so I know what fields to expect?

lilyclements commented 9 months ago

@ChrisMarsh82 which function are you referring to? There are three functions to use -

extremes_rain, extremes_tmin, extremes_tmax

There's then a wrapper function. But the intention is for this to not be used on the API - similar to how we've done temperature summaries.

So to do minimum temperature extremes then you use the extremes_tmin function.

There is a test on this under the testthat files which runs through using these functions

ChrisMarsh82 commented 9 months ago

I call overall_extremes_summaries and pass in the country and station. I also pass in the summary needed. If I pass in extremes_rain it works fine. If I pass in extremes_rain and extremese_tmin it works if I just pass in extremes_tmin it returns as error.

lilyclements commented 9 months ago

The other functions are wrappers to overall_extremes_summaries, so we wouldn't be calling overall_extremes_summaries directly in the API. As a result, this function works internally in the epicsawrap package. I'm not sure if you're testing in R or elsewhere, but just as an FYI. This is to work consistently with total_temperature_summaries as discussed in issue #1.

But that's odd you're getting an issue. What data are you testing that on? It works for me on test_1 because it's all defined in the definitions there. Check the definitions of the data you're testing it on to see if it's defined in there.

image
ChrisMarsh82 commented 9 months ago

I call epicsawrap.overall_extremes_summaries with these variables

        "country": "zm",
        "station_id": "test_1",
        "summaries": [
            "extremes_tmin"
        ],
lilyclements commented 9 months ago

Can you try with the extremes_tmin function out of interest (instead of the overall_... function)? Presumably that won't work if this overall isn't working.

Does extremes_tmax work?

And is everything updated in rpicsa, and epicsawrap (and epicsadata, although that one shouldn't be a problem.)