Skip to content

Conversation

@ocsmit
Copy link
Collaborator

@ocsmit ocsmit commented Dec 10, 2025

Github Issue: #358

Description

See #358 for detailed explanation. TLDR is misalignment between child nodes and root node for OCO3_L2_Lite_SIF temporal subset was due to inconsistent precision in the parsing of time.

Overview of work done

Updates _convert_time_from_description to use ns precision, and time_encoding to only specify dtype for time data if units is also present in the original data.

Overview of verification done

See #358

Overview of integration done

PR checklist:

  • Linted
  • Updated unit tests
  • Updated changelog
  • Integration testing

@ocsmit ocsmit changed the title Bug/datetime truncation Bugfix/358 datetime truncation Dec 10, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a datetime truncation bug (#358) where temporal subsetting of OCO3_L2_Lite_SIF data caused misalignment between child and root nodes due to inconsistent time precision.

Key Changes:

  • Updated _convert_time_from_description to use nanosecond precision instead of second precision
  • Modified time encoding logic to only specify dtype when units are also present in the original data

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
podaac/subsetter/utils/time_utils.py Enhanced time conversion to use nanosecond precision for more accurate datetime handling
podaac/subsetter/subset.py Added conditional check to ensure dtype is only set when units are present, preventing encoding inconsistencies
CHANGELOG.md Documented the precision improvements and encoding condition changes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

time_encoding[group_path][var_name]['dtype'] = dtype
if dtype and units:
time_encoding[group_path][var_name]['dtype'] = dtype
time_encoding[group_path][var_name]['units'] = units
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

Line 359 redundantly sets 'units' even though it was already set on line 356 when the units variable is truthy. This duplicate assignment is unnecessary since units is already assigned in the preceding conditional block.

Suggested change
time_encoding[group_path][var_name]['units'] = units

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant