ACCESS-NRI / access-nri-intake-catalog

Tools and configuration info used to manage ACCESS-NRI's intake catalogue
https://access-nri-intake-catalog.rtfd.io
Apache License 2.0
7 stars 0 forks source link

Guess start and end date when no time bounds are available #116

Closed dougiesquire closed 9 months ago

dougiesquire commented 9 months ago

With this PR, when no time bounds are available in a file, a guess of the start and end dates are made based on the first and last time and the frequency.

@aidanheerdegen, @utkarshgupta95 this is definitely a yucky hack, but it should fix #113 and #114.

Closes #113, closes #114

codecov[bot] commented 9 months ago

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (f7ca779) 97.31% compared to head (4024c97) 97.31%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #116 +/- ## ========================================== - Coverage 97.31% 97.31% -0.01% ========================================== Files 9 9 Lines 522 559 +37 ========================================== + Hits 508 544 +36 - Misses 14 15 +1 ``` | [Files](https://app.codecov.io/gh/ACCESS-NRI/access-nri-intake-catalog/pull/116?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ACCESS-NRI) | Coverage Δ | | |---|---|---| | [src/access\_nri\_intake/source/utils.py](https://app.codecov.io/gh/ACCESS-NRI/access-nri-intake-catalog/pull/116?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ACCESS-NRI#diff-c3JjL2FjY2Vzc19ucmlfaW50YWtlL3NvdXJjZS91dGlscy5weQ==) | `98.49% <98.24%> (-0.47%)` | :arrow_down: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

dougiesquire commented 9 months ago

Thanks heaps @jo-basevi!

is the time data points normally at the start or end times, or is it impossible to know if there isn't known bounds? Just wondering if its better to have end/start times to be either +/- the frequency rather than half the frequency either side of start and end times.

I don't think it's possible to know where the time point is, unfortunately. However, I think the assumption that the time point is at centre of the averaging period makes the most sense. This is indeed the case for the data in the issues that motivated this PR (#113, #114).

dougiesquire commented 9 months ago

RTD build is now failing. This PR does not update the docs, and I've opened an issue here https://github.com/ACCESS-NRI/access-nri-intake-catalog/issues/118, so merging