Skip to content

Commit 78f152e

Browse files
author
Release Manager
committed
gh-35366: Many more namespace packages – follow up <!-- 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
2 parents 65f4cd2 + 4b397a7 commit 78f152e

File tree

10 files changed

+60
-46
lines changed

10 files changed

+60
-46
lines changed

src/doc/en/reference/combinat/module_list.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ Comprehensive Module List
368368
sage/combinat/tutorial
369369
sage/combinat/vector_partition
370370
sage/combinat/words/abstract_word
371-
sage/combinat/words
371+
sage/combinat/words/all
372372
sage/combinat/words/alphabet
373373
sage/combinat/words/finite_word
374374
sage/combinat/words/infinite_word

src/doc/en/reference/modules/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Modules with basis
2929
.. toctree::
3030
:maxdepth: 1
3131

32-
sage/modules/with_basis/__init__
32+
sage/modules/with_basis/all
3333
sage/modules/with_basis/cell_module
3434
sage/modules/with_basis/indexed_element
3535
sage/modules/with_basis/invariant

src/sage/combinat/all.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
- :ref:`sage.combinat.species.all`
2727
- :ref:`sage.combinat.designs.all`
2828
- :ref:`sage.combinat.posets.all`
29-
- :ref:`sage.combinat.words`
29+
- :ref:`sage.combinat.words.all`
3030
- :ref:`sage.combinat.bijectionist`
3131
3232
Utilities

src/sage/combinat/words/__init__.py

-41
This file was deleted.

src/sage/combinat/words/all.py

+45
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,48 @@
1+
r"""
2+
Combinatorics on words
3+
4+
**Main modules and their methods:**
5+
6+
- :ref:`sage.combinat.words.abstract_word`
7+
- :ref:`sage.combinat.words.finite_word`
8+
- :ref:`sage.combinat.words.infinite_word`
9+
- :ref:`sage.combinat.words.alphabet`
10+
- :ref:`sage.combinat.words.words`
11+
- :ref:`sage.combinat.words.paths`
12+
- :ref:`sage.combinat.words.morphism`
13+
- :ref:`sage.combinat.words.shuffle_product`
14+
- :ref:`sage.combinat.words.suffix_trees`
15+
16+
Main classes and functions meant to be used by the user:
17+
18+
:func:`~sage.combinat.words.word.Word`,
19+
:class:`~sage.combinat.words.words.FiniteWords`,
20+
:class:`~sage.combinat.words.words.InfiniteWords`,
21+
:func:`~sage.combinat.words.words.Words`,
22+
:func:`~sage.combinat.words.alphabet.Alphabet`,
23+
:class:`~sage.combinat.words.morphism.WordMorphism`,
24+
:class:`~sage.combinat.words.paths.WordPaths`.
25+
26+
A list of common words can be accessed through ``words.<tab>`` and are listed in
27+
the :ref:`words catalog <sage.combinat.words.word_generators>`.
28+
29+
**Internal representation of words:**
30+
31+
- :ref:`sage.combinat.words.word`
32+
- :ref:`sage.combinat.words.word_char`
33+
- :ref:`sage.combinat.words.word_datatypes`
34+
- :ref:`sage.combinat.words.word_infinite_datatypes`
35+
36+
**Options:**
37+
38+
- :ref:`sage.combinat.words.word_options`
39+
40+
See :func:`~sage.combinat.words.word_options.WordOptions`.
41+
"""
42+
# install the docstring of this module to the containing package
43+
from sage.misc.namespace_package import install_doc
44+
install_doc(__package__, __doc__)
45+
146
from .alphabet import Alphabet, build_alphabet
247
from .morphism import WordMorphism
348
from .paths import WordPaths

src/sage/modules/all.py

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323

2424
from .vector_space_morphism import linear_transformation
2525

26+
from .with_basis.all import *
27+
2628
from sage.misc.lazy_import import lazy_import
2729

2830
lazy_import('sage.modules.filtered_vector_space', 'FilteredVectorSpace')

src/sage/modules/with_basis/__init__.py renamed to src/sage/modules/with_basis/all.py

+3
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@
88
99
.. SEEALSO:: The category :class:`ModulesWithBasis`
1010
"""
11+
# install the docstring of this module to the containing package
12+
from sage.misc.namespace_package import install_doc
13+
install_doc(__package__, __doc__)

src/sage_setup/autogen/interpreters/__init__.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,11 @@ def rebuild(dirname, force=False):
199199
except OSError:
200200
if not os.path.isdir(dirname):
201201
raise
202+
# Remove leftover file from before move to namespace packages
203+
try:
204+
os.remove(os.path.join(dirname, '__init__.py'))
205+
except FileNotFoundError:
206+
pass
202207

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

@@ -230,5 +235,5 @@ class NeedToRebuild(Exception):
230235
for interp in _INTERPRETERS:
231236
build_interp(interp(), dirname)
232237

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

0 commit comments

Comments
 (0)