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

Docpipeline working part #1009

Closed
wants to merge 6 commits into from
Closed

Docpipeline working part #1009

wants to merge 6 commits into from

Conversation

mmatera
Copy link
Contributor

@mmatera mmatera commented Feb 12, 2024

This is another layer of improvements in the documentation system.

  • Fixes some references in ImportExport documentation.
  • Add and improve some docstrings and comments.
  • makes that the key attribute in mathics.doc.common.DocTest be more deterministic.
  • DRY __init__ routines in latex_doc subclasses.

@@ -43,11 +43,6 @@ def max_stored_size(self, _):


# Global variables
definitions = None
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Trailing lines from the v6.0 version.

#
# TODO: Split and simplify this section
#
#
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess this function still requires work. In general, test_tests/test_sections/test_chapters/test_all doesn't seem to take advantage of the new organization in common_doc.

return total, failed, skipped, failed_symbols, index


def test_tests_old(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I keep the old version here, because the new version is not working.

mathics/docpipeline.py Outdated Show resolved Hide resolved
@@ -481,72 +481,7 @@ class LaTeXDocTest(DocTest):
"""

def __init__(self, index, testcase, key_prefix=None):
def strip_sentinal(line):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

DRY

@@ -916,23 +832,6 @@ def __init__(
super().__init__(
chapter, section, title, text, operator, installed, in_guide, summary_text
)
self.doc = LaTeXDocumentationEntry(text, title, section)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

DRY.

@mmatera mmatera force-pushed the docpipeline_working_part branch from 38870c6 to 2b3602f Compare February 12, 2024 21:15
@rocky
Copy link
Member

rocky commented Feb 12, 2024

I was looking at this earlier. It is good to see the LaTeX document build again.

Something to keep in mind. Chapters in the Reference part, part 1 should not be sorted by either chapter or section. In this branch, tests appear sorted by chapter in part 1. And in the LaTeX doc the sections in part 1 are also sorted.

Part of the problem here is that I removed the "sort" parameter that allows one to specify whether or not to sort chapters and sections. In master, you'll find a sort-order field for chapters for part 1 chapters.

The logic of this branch follows the older logic where tests are accessed by document sequentially and they happen to come out ordered by section and chapter. One reason it is useful to have routines to get tests by chapter or section is that sometimes we want to run just the tests or update documentation for just section or chapter. For the tests one can get direct access using a slug name.

* Fix references in ImportExport

* Makes key generation more deterministic

* Fix typos in docstrings and comments
* Add the new versions of test_* in mathics.docpipeline, and keep the old ones
  when the new ones fail.
* Make more deterministic the key generation for ``DocTest``
* DRY __init__ methods in classes inside  latex_doc.py
@mmatera mmatera force-pushed the docpipeline_working_part branch from 96b64bd to c1551cb Compare February 12, 2024 21:53
@mmatera
Copy link
Contributor Author

mmatera commented Feb 12, 2024

The logic of this branch follows the older logic where tests are accessed by document sequentially and they happen to come out ordered by section and chapter. One reason it is useful to have routines to get tests by chapter or section is that sometimes we want to run just the tests or update documentation for just section or chapter. For the tests one can get direct access using a slug name.

Yes, I am aware of that, but the problem is that right now, it is not working. What I tried to do is to isolate what is not working, and then see if we can fix it.

@mmatera
Copy link
Contributor Author

mmatera commented Mar 14, 2024

superseded by #1021

@mmatera mmatera closed this Mar 14, 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