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

Enumeration comparisons changed from usage of is to == #559

Merged
merged 3 commits into from
Sep 19, 2024
Merged

Conversation

monocongo
Copy link
Owner

@monocongo monocongo commented Sep 17, 2024

Addressing #558 we've changed usages of is to == for comparisons of Periodicity and Distribution type arguments. This seems to fix that issue and maybe has something to do with how dask handles enumerated types when passed as arguments, maybe Enum class types don't fit well compared to strings, etc.

Summary by Sourcery

Fix enumeration comparisons by replacing 'is' with '==' for Periodicity and Distribution types to address compatibility issues, potentially related to how 'dask' handles enumerated types.

Bug Fixes:

  • Fix enumeration comparisons by replacing the use of 'is' with '==' for Periodicity and Distribution type arguments to ensure correct behavior.

Copy link

sourcery-ai bot commented Sep 17, 2024

Reviewer's Guide by Sourcery

This pull request changes the comparison of enumeration types from using the is operator to the == operator in the climate_indices module. The changes are made to address issue #558, which may be related to how dask handles enumerated types when passed as arguments.

File-Level Changes

Change Details Files
Changed enumeration comparisons from is to ==
  • Updated comparisons for periodicity from is to ==
  • Updated comparisons for distribution from is to ==
  • Modified error messages to use single quotes around the invalid argument values
src/climate_indices/indices.py
Improved code formatting and comments
  • Adjusted indentation for better readability
  • Updated comments to be more concise and accurate
src/climate_indices/indices.py

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link

sonarcloud bot commented Sep 17, 2024

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @monocongo - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

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.

1 participant