Skip to content

Conversation

CommonClimate
Copy link
Collaborator

When working on PR #662 , I discovered that the original soi_data.csv had a wonky fractional year time axis that got weirdly parsed by tbase.time_to_datetime(), resulting in a DatetimeIndex with no month of February, and 2 months of March. The series was also fairly short. I downloaded a new csv file from NOAA PSL and (with Claude Code's help) amended the load_dataset() logic to parse dates if they are available (as in this case), resulting in a proper, monthly time axis. The new code should be robust for future additions, and ensures that SOI is a well-behaved example for what we need it to show.

@CommonClimate CommonClimate requested a review from khider August 2, 2025 06:39
@khider
Copy link
Member

khider commented Aug 4, 2025

Docs are not building however:

sphinx.errors.ExtensionError: Cell raised uncaught exception:
�[31m---------------------------------------------------------------------------�[39m
�[31mNameError�[39m Traceback (most recent call last)
�[36mCell�[39m�[36m �[39m�[32mIn[5]�[39m�[32m, line 11�[39m
�[32m 7�[39m ts = pd.Series(values, index=dates, name=�[33m'�[39m�[33mmonthly_values�[39m�[33m'�[39m)
�[32m 9�[39m �[38;5;66;03m# Example 1: Single year (int)�[39;00m
�[32m 10�[39m �[38;5;66;03m# Compute Jan-Mar average for 2021 only�[39;00m
�[32m---> �[39m�[32m11�[39m avg_single = �[43mcustom_year_averages�[49m(ts, �[32m1�[39m, �[32m3�[39m, years=�[32m2021�[39m)
�[32m 12�[39m �[38;5;28mprint�[39m(�[33m"�[39m�[33mSingle year (2021):�[39m�[33m"�[39m)
�[32m 13�[39m �[38;5;28mprint�[39m(avg_single)

�[31mNameError�[39m: name 'custom_year_averages' is not defined

Extension error:
Cell raised uncaught exception:
�[31m---------------------------------------------------------------------------�[39m
�[31mNameError�[39m Traceback (most recent call last)
�[36mCell�[39m�[36m �[39m�[32mIn[5]�[39m�[32m, line 11�[39m
�[32m 7�[39m ts = pd.Series(values, index=dates, name=�[33m'�[39m�[33mmonthly_values�[39m�[33m'�[39m)
�[32m 9�[39m �[38;5;66;03m# Example 1: Single year (int)�[39;00m
�[32m 10�[39m �[38;5;66;03m# Compute Jan-Mar average for 2021 only�[39;00m
�[32m---> �[39m�[32m11�[39m avg_single = �[43mcustom_year_averages�[49m(ts, �[32m1�[39m, �[32m3�[39m, years=�[32m2021�[39m)
�[32m 12�[39m �[38;5;28mprint�[39m(�[33m"�[39m�[33mSingle year (2021):�[39m�[33m"�[39m)
�[32m 13�[39m �[38;5;28mprint�[39m(avg_single)

�[31mNameError�[39m: name 'custom_year_averages' is not defined

Not sure If the error is due to this PR or a merge from last week that wasn't checked properly

Copy link
Member

@khider khider left a comment

Choose a reason for hiding this comment

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

Problem with the docs. See comment in the PR

leftover from #660 , and also the new SOI
@khider khider self-requested a review August 4, 2025 22:38
@khider khider merged commit e8c1f39 into master Aug 4, 2025
1 check passed
@khider khider deleted the soi_fix branch August 4, 2025 22:39
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