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

New feature annotations # optional - sage.schemes sage.modular sage.libs.flint etc. #35728

Merged
merged 15 commits into from
Jun 21, 2023

Conversation

mkoeppe
Copy link
Contributor

@mkoeppe mkoeppe commented Jun 5, 2023

📚 Description

📝 Checklist

  • The title is concise, informative, and self-explanatory.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation accordingly.

⌛ Dependencies

@@ -1693,8 +1699,8 @@ def plot(self, xmin=1, xmax=50, k=1, pointsize=30, rgbcolor=(0,0,1), join=True,
EXAMPLES::

sage: from sage.arith.misc import Sigma
sage: p = Sigma().plot()
sage: p.ymax()
sage: p = Sigma().plot() # optional - sage.plot # optional - sage.libs.pari
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not using # optional - sage.plot sage.libs.pari ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. I think I must have messed up a merge in this file. I already had a better version on #35095. I have now updated from there in 97d240e.

src/sage/arith/misc.py Outdated Show resolved Hide resolved
@@ -82,109 +82,109 @@ def algdep(z, degree, known_bits=None, use_bits=None, known_digits=None,

EXAMPLES::

sage: algdep(1.888888888888888, 1)
sage: algdep(1.888888888888888, 1) # optional - sage.libs.pari
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand the alignment of the # optional - ... in this file. It varies between blocks. Furthermore, some lines have 2 # optional - ... tags.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, this was completely messed up. Fixed now.

@@ -1,3 +1,4 @@
# sage.doctest: optional - primecountpy
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be so cool if all files could be like this one with only the declaration of the overall optional dependencies. Of course it's much more complicated than that in practice as some optional tags concern only a few tests in a file and are really iff some optional package (e.g., igraph) has been installed. But for dependencies that are repeated on almost all lines, it could ease our life to force the entire file to depend on these packages.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, and in some cases we can achieve this by splitting out parts of files to a separate file (but probably we should do this only where it seems natural).

EXAMPLES::

sage: from sage.features.sagemath import sage__schemes
sage: sage__schemes().is_present() # optional - sage.schemes
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't we have more spaces before the # optional tag ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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


sage: proof.arithmetic(True)
sage: with proof.WithProof('arithmetic',False): # this would hang "forever" if attempted with proof=True
Copy link
Contributor

Choose a reason for hiding this comment

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

Unless this comment is no longer relevant, it should remain.

Copy link
Contributor Author

@mkoeppe mkoeppe Jun 10, 2023

Choose a reason for hiding this comment

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

The comment appears in text just above:

This would hang "forever" if attempted with ``proof=True``::
sage: proof.arithmetic(True)
sage: with proof.WithProof('arithmetic', False): # optional - sage.libs.pari
....: print((10^1000 + 453).is_prime())
....: print(1/0)
Traceback (most recent call last):
...

@github-actions
Copy link

Documentation preview for this PR (built with commit 4f968a8) is ready! 🎉

Copy link
Contributor

@dcoudert dcoudert left a comment

Choose a reason for hiding this comment

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

LGTM.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jun 11, 2023

Thank you!

@tobiasdiez
Copy link
Contributor

Let's wait until we come to a conclusion at https://groups.google.com/g/sage-devel/c/utA0N1it0Eo how to proceed with these optional annotations.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jun 13, 2023

Tobias, as I have explained before, the adding these annotations is already documented as our practice.

@vbraun vbraun merged commit 882cd19 into sagemath:develop Jun 21, 2023
@mkoeppe mkoeppe added this to the sage-10.1 milestone Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants