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

Remove deprecated indicators/indices, handle warnings #1318

Merged
merged 9 commits into from Apr 11, 2023

Conversation

Zeitsperre
Copy link
Collaborator

@Zeitsperre Zeitsperre commented Mar 10, 2023

Pull Request Checklist:

  • This PR addresses an already opened issue (for bug fixes / features)
  • Tests for the changes have been added (for bug fixes / features)
    • (If applicable) Documentation has been added / updated (for bug fixes / features)
  • CHANGES.rst has been updated (with summary of main changes)
    • Link to issue (:issue:number) and pull request (:pull:number) has been added

What kind of change does this PR introduce?

  • Deprecated Indicators have been removed:
    • first_day_below, first_day_above, snow_cover_duration, continuous_snow_cover_start, continuous_snow_cover_end
  • Deprecated indices have been removed:
    • snow_cover_duration, continuous_snow_cover_start, continuous_snow_cover_end
  • Most remaining deprecated calls to tests have been updated to new standards
  • Indices that emit FutureWarnings through regular use have been identified:

Does this PR introduce a breaking change?

Yes. This removes all currently-marked deprecated indices and indicators.

Other information:

The volume of warnings emitted from pytest is significantly reduced. The only warnings now emitted are those coming from lower-level libraries, like numpy and xarray. This should make it easier to identify and handle these instances moving forward.

…cover_duration, continuous_snow_cover_start, continuous_snow_cover_end) and indices (snow_cover_duration, continuous_snow_cover_start, continuous_snow_cover_end), catch existing DeprecationWarnings, migrate deprecated test calls to new functions, note methods and indices that may require internal logic revisions
@Zeitsperre Zeitsperre added information For development/intsructional purposes API Interfacing and User Concerns labels Mar 10, 2023
@Zeitsperre Zeitsperre self-assigned this Mar 10, 2023
@Zeitsperre Zeitsperre added this to the v0.42 milestone Mar 10, 2023
@github-actions github-actions bot added the indicators Climate indices and indicators label Mar 10, 2023
Copy link
Collaborator

@aulemahal aulemahal left a comment

Choose a reason for hiding this comment

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

I realized that we are emitting DeprecationWarning instead of FutureWarning. As we discovered elsewhere, the former is not visible to the user by default... Which means, that all the deprecation we are removing here have not been properly announced to the users...

Is the HISTORY enough to justify removing them? Or do we want to wait one more version ?

At least, I think we should fix the issue here :

xclim/xclim/core/indicator.py

Lines 1351 to 1357 in e0f67df

def _show_deprecation_warning(self):
warnings.warn(
f"`{self.title}` is deprecated as of xclim v{self._version_deprecated}. "
f"See the xclim release notes for more information.",
DeprecationWarning,
stacklevel=3,
)

@Zeitsperre
Copy link
Collaborator Author

@aulemahal

I think we would be fine effecting these changes. In some cases, the history has indicated that we are removing these functions as far back as v0.39, however, if we opt to wait until v0.43, I could remove all remaining deprecated indicators/indices as well.

If we want to mark this PR for v0.43, I'd open another PR to deal with the FutureWarning issue, and maybe address the usage warnings I found in the testing suite. What do you think?

@github-actions github-actions bot added the approved Approved for additional tests label Apr 6, 2023
Copy link
Collaborator

@aulemahal aulemahal left a comment

Choose a reason for hiding this comment

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

✝️ 🎤 💦
Ite in pace, glorificando vita vestra Dominum
Amen.

@Zeitsperre Zeitsperre merged commit 47a3ec6 into master Apr 11, 2023
27 checks passed
@Zeitsperre Zeitsperre deleted the deprecate_indices branch April 11, 2023 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Interfacing and User Concerns approved Approved for additional tests indicators Climate indices and indicators information For development/intsructional purposes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

discharge_distribution_fit has wrong _registry_id
3 participants