fmuobs Fix starttime/startdate not being applied to compute_date_from days#853
fmuobs Fix starttime/startdate not being applied to compute_date_from days#853alifbe merged 1 commit intoequinor:mainfrom
fmuobs Fix starttime/startdate not being applied to compute_date_from days#853Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes handling of ERT SUMMARY_OBSERVATION entries that only specify DAYS (no DATE) by ensuring --starttime/--startdate is actually applied when computing dates, and adds an integration test + testdata to cover the behavior.
Changes:
- Add ERT
.obstestdata containing summary observations withDAYSbut noDATE. - Add an integration test asserting YAML export fails without
--startdateand succeeds with it (and validates computed dates). - Pass
starttimethrough tocompute_date_from_days()infmuobs()so computed dates are created.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/testdata_fmuobs/summary_obs_without_date.obs | New test fixture with summary observations lacking DATE (using DAYS). |
| tests/test_fmuobs.py | New integration test for --startdate behavior and date computation in YAML output. |
| src/subscript/fmuobs/fmuobs.py | Fix: ensure starttime is provided to compute_date_from_days(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #853 +/- ##
==========================================
+ Coverage 83.52% 83.55% +0.02%
==========================================
Files 49 49
Lines 7279 7279
==========================================
+ Hits 6080 6082 +2
+ Misses 1199 1197 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
0ad8d25 to
b0370ad
Compare
fmuobs Fix bug summary observation without datefmuobs Fix starttime/startdate not being applied to compute_date_from days
There was a problem hiding this comment.
Pull request overview
Fixes fmuobs handling of ERT SUMMARY_OBSERVATION entries that specify DAYS but omit DATE, by ensuring the CLI --starttime/--startdate argument is actually used when computing dates before YAML export.
Changes:
- Pass
starttimethrough tocompute_date_from_days()in thefmuobs()conversion flow. - Add an integration test asserting failure without
--startdateand correct computed dates with--startdate. - Add new ERT
.obstestdata containing summary observations without explicitDATE.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/subscript/fmuobs/fmuobs.py |
Ensures starttime is applied when computing DATE from DAYS prior to validation/output. |
tests/test_fmuobs.py |
Adds integration coverage for --startdate behavior and output date computation. |
tests/testdata_fmuobs/summary_obs_without_date.obs |
Adds representative ERT observation input lacking DATE fields. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
86e1bad to
d5193be
Compare
There was a problem hiding this comment.
Pull request overview
This PR fixes fmuobs so the --starttime/--startdate CLI argument is actually applied when converting DAYS-based observations into computed DATEs, and adds an integration test + testdata to prevent regressions.
Changes:
- Pass
starttimethrough toertobs2df(...)consistently and intocompute_date_from_days(...)soDAYS -> DATEconversion is applied. - Add a new integration test covering summary observations without explicit dates, validating both failure-without-startdate and correct computed dates with
--startdate. - Add ERT
.obstestdata containing summary observations withDAYSbut noDATE.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/subscript/fmuobs/fmuobs.py |
Ensures starttime is used when computing dates from DAYS and when reparsing ERT observations with include dirs. |
tests/test_fmuobs.py |
Adds an integration test verifying --startdate enables DAYS -> DATE conversion and validates output dates. |
tests/testdata_fmuobs/summary_obs_without_date.obs |
New test input containing summary observations with DAYS and no explicit dates. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
d5193be to
56e5c9f
Compare
No description provided.