Skip to content

Commit

Permalink
Merge pull request #2000 from larrybradley/import-warn
Browse files Browse the repository at this point in the history
Put module import message in a warning box
  • Loading branch information
larrybradley authored Feb 6, 2025
2 parents 0f3cd0c + cb549a7 commit b5a64f5
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions docs/getting_started/importing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,17 @@ or::
>>> from photutils.aperture import CircularAperture
>>> aper = CircularAperture((10, 20), r=4)

In general, one should not import from specific submodules of packages.
This is unnecessary and the internal organization of the package may
change without notice. For example, the following is not recommended::

>>> from photutils.aperture.circle import CircularAperture
>>> aper = CircularAperture((10, 20), r=4)
.. warning::

*Do not import from specific modules of packages.* This is
unnecessary and the internal organization of the package may change
without notice. All public tools are available in the package
top-level namespace. For example, do not import from the ``circle``
module within the ``aperture`` package::

>>> from photutils.aperture.circle import CircularAperture
>>> aper = CircularAperture((10, 20), r=4)


.. warning::
Expand Down

0 comments on commit b5a64f5

Please sign in to comment.