Skip to content

pass *args and **kwargs into str methods for all a{r,c}b_* and expand goodstr domain#143

Merged
oscarbenjamin merged 1 commit intoflintlib:masterfrom
edgarcosta:showgood
Jun 15, 2024
Merged

pass *args and **kwargs into str methods for all a{r,c}b_* and expand goodstr domain#143
oscarbenjamin merged 1 commit intoflintlib:masterfrom
edgarcosta:showgood

Conversation

@edgarcosta
Copy link
Copy Markdown
Member

No description provided.

@oscarbenjamin
Copy link
Copy Markdown
Collaborator

Does this affect anything that could be testable or is it just for consistency?

@edgarcosta
Copy link
Copy Markdown
Member Author

It enables something like:

showgood(lambda : acb_series([arb.pi(), (arb.pi() + arb("1e-100")).sin()]), maxprec=10**3)
3.14159265358979 + (-1.00000000000000e-100)*x + O(x^10)

before you would have to use:

showgood(lambda : acb_series([arb.pi(), (arb.pi() + arb("1e-100")).sin()]).coeffs(), maxprec=10**3)
[3.14159265358979, -1.00000000000000e-100]

otherwise you would trigger:

raise TypeError("must have arb or acb")

@edgarcosta
Copy link
Copy Markdown
Member Author

Here is a more realistic example:

>>> from flint import *
>>> z = acb(1+1j); tau = acb(1.25+3j)
>>> showgood(lambda: acb_mat([[tau]]).theta(acb_mat([[z]])).transpose(), dps=25)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "showgood.pyx", line 131, in flint.functions.showgood.showgood
  File "showgood.pyx", line 108, in flint.functions.showgood.good
  File "showgood.pyx", line 39, in flint.functions.showgood.goodstr
TypeError: must have arb or acb

@oscarbenjamin
Copy link
Copy Markdown
Collaborator

Okay, I see. Looks good!

@oscarbenjamin oscarbenjamin merged commit ee239b1 into flintlib:master Jun 15, 2024
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