Skip to content

Commit 5e1d2c4

Browse files
committed
Unify Python library diagrams
1 parent efd0588 commit 5e1d2c4

File tree

4 files changed

+31
-71
lines changed

4 files changed

+31
-71
lines changed

doc/source/packaging/diagrams/ansys_project_diagram.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.. _high level pyansys structure:
22
.. graphviz::
3-
:caption: High-level structure of a PyAnsys project
3+
:caption: A PyAnsys project is composed by a Python library and other files.
44
:alt: High-level structure of a PyAnsys project
55
:align: center
66

doc/source/packaging/diagrams/python_elements_diagram.rst

Lines changed: 0 additions & 50 deletions
This file was deleted.

doc/source/packaging/diagrams/python_pkg_lib_diagram.rst renamed to doc/source/packaging/diagrams/python_library_diagram.rst

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. _python pkg lib diagram:
22
.. graphviz::
3-
:caption: Difference between Python library and package
4-
:alt: Difference between Python library and package
3+
:caption: A Python library is a collection of packages.
4+
:alt: A Python library is a collection of packages.
55
:align: center
66

77
digraph "sphinx-ext-graphviz" {
@@ -30,11 +30,37 @@
3030
label="...", shape="folder"
3131
];
3232

33-
3433
python_library -> pkg_A
3534
python_library -> pkg_B
3635
python_library -> pkg_other
3736

37+
sub_package [
38+
label="Sub-package A", shape="folder"
39+
];
40+
41+
init_file1 [
42+
label="__init__.py", shape="file"
43+
];
44+
45+
init_file2 [
46+
label="__init__.py", shape="file"
47+
];
48+
49+
module_foo [
50+
label="module_foo.py", shape="file"
51+
];
52+
53+
module_bar [
54+
label="module_bar.py", shape="file"
55+
];
56+
57+
pkg_A -> sub_package;
58+
pkg_A -> init_file1;
59+
pkg_A -> module_foo;
60+
61+
sub_package -> init_file2;
62+
sub_package -> module_bar;
63+
3864
}
3965

4066

doc/source/packaging/structure.rst

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,12 @@ Scripts, Modules, Sub-packages, and Packages
3131

3232
To understand the structure of a Python Library, it is important to know
3333
the difference between Python scripts, modules, sub-packages, and packages.
34-
Figure :numref:`python elements diagram` provides a graphical interpretation.
3534

3635
* ``Script``: Any Python file with logic source code.
3736
* ``Module``: Any Python script hosted next to an ``__init__.py`` file.
3837
* ``Sub-package``: Any directory containing various Python modules.
3938
* ``Package``: Any directory containing Python modules and sub-packages.
4039

41-
.. include:: diagrams/python_elements_diagram.rst
42-
4340

4441
Differences Between a Python Package and Library
4542
------------------------------------------------
@@ -49,20 +46,7 @@ them: a Python package is a collection of Python modules and sub-packages while
4946
a Python Library is a collection of Python packages. Figure :numref:`python pkg
5047
lib diagram` exposes this.
5148

52-
.. include:: diagrams/python_pkg_lib_diagram.rst
53-
54-
55-
Other Files
56-
===========
57-
58-
Additional files can be stored next to a Python Library. These files will not be
59-
included when distributing the library. Most of these files are metadata, tool
60-
configuration files, and CI workflows definitions.
61-
62-
.. tip::
63-
64-
Avoid having lots of additional files. This reduces mainteinance tasks and
65-
provides a clean root project directory.
49+
.. include:: diagrams/python_library_diagram.rst
6650

6751

6852
Required Files for a PyAnsys Project

0 commit comments

Comments
 (0)