Skip to content

Commit c62ea54

Browse files
MaxJPReyakaszynski
andauthored
Add logging guideline section. (#23)
* Add logging guidelines. * Add logging to the Guidelines section. * Remove new line. * Add images for the logging guideline. * Add list of guidelines. * Add the intersphinx extension. * Fix Duplicate explicit target name. * add logging example module * ignore gitignore * Fix typo. * Why and when to log. * Always log to share data. * Add sphinx_toolbox in the doc requirements. * Improve some comments in the logging example. * Replace 'file' by 'stdout' for the stream. * Add unit tests for the logging example module. * add literalinclude * Improve syntax. * Move the test close to the module itself. * Add a best practice section. * Move the App filter under the best practices. * Improve the app filter text. * Remove the sys.path.append(). * Solve title conflict. * Add Logger destructeur. * Improve logging.Handler section. * Use the tmpdir fixture. * Improve the wrapping section. * Update logging/test_pyansys_logging.py Co-authored-by: Alex Kaszynski <[email protected]> * Update logging/pyansys_logging.py Co-authored-by: Alex Kaszynski <[email protected]> * Update logging/test_pyansys_logging.py Co-authored-by: Alex Kaszynski <[email protected]> * Add the cleanup argument. Co-authored-by: Alex Kaszynski <[email protected]>
1 parent a2d1571 commit c62ea54

14 files changed

+974
-43
lines changed

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@ dist/*
99
#########################
1010
*.egg-info/
1111

12-
12+
# Build docs and packages
1313
build/*
1414
doc/build/
1515

1616
# virtual environment
17-
venv/
17+
venv/
18+
19+
# sphinx autogen
20+
doc/source/documentation_style/api/*

doc/source/conf.py

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
from datetime import datetime
22

3+
from pyansys_sphinx_theme import __version__, pyansys_logo_black
4+
35
# Project information
46
project = 'PyAnsys Developers Guide'
5-
copyright = f'{datetime.now().year}, ANSYS'
6-
author = 'ANSYS, Inc.'
7+
copyright = f"(c) {datetime.now().year} ANSYS, Inc. All rights reserved"
8+
author = "Ansys Inc."
79
release = version = '0.1.dev0'
810

9-
html_logo = 'https://docs.pyansys.com/_static/pyansys-logo-black-cropped.png'
11+
html_logo = pyansys_logo_black
1012
html_theme = 'pyansys_sphinx_theme'
1113

1214
html_theme_options = {
@@ -16,21 +18,31 @@
1618

1719
# Sphinx extensions
1820
extensions = [
19-
'sphinx.ext.todo',
21+
"sphinx_copybutton",
22+
'sphinx_toolbox.collapse',
2023
'sphinx.ext.autodoc',
21-
'sphinx.ext.napoleon',
2224
'sphinx.ext.autosummary',
25+
'sphinx.ext.intersphinx',
26+
'sphinx.ext.napoleon',
27+
'sphinx.ext.todo',
2328
]
2429

30+
# Intersphinx mapping
31+
intersphinx_mapping = {
32+
"python": ("https://docs.python.org/dev", None),
33+
# "scipy": ("https://docs.scipy.org/doc/scipy/reference", None),
34+
# "numpy": ("https://numpy.org/devdocs", None),
35+
# "matplotlib": ("https://matplotlib.org/stable", None),
36+
# "pandas": ("https://pandas.pydata.org/pandas-docs/stable", None),
37+
# "pyvista": ("https://docs.pyvista.org/", None),
38+
}
39+
2540
# The suffix(es) of source filenames.
2641
source_suffix = '.rst'
2742

2843
# The master toctree document.
2944
master_doc = 'index'
3045

31-
32-
master_doc = 'index'
33-
3446
latex_elements = {}
3547

3648
# Grouping the document tree into LaTeX files. List of tuples

doc/source/documentation_style/api/pyansys_sphinx_theme.samples.Complex.abs.rst

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

doc/source/documentation_style/api/pyansys_sphinx_theme.samples.Complex.imag.rst

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

doc/source/documentation_style/api/pyansys_sphinx_theme.samples.Complex.real.rst

Lines changed: 0 additions & 6 deletions
This file was deleted.
Loading
11.2 KB
Loading

doc/source/guidelines/index.rst

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
Guidelines
1+
Guidelines and Best Practices
22
#############################
3-
The purpose of this section is to highligh some common practices that
4-
can be applied to the entire PyAnsys project in order to remain consistent.
3+
This section describes and outlines several best practices that can be
4+
applied to PyAnsys libaries for the purpose of creating effective and
5+
efficient Python libraries to interface with Ansys products and
6+
services. These guidelines demonstrate how applications and complex
7+
services expose functionalities such as logging, data transfer, and
8+
Application APIs.
59

6-
One of the main objectives of PyAnsys libraries is to wrap (encapsulate)
7-
data and methods within units of execution while hiding data or parameters
8-
in protected variables.
9-
10-
Those guidelines demonstrate how applications and complex services expose
11-
functionalities such as logging, data transfer...
10+
Table of Contents
11+
-----------------
1212

1313
.. toctree::
14-
:hidden:
15-
:maxdepth: 3
14+
:maxdepth: 2
1615

1716
dev_practices
1817
app_interface_abstraction
19-
service_abstraction
2018
data_transfer_and_representation
19+
logging
20+
service_abstraction
21+

0 commit comments

Comments
 (0)