Skip to content

Commit

Permalink
gh-35366: Many more namespace packages – follow up
Browse files Browse the repository at this point in the history
    
<!-- Please provide a concise, informative and self-explanatory title.
-->
<!-- Don't put issue numbers in the title. Put it in the Description
below. -->
<!-- For example, instead of "Fixes #12345", use "Add a new method to
multiply two integers" -->

### 📚 Description

<!-- Describe your changes here in detail. -->
Follow-up from #35322.
<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes #12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. It should be `[x]` not `[x
]`. -->

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

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- #12345: short description why this is a dependency
- #34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: #35366
Reported by: Matthias Köppe
Reviewer(s): Gonzalo Tornaría
  • Loading branch information
Release Manager committed Apr 4, 2023
2 parents 65f4cd2 + 4b397a7 commit 78f152e
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 46 deletions.
2 changes: 1 addition & 1 deletion src/doc/en/reference/combinat/module_list.rst
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ Comprehensive Module List
sage/combinat/tutorial
sage/combinat/vector_partition
sage/combinat/words/abstract_word
sage/combinat/words
sage/combinat/words/all
sage/combinat/words/alphabet
sage/combinat/words/finite_word
sage/combinat/words/infinite_word
Expand Down
2 changes: 1 addition & 1 deletion src/doc/en/reference/modules/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Modules with basis
.. toctree::
:maxdepth: 1

sage/modules/with_basis/__init__
sage/modules/with_basis/all
sage/modules/with_basis/cell_module
sage/modules/with_basis/indexed_element
sage/modules/with_basis/invariant
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/all.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
- :ref:`sage.combinat.species.all`
- :ref:`sage.combinat.designs.all`
- :ref:`sage.combinat.posets.all`
- :ref:`sage.combinat.words`
- :ref:`sage.combinat.words.all`
- :ref:`sage.combinat.bijectionist`
Utilities
Expand Down
41 changes: 0 additions & 41 deletions src/sage/combinat/words/__init__.py

This file was deleted.

45 changes: 45 additions & 0 deletions src/sage/combinat/words/all.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,48 @@
r"""
Combinatorics on words
**Main modules and their methods:**
- :ref:`sage.combinat.words.abstract_word`
- :ref:`sage.combinat.words.finite_word`
- :ref:`sage.combinat.words.infinite_word`
- :ref:`sage.combinat.words.alphabet`
- :ref:`sage.combinat.words.words`
- :ref:`sage.combinat.words.paths`
- :ref:`sage.combinat.words.morphism`
- :ref:`sage.combinat.words.shuffle_product`
- :ref:`sage.combinat.words.suffix_trees`
Main classes and functions meant to be used by the user:
:func:`~sage.combinat.words.word.Word`,
:class:`~sage.combinat.words.words.FiniteWords`,
:class:`~sage.combinat.words.words.InfiniteWords`,
:func:`~sage.combinat.words.words.Words`,
:func:`~sage.combinat.words.alphabet.Alphabet`,
:class:`~sage.combinat.words.morphism.WordMorphism`,
:class:`~sage.combinat.words.paths.WordPaths`.
A list of common words can be accessed through ``words.<tab>`` and are listed in
the :ref:`words catalog <sage.combinat.words.word_generators>`.
**Internal representation of words:**
- :ref:`sage.combinat.words.word`
- :ref:`sage.combinat.words.word_char`
- :ref:`sage.combinat.words.word_datatypes`
- :ref:`sage.combinat.words.word_infinite_datatypes`
**Options:**
- :ref:`sage.combinat.words.word_options`
See :func:`~sage.combinat.words.word_options.WordOptions`.
"""
# install the docstring of this module to the containing package
from sage.misc.namespace_package import install_doc
install_doc(__package__, __doc__)

from .alphabet import Alphabet, build_alphabet
from .morphism import WordMorphism
from .paths import WordPaths
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions src/sage/modules/all.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

from .vector_space_morphism import linear_transformation

from .with_basis.all import *

from sage.misc.lazy_import import lazy_import

lazy_import('sage.modules.filtered_vector_space', 'FilteredVectorSpace')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@
.. SEEALSO:: The category :class:`ModulesWithBasis`
"""
# install the docstring of this module to the containing package
from sage.misc.namespace_package import install_doc
install_doc(__package__, __doc__)
9 changes: 7 additions & 2 deletions src/sage_setup/autogen/interpreters/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@ def rebuild(dirname, force=False):
except OSError:
if not os.path.isdir(dirname):
raise
# Remove leftover file from before move to namespace packages
try:
os.remove(os.path.join(dirname, '__init__.py'))
except FileNotFoundError:
pass

# Although multiple files are generated by this function, since
# they are all generated at once it suffices to make sure if just
Expand All @@ -208,7 +213,7 @@ class NeedToRebuild(Exception):
try:
if force:
raise NeedToRebuild("-> Force rebuilding interpreters")
gen_file = os.path.join(dirname, '__init__.py')
gen_file = os.path.join(dirname, 'all.py')
if not os.path.isfile(gen_file):
raise NeedToRebuild("-> First build of interpreters")

Expand All @@ -230,5 +235,5 @@ class NeedToRebuild(Exception):
for interp in _INTERPRETERS:
build_interp(interp(), dirname)

with open(os.path.join(dirname, '__init__.py'), 'w') as f:
with open(os.path.join(dirname, 'all.py'), 'w') as f:
f.write("# " + AUTOGEN_WARN)

0 comments on commit 78f152e

Please sign in to comment.