Skip to content

[DNM] add immutability test to mixin#724

Draft
atravitz wants to merge 1 commit intomainfrom
tests/add_immutability
Draft

[DNM] add immutability test to mixin#724
atravitz wants to merge 1 commit intomainfrom
tests/add_immutability

Conversation

@atravitz
Copy link
Copy Markdown
Contributor

@atravitz atravitz commented Feb 6, 2026

It's my understanding that gufetokenizables should be immutable, and therefore this test should pass. open to discussion though.

Tips

  • Comment "pre-commit.ci autofix" to have pre-commit.ci atomically format your PR.
    Since this will create a commit, it is best to make this comment when you are finished with your work.

Checklist

  • Added a news entry

Developers certificate of origin

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 6, 2026

No API break detected ✅

@IAlibay
Copy link
Copy Markdown
Member

IAlibay commented Feb 6, 2026

Our GufeTokenizables are unfortunately not all immutable, see SolventComponent:

In [1]: from gufe import SolventComponent

In [2]: a = SolventComponent()

In [3]: a.smiles
Out[3]: 'O'

In [4]: a._smiles = 'C'

In [5]: a.smiles
Out[5]: 'C'

The key is stable until you roundtrip on serialization.

@atravitz
Copy link
Copy Markdown
Contributor Author

decision from gufe devs meeting: this is not actually enforceable because python’s behavior, but putting a test in the mix-in and being clear on the docs is a reasonable thing to do here.

@atravitz atravitz changed the title add immutability test to mixin [DNM] add immutability test to mixin Mar 2, 2026
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.

2 participants