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

Add PrecisionManager to flint context #251

Merged
merged 4 commits into from
Jan 28, 2025

Conversation

Tom-Hubrecht
Copy link
Contributor

This allows temporarily changing the working precision using python context managers.

Related: #5

This allows temporarily changing the working precision using python
context managers.

Related: flintlib#5
This allows wrapping functions to set internal precisions using context
managers
@@ -69,4 +153,46 @@ cdef class FlintContext:
def cleanup(self):
flint_cleanup()


class PrecisionManager:
def __init__(self, ctx, eprec=None, edps=None):
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this should be a cdef class for speed.

Also use int for eprec and edps, -1 is a special value replacing None
@oscarbenjamin
Copy link
Collaborator

Looks good. Thanks

@oscarbenjamin oscarbenjamin merged commit 9cb1e81 into flintlib:main Jan 28, 2025
41 checks passed
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