Skip to content

refactor(scripts): replace dayofyear with day_of_year (pandas) - #52

Merged
xiangtaoxu merged 3 commits into
EDmodel:betafrom
mpaiao:fix/pandas-day-of-year
Nov 3, 2026
Merged

xiangtaoxu merged 3 commits into
EDmodel:betafrom
mpaiao:fix/pandas-day-of-year

Conversation

@mpaiao

@mpaiao mpaiao commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

What and why

During the tests of #51, some of the tests created hundreds to thousands of warnings. The warnings were due to pandas 4 deprecating dayofyear on DatetimeIndex and Timestamp. For now this is just a bunch of warning messages, but they may become errors in the future. This pull request renames the 7 uses in scripts/calibrate_fast/tower.py, scripts/calibrate_fast/data_rules.py and examples/example02_canopy_phenology/run_phenology.py.

Effect on results (tick exactly one; CI checks)

  • Bit-for-bit: output is identical to the base commit's in every run listed under
    Verification.
  • Round-off
  • Answer-changing

User-facing changes (tick all that apply; each needs an "Upgrading" note in the changelog)

  • None
  • Config keys added, renamed or removed, or a value in the shipped config files changed
  • Output variables or output files changed
  • Input files (forcing, maps, initial conditions) or their format changed
  • Building or running changed: command-line or CMake options, dependencies, the Python API
  • State files written by the last release no longer load

Verification

  • Base commit (beta): 2bf6216
  • Runs compared with the base commit, and the result: no Fortran or model change, so no model run
    compared. Ran examples/example02_canopy_phenology/run_phenology.py on beta and on this branch
    (pandas 4): the printed parameters and scores and the figure are identical, and the 272
    dayofyear warnings on beta are gone.
  • Python tests (scripts/prepare_input/flux_tower/tests, scripts/calibrate_fast): 100 passed,
    5 skipped (those need EDMORE_LIB and EDMORE_MAIN), pandas 4, and the deprecation warnings
    are gone (before, about 2,070 of them).
  • The long tests (label long; expected for a science change): not applicable
  • Other builds (production preset, nvfortran): not applicable
  • Conservation warnings in those runs, or "none": not applicable

Credit and AI use

  • Collaborators:
  • AI assistance (the tool and what it did): Claude Code (Sonnet 5.5) found the uses, renamed them,
    ran the tests and the example, and wrote the changelog entry. I updated the changelog entry with the PR number.
  • I answer for this pull request: I can explain every change in it, and the verification above was actually run

Not in this PR

  • Nothing deferred.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@mpaiao
mpaiao requested a review from a team as a code owner October 28, 2026 19:15

@xiangtaoxu xiangtaoxu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I will merge this after PR 49

@xiangtaoxu
xiangtaoxu merged commit 6eafe92 into EDmodel:beta Nov 3, 2026
4 checks passed
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.

2 participants