Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
csst-pipeline
csst_proto
Commits
fc0ad317
Commit
fc0ad317
authored
Sep 16, 2023
by
BO ZHANG
🏀
Browse files
tweaks
parent
e1bf7c35
Pipeline
#1214
failed with stage
in 0 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
docs/source/ch03_packaging.rst
View file @
fc0ad317
...
@@ -59,11 +59,15 @@ Relative import
...
@@ -59,11 +59,15 @@ Relative import
---------------
---------------
When import a class / function within the same package, a ``relative import``
When import a class / function within the same package, a ``relative import``
should be used instead of ``absolute import``.
should be used instead of ``absolute import``.
An example is below (``top_level_interface.py``):
An example is below (``api.py``):
.. code-block:: python
from .flip_image import flip_image, read_test_image
from .demo import a_demo_function, ADemoClass
__all__ = ["flip_image", "read_test_image", "a_demo_function", "ADemoClass"]
.. literalinclude:: ../../csst_proto/top_level_interface.py
:linenos:
:language: python
.. note::
.. note::
Note the ``.`` means it's a relative import.
Note the ``.`` means it's a relative import.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment