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

Adjust type of ChemicalFormulaFeaturizer.powers. #964

Merged
merged 4 commits into from
Sep 19, 2024

Conversation

anoto-moniz
Copy link
Collaborator

The backend is opening up the type of powers to be floats. As such, this commit will deserialize powers as a list of floats. However, to preserve backwards compatability, the type of powers will be preserved, and a new field (powers_float) with the list as floats is introduced. In v4.0.0, the type of 'powers' will be changed, and 'powers_float' will be deprecated before its removal in v5.0.0.

PR Type:

  • Breaking change (fix or feature that would cause existing functionality to change)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Maintenance (non-breaking change to assist developers)

Adherence to team decisions

  • I have added tests for 100% coverage
  • I have written Numpy-style docstrings for every method and class.
  • I have communicated the downstream consequences of the PR to others.
  • I have bumped the version in __version__.py

The backend is opening up the type of powers to be floats. As such, this
commit will deserialize powers as a list of floats. However, to preserve
backwards compatability, the type of powers will be preserved, and a
new field (powers_float) with the list as floats is introduced. In
v4.0.0, the type of 'powers' will be changed, and 'powers_float' will be
deprecated before its removal in v5.0.0.
@anoto-moniz anoto-moniz marked this pull request as ready for review September 18, 2024 16:09
@anoto-moniz anoto-moniz requested a review from a team as a code owner September 18, 2024 16:09
Copy link
Collaborator

@kroenlein kroenlein left a comment

Choose a reason for hiding this comment

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

I think the migration strategy proposed is overkill given the actual impacts in Python of changing an int to a float. But I will disagree and commit.

Returning incorrect values when the object contains non-integer powers feels like mishandling data. That definitely violates minimum-surprise for me.

@anoto-moniz anoto-moniz dismissed kroenlein’s stale review September 18, 2024 17:22

The approach suggested has been rejected in conversations via Slack.

Copy link
Collaborator

@kroenlein kroenlein left a comment

Choose a reason for hiding this comment

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

A proposed workflow that alerts users when we cast their values without adding additional exceptions.

StevenKauwe
StevenKauwe previously approved these changes Sep 18, 2024
Copy link
Contributor

@StevenKauwe StevenKauwe left a comment

Choose a reason for hiding this comment

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

Catching up from OOO. These changes look good to me! 👍

They seem to preserve current client behavior while also adding the ability to work with floats if the user opts into it. Beyond that, looks like a lot already got discussed. This was helpful for catching up!

Copy link
Collaborator

@kroenlein kroenlein left a comment

Choose a reason for hiding this comment

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

Given the small number of people who I think will be affected by this and the addition of a mutation warning, I'll approve.

@anoto-moniz anoto-moniz merged commit 0e454fe into main Sep 19, 2024
16 checks passed
@anoto-moniz anoto-moniz deleted the bugfix/powers-type branch September 19, 2024 16:14
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.

3 participants