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

woes due to attrs #1332

Open
molpopgen opened this issue Aug 6, 2024 · 1 comment
Open

woes due to attrs #1332

molpopgen opened this issue Aug 6, 2024 · 1 comment

Comments

@molpopgen
Copy link
Owner

The recent attrs release deprecates repr_ns. We use this feature to facilitate separating the fwdpy11 namespace across multiple Python files. Such separation is NOT really supported by the language, meaning that what we have done is a hack.

#1330 pinned attrs to avoid the new release in order to get CI to work.
But we can't live with a ceiling pin like this, so we have to address the deprecation.

Experiments in #1331 show that the only think that breaks by simply removing all use of repr_ns is a little-used feature: recreating Python objects from metadata in tskit tree sequences. There is no effect on recreating mutations, etc.. Rather, recreating thing like ModelParams, which contains other fwdpy11 objects. The issue is that the objects will no longer contain their namespace in their __repr__, resulting in NameError. Maintaining current behavior seems difficult in the best case.

@molpopgen
Copy link
Owner Author

The solution is a bit painful! We will have to require that our attrs classes have manual implementations of __repr__.

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

No branches or pull requests

1 participant