Skip to content

fix(netcdf): Fix context time attributes #204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 7, 2025
Merged

Conversation

gmertes
Copy link
Member

@gmertes gmertes commented Apr 7, 2025

Description

Two bugs:

  1. The netcdf output uses the context attributes self.lead_time and self.time_step in the open routine, which is called before these attributes are set.
  2. NetCDFOutput.open reads reference_date from the context, but doesn't check if the value is not None.
  • Set the context attributes self.lead_time and self.time_step at the beginning of execute, before they are accessed.
  • Check if the context reference_date is not None, otherwise use the date from the state.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

@github-project-automation github-project-automation bot moved this to Now In Progress in Anemoi-dev Apr 7, 2025
@github-actions github-actions bot added the bug Something isn't working label Apr 7, 2025
@gmertes gmertes merged commit d6fd430 into main Apr 7, 2025
68 checks passed
@gmertes gmertes deleted the fix/context-attributes branch April 7, 2025 13:08
@github-project-automation github-project-automation bot moved this from Now In Progress to Done in Anemoi-dev Apr 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants