Skip to content
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

Allow add_season_year() to optionally send spans backwards #5573

Merged
merged 6 commits into from
Nov 9, 2023

Conversation

trexfeathers
Copy link
Contributor

@trexfeathers trexfeathers commented Nov 9, 2023

🚀 Pull Request

Description

Closes #4877.

The ability for add_season_year() to assign seasons that span year boundaries (e.g. the standard djf Winter) to be assigned to the preceding year rather than the following year. #4877 suggested adding an alternative function, but it seemed more appropriate to just add another parameter to add_season_year().

I also took the opportunity to modernise the docstring, and the relevant test module.

To-do

  • Write a proper description
  • What's New entry

Consult Iris pull request check list

Copy link

codecov bot commented Nov 9, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e0850eb) 89.44% compared to head (84ad661) 89.44%.
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5573   +/-   ##
=======================================
  Coverage   89.44%   89.44%           
=======================================
  Files          89       89           
  Lines       22583    22587    +4     
  Branches     5386     5385    -1     
=======================================
+ Hits        20199    20203    +4     
  Misses       1638     1638           
  Partials      746      746           
Files Coverage Δ
lib/iris/coord_categorisation.py 97.24% <100.00%> (+0.10%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@stephenworsley stephenworsley left a comment

Choose a reason for hiding this comment

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

Good job, I appreciate the diligence moving the tests to pytest format. Just a couple minor notes here.

lib/iris/coord_categorisation.py Outdated Show resolved Hide resolved
lib/iris/coord_categorisation.py Outdated Show resolved Hide resolved
Copy link
Contributor

@stephenworsley stephenworsley left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@stephenworsley stephenworsley merged commit 017cec7 into SciTools:main Nov 9, 2023
17 checks passed
@trexfeathers
Copy link
Contributor Author

Thanks @stephenworsley!

@trexfeathers trexfeathers deleted the year_preceding branch November 9, 2023 16:49
tkknight added a commit to tkknight/iris that referenced this pull request Nov 14, 2023
* main:
  [pre-commit.ci] pre-commit autoupdate (SciTools#5579)
  Relicense to from LGPL-3 to BSD-3 (SciTools#5577)
  Allow `add_season_year()` to optionally send spans backwards (SciTools#5573)
HGWright added a commit to HGWright/iris that referenced this pull request Nov 17, 2023
* 'guess_coord' of github.com:HGWright/iris: (82 commits)
  [pre-commit.ci] auto fixes from pre-commit.com hooks
  [pre-commit.ci] pre-commit autoupdate (SciTools#5579)
  Relicense to from LGPL-3 to BSD-3 (SciTools#5577)
  Allow `add_season_year()` to optionally send spans backwards (SciTools#5573)
  Added xarray phrasebook doc page (SciTools#5564)
  fixed spacing (SciTools#5572)
  DOCS: Removed broken git links. (SciTools#5569)
  More sensible time axis and tick labels for 2D plots (SciTools#5561)
  removed now incorrect statement. (SciTools#5555)
  [pre-commit.ci] pre-commit autoupdate (SciTools#5558)
  Exempt major release label from stalebot (SciTools#5559)
  updated link (SciTools#5556)
  Added whatsnew. (SciTools#5552)
  moved latest warning banner logic to conf.py (SciTools#5508)
  updated layout of top navbar (SciTools#5505)
  Oblique and Rotated Mercator (SciTools#5548)
  [pre-commit.ci] pre-commit autoupdate (SciTools#5549)
  [pre-commit.ci] pre-commit autoupdate (SciTools#5527)
  Bump scitools/workflows from 2023.09.1 to 2023.10.0 (SciTools#5540)
  nep29 drop table schedule numpy>1.21 (SciTools#5525)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

iris.coord_categorisation.add_season_year_preceding()
2 participants