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

Update temporal.py to properly handle piControl simulations #696

Merged
merged 4 commits into from
Sep 23, 2024

Conversation

lee1043
Copy link
Collaborator

@lee1043 lee1043 commented Sep 21, 2024

Description

PiControl simulations can have time step labels as like "0001-01-01". To not lose the first "000" in year, #695 proposed this fix.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

If applicable:

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass with my changes (locally and CI/CD build)
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have noted that this is a breaking change for a major release (fix or feature that would cause existing functionality to not work as expected)

@lee1043
Copy link
Collaborator Author

lee1043 commented Sep 21, 2024

pre-commit shows following error for mypy failing, which I don't have a good idea. @tomvothecoder can you help on this?

$ pre-commit run --files temporal.py 
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
black....................................................................Passed
isort....................................................................Passed
flake8...................................................................Passed
mypy.....................................................................Failed
- hook id: mypy
- exit code: 1

xcdat/temporal.py:1288: error: Argument 1 to "groupby" of "DataArray" has incompatible type "Any | Hashable"; expected "str | DataArray | IndexVariable | Sequence[Hashable] | Mapping[Any, Grouper] | None"  [arg-type]
Found 1 error in 1 file (checked 1 source file)

Copy link

codecov bot commented Sep 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (753a046) to head (9669dfc).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #696   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           15        15           
  Lines         1546      1546           
=========================================
  Hits          1546      1546           

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

Copy link
Collaborator

@tomvothecoder tomvothecoder left a comment

Choose a reason for hiding this comment

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

I fixed the mypy warning that was appearing with the latest version of xarray. This PR looks good to me. Thank you Jiwoo.

@tomvothecoder tomvothecoder added the type: bug Inconsistencies or issues which will cause an issue or problem for users or implementors. label Sep 23, 2024
@lee1043
Copy link
Collaborator Author

lee1043 commented Sep 23, 2024

@tomvothecoder thank you for your review! I am merging it now.

@lee1043 lee1043 merged commit 643e72c into main Sep 23, 2024
9 checks passed
@lee1043 lee1043 deleted the bug/695-temporal branch September 23, 2024 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Bug]: Potential bug in temporal.py module
2 participants