Skip to content

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