diff --git a/src/doc/en/reference/combinat/module_list.rst b/src/doc/en/reference/combinat/module_list.rst index 610b9546525..b469a7e30f4 100644 --- a/src/doc/en/reference/combinat/module_list.rst +++ b/src/doc/en/reference/combinat/module_list.rst @@ -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 diff --git a/src/doc/en/reference/modules/index.rst b/src/doc/en/reference/modules/index.rst index c6109643c35..24851df37a7 100644 --- a/src/doc/en/reference/modules/index.rst +++ b/src/doc/en/reference/modules/index.rst @@ -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 diff --git a/src/sage/combinat/all.py b/src/sage/combinat/all.py index a378e86b5d3..2206ea2873a 100644 --- a/src/sage/combinat/all.py +++ b/src/sage/combinat/all.py @@ -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 diff --git a/src/sage/combinat/words/__init__.py b/src/sage/combinat/words/__init__.py deleted file mode 100644 index 4dc6dd45dba..00000000000 --- a/src/sage/combinat/words/__init__.py +++ /dev/null @@ -1,41 +0,0 @@ -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.`` and are listed in -the :ref:`words catalog `. - -**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`. -""" diff --git a/src/sage/combinat/words/all.py b/src/sage/combinat/words/all.py index 078ca4e48ab..687b572c8e5 100644 --- a/src/sage/combinat/words/all.py +++ b/src/sage/combinat/words/all.py @@ -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.`` and are listed in +the :ref:`words catalog `. + +**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 diff --git a/src/sage/groups/perm_gps/partn_ref/__init__.py b/src/sage/groups/perm_gps/partn_ref/all.py similarity index 100% rename from src/sage/groups/perm_gps/partn_ref/__init__.py rename to src/sage/groups/perm_gps/partn_ref/all.py diff --git a/src/sage/groups/perm_gps/partn_ref2/__init__.py b/src/sage/groups/perm_gps/partn_ref2/all.py similarity index 100% rename from src/sage/groups/perm_gps/partn_ref2/__init__.py rename to src/sage/groups/perm_gps/partn_ref2/all.py diff --git a/src/sage/modules/all.py b/src/sage/modules/all.py index a90258d7ec8..87621e61b29 100644 --- a/src/sage/modules/all.py +++ b/src/sage/modules/all.py @@ -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') diff --git a/src/sage/modules/with_basis/__init__.py b/src/sage/modules/with_basis/all.py similarity index 67% rename from src/sage/modules/with_basis/__init__.py rename to src/sage/modules/with_basis/all.py index 8cafbaa9b89..1f352bcc768 100644 --- a/src/sage/modules/with_basis/__init__.py +++ b/src/sage/modules/with_basis/all.py @@ -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__) diff --git a/src/sage_setup/autogen/interpreters/__init__.py b/src/sage_setup/autogen/interpreters/__init__.py index 13d3eed1735..c3534aeccf9 100644 --- a/src/sage_setup/autogen/interpreters/__init__.py +++ b/src/sage_setup/autogen/interpreters/__init__.py @@ -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 @@ -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") @@ -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)