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

sage.coding: Modularization fixes, doctest cosmetics, add # optional #35729

Merged
merged 12 commits into from
Jun 21, 2023

Conversation

mkoeppe
Copy link
Member

@mkoeppe mkoeppe commented Jun 5, 2023

πŸ“š Description

Modularization fixes for imports (using lazy_import, moving imports from module level to method level).

Adding a header line # sage.doctest: optional - sage.modules sage.rings.finite_rings to most files.

Adding some more # optional to doctest lines.

Some markup fixes for the documentation (such as fixing the accidental boxes around nest enumerations: https://doc.sagemath.org/html/en/reference/coding/sage/coding/guruswami_sudan/gs_decoder.html#sage.coding.guruswami_sudan.gs_decoder.GRSGuruswamiSudanDecoder)

Some reformatting of doctests so they can be read in HTML format without horizontal scrolling.
For example, fixing the documentation of AbstractLinearCode.automorphism_group_gens (new: https://deploy-preview-35729--sagemath-tobias.netlify.app/reference/coding/sage/coding/linear_code.html#sage.coding.linear_code.AbstractLinearCode.automorphism_group_gens)

πŸ“ 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

@mkoeppe mkoeppe changed the title sage.coding: Doctest cosmetics, add # optional sage.coding: Modularization fixes, doctest cosmetics, add # optional Jun 5, 2023
@mkoeppe mkoeppe requested a review from dimpase June 5, 2023 20:22
@dimpase
Copy link
Member

dimpase commented Jun 6, 2023

test fails:

 DeprecationWarning: invalid escape sequence \G
**********************************************************************
1 item had failures:
   1 of  90 in doc.en.thematic_tutorials.coding_theory

@mkoeppe
Copy link
Member Author

mkoeppe commented Jun 6, 2023

the timeout in fusion_ring is unrelated

@dimpase
Copy link
Member

dimpase commented Jun 7, 2023

pdf docs doesn't build, with an error I never saw:

2023-06-07T14:21:54.4330040Z [sagemath_doc_pdf-none] Rule 'pdflatex': File changes, etc:
2023-06-07T14:21:54.4330532Z [sagemath_doc_pdf-none]    Changed files, or newly in use since previous run(s):
2023-06-07T14:21:54.4331087Z [sagemath_doc_pdf-none]       '/root/.texlive2019/texmf-var/web2c/pdftex/pdflatex.fmt'
2023-06-07T14:21:54.4331675Z [sagemath_doc_pdf-none] Latexmk: Maximum runs of pdflatex reached without getting stable files
2023-06-07T14:21:54.4332205Z [sagemath_doc_pdf-none] Latexmk: Summary of warnings from last run of *latex:
2023-06-07T14:21:54.4332748Z [sagemath_doc_pdf-none]   =====Latex reported missing or unavailable character(s).
2023-06-07T14:21:54.4333221Z [sagemath_doc_pdf-none] =====See log file for details.
2023-06-07T14:21:54.4333675Z [sagemath_doc_pdf-none]   Latex failed to resolve 1015 citation(s)
2023-06-07T14:21:54.4334086Z [sagemath_doc_pdf-none] ----------------------
2023-06-07T14:21:54.4334541Z [sagemath_doc_pdf-none] This message may duplicate earlier message.
2023-06-07T14:21:54.4335054Z [sagemath_doc_pdf-none] Latexmk: Failure in processing file 'combinat.tex':
2023-06-07T14:21:54.4335524Z [sagemath_doc_pdf-none]    'pdflatex' needed too many passes
2023-06-07T14:21:54.4335944Z [sagemath_doc_pdf-none] ----------------------
2023-06-07T14:21:54.4336433Z [sagemath_doc_pdf-none] Latexmk: Use the -f option to force complete processing,
2023-06-07T14:21:54.4336998Z [sagemath_doc_pdf-none]  unless error was exceeding maximum runs, or warnings treated as errors.
2023-06-07T14:21:54.4337501Z [sagemath_doc_pdf-none] Latexmk: Examining 'combinat.log'
2023-06-07T14:21:54.4338046Z [sagemath_doc_pdf-none] === TeX engine is 'pdfTeX'
2023-06-07T14:21:54.4338497Z [sagemath_doc_pdf-none] Latexmk: applying rule 'pdflatex'...
2023-06-07T14:21:54.4338978Z [sagemath_doc_pdf-none] Latexmk: All targets (combinat.pdf) are up-to-date
2023-06-07T14:21:54.4339491Z [sagemath_doc_pdf-none] make[5]: *** [Makefile:29: combinat.pdf] Error 12
2023-06-07T14:21:54.4339953Z [sagemath_doc_pdf-none] Error building the documentation.
2023-06-07T14:21:54.4340386Z [sagemath_doc_pdf-none] Traceback (most recent call last):
2023-06-07T14:21:54.4340883Z [sagemath_doc_pdf-none]   File "<frozen runpy>", line 198, in _run_module_as_main
2023-06-07T14:21:54.4341375Z [sagemath_doc_pdf-none]   File "<frozen runpy>", line 88, in _run_code
2023-06-07T14:21:54.4342077Z [sagemath_doc_pdf-none]   File "/__w/sage/sage/pkgs/sage-docbuild/sage_docbuild/__main__.py", line 498, in <module>
2023-06-07T14:21:54.4342542Z [sagemath_doc_pdf-none]     sys.exit(main())
2023-06-07T14:21:54.4343043Z [sagemath_doc_pdf-none]              ^^^^^^
2023-06-07T14:21:54.4343609Z [sagemath_doc_pdf-none]   File "/__w/sage/sage/pkgs/sage-docbuild/sage_docbuild/__main__.py", line 495, in main
2023-06-07T14:21:54.4344052Z [sagemath_doc_pdf-none]     builder()
2023-06-07T14:21:54.4344590Z [sagemath_doc_pdf-none]   File "/__w/sage/sage/pkgs/sage-docbuild/sage_docbuild/builders.py", line 299, in pdf
2023-06-07T14:21:54.4345165Z [sagemath_doc_pdf-none]     raise RuntimeError(error_message % (command, tex_dir))
2023-06-07T14:21:54.4345788Z [sagemath_doc_pdf-none] RuntimeError: failed to run $MAKE all-pdf in /sage/local/share/doc/sage/latex/en/reference/combinat
2023-06-07T14:21:54.4346241Z [sagemath_doc_pdf-none] 
2023-06-07T14:21:54.4346725Z [sagemath_doc_pdf-none]     Note: incremental documentation builds sometimes cause spurious
2023-06-07T14:21:54.4347301Z [sagemath_doc_pdf-none]     error messages. To be certain that these are real errors, run
2023-06-07T14:21:54.4347908Z [sagemath_doc_pdf-none]     "make doc-clean doc-uninstall" first and try again.

@mkoeppe
Copy link
Member Author

mkoeppe commented Jun 7, 2023

Is that a local pdf build or are you reading this from the "CI PDF", which is known to be broken?

@dimpase
Copy link
Member

dimpase commented Jun 7, 2023

CI pdf. Is it broken?

@mkoeppe
Copy link
Member Author

mkoeppe commented Jun 7, 2023

Yes, it's broken, related to running tex as root with a weird home directory configuration

@dimpase
Copy link
Member

dimpase commented Jun 7, 2023

hmm, is there an issue for this?

@mkoeppe
Copy link
Member Author

mkoeppe commented Jun 7, 2023

Not yet; I haven't paged this out from my brain to a GH Issue. Tobias disabled the workflow in sagemath/sage, so there is no urgency

@@ -196,7 +197,7 @@ class AbstractCode(Parent):
``MyDecoderClass``.


As AbstractCode is not designed to be implemented, it does not have any
As the class :class:`AbstractCode` is not designed to be instantiated, it does not have any
Copy link
Contributor

Choose a reason for hiding this comment

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

80 columns mode

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed many of these in a67136a

src/sage/coding/binary_code.pyx Outdated Show resolved Hide resolved
7920
sage: G = C.permutation_automorphism_group() # long time (6s on sage.math, 2011)
sage: G.is_isomorphic(M11) # long time
sage: G = C.permutation_automorphism_group() # long time (6s on sage.math, 2011) # optional - sage.groups
Copy link
Contributor

Choose a reason for hiding this comment

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

May be we should update these long time statements. It should now be much less than the 6s of 2011 ;)

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree; comments like this make our codebase look dated.

Probably best done in a separate PR, for all such annotations at the same time.

src/sage/coding/linear_code_no_metric.py Outdated Show resolved Hide resolved
@github-actions
Copy link

Documentation preview for this PR (built with commit 5aac3bf) 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
Member Author

mkoeppe commented Jun 11, 2023

Thanks a lot!

@vbraun vbraun merged commit dd8845d into sagemath:develop Jun 21, 2023
11 of 13 checks passed
@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.

None yet

4 participants