Skip to content

Preserve FCI time units from source files - #3428

Open
sapunyangkut wants to merge 1 commit into
pytroll:mainfrom
sapunyangkut:codex/issue-3349-preserve-fci-units
Open

Preserve FCI time units from source files#3428
sapunyangkut wants to merge 1 commit into
pytroll:mainfrom
sapunyangkut:codex/issue-3349-preserve-fci-units

Conversation

@sapunyangkut

Copy link
Copy Markdown

Summary

Validation

  • preserved task-owned evidence for this exact upstream base and patch: focused regression 1 passed; full FCI reader module 259 passed; adjacent attribute-cleanup coverage 2 passed; ruff and git diff --check passed
  • current worktree: git diff --check, Python byte-compilation of the changed test, and non-constructing YAML syntax parsing passed

The current checkout is not installed as a package, so a fresh pytest collection stops at the repository's generated satpy.version import; ruff is also unavailable in this environment. No dependency was installed.

AI assistance disclosure

This patch, tests, commit message, and pull request text were developed and checked with OpenAI Codex assistance. No independent human self-review is claimed; maintainer review is requested before merge.

Remove static time-unit overrides so the FCI reader retains complete CF reference-time units from source files, with regression coverage for all time datasets.

Developed and checked with OpenAI Codex assistance.
@ameraner

Copy link
Copy Markdown
Member

Hi @sapunyangkut , thanks for this! Is there a reason for the PR to be still in draft? It looks quite complete to me. We usually mark the PR as Ready for Review when the work is done and the PR is potentially ready to be merged.

@ameraner ameraner added enhancement code enhancements, features, improvements component:readers labels Aug 12, 2026
@sapunyangkut
sapunyangkut marked this pull request as ready for review August 23, 2026 12:01
Comment on lines +848 to +852
for data_id, info in time_datasets:
loaded_time = source_time.copy()
loaded_time.attrs = file_handler._set_and_cleanup_attributes(
loaded_time.attrs, info=info)
assert loaded_time.attrs["units"] == expected_units

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to call the higher-level file handler functions to get these datasets out and compare the .attrs["units"] and the actual values? This way if the code is every refactored this test would still pass (not calling a private method)?

Additionally, is the reflectance units check expected below? Or copy/paste from before?

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

Labels

component:readers enhancement code enhancements, features, improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FCI L1C reader overwrites units attribute on time metadata, making the data hard to interpret

3 participants