Fix archive data fidelity and add on-demand NetCDF download#26
Merged
Conversation
- _get_netcdf_index_for_timestamp: use original_duration as denominator instead of loop_duration_seconds so the source file cycles at its native 10 s resolution rather than being stretched across the archive period (eliminated flat plateaus followed by sudden jumps) - add ensure_netcdf_file() helper: downloads via temp file with progress logging; archive_generator and mno_simulator call it at startup so the 3-month file is fetched automatically when not already present - generate_archive.py: add --netcdf-file-url / NETCDF_FILE_URL support; switch defaults to 1 day / 10 s; replace per-slice isel() loop with a single contiguous slice load (slice(0, max_idx+1)) for fast bulk read
- archive_generator and mno_simulator: set NETCDF_FILE to 3-month file, NETCDF_FILE_URL to the KIT download link; volumes writable so the file can be persisted to ./parser/example_data/ on the host - Archive defaults: 1 day, 10 s interval (ARCHIVE_DAYS / ARCHIVE_INTERVAL_SECONDS) - config.yml: update netcdf_file path to 3-month file
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #26 +/- ##
==========================================
- Coverage 72.17% 71.44% -0.73%
==========================================
Files 22 22
Lines 1980 2021 +41
==========================================
+ Hits 1429 1444 +15
- Misses 551 577 +26
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or 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
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.
PR summary
_get_netcdf_index_for_timestampwas stretchingthe source file across the full archive period; now cycles at the source
data's native pace, eliminating identical-value plateaus.
ensure_netcdf_file()fetches the 3-month /10-second OpenMRG file automatically on startup if not present
(
NETCDF_FILE_URLenv var); used by botharchive_generatorandmno_simulator.isel(slice(...)).valuescallreplaces thousands of individual
isel()calls — load time drops fromminutes to ~1 s.
(overridable via
ARCHIVE_DAYS/ARCHIVE_INTERVAL_SECONDS).