Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/source/_static/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
.sd-bg-text-fluent{color: Black}
.sd-bg-cfx{background-color: LightSeaGreen}
.sd-bg-text-cfx{color: Black}
.sd-hide-link-text{height: 0}
22 changes: 16 additions & 6 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

# Make sphinx_utilities modules importable
sys.path.append(os.path.join(os.path.dirname(__file__), "../sphinx_utilities"))
from version_filtering import get_tutorial_version_requirements

# Manage errors
pyvista.set_error_output_file("errors.txt")
Expand Down Expand Up @@ -59,13 +60,12 @@
)
server_version = server_instance.version
server.shutdown_all_session_servers()
print(f"DPF version: {server_version}")
print(f"DPF install: {server_instance.ansys_path}")
print("".rjust(40, '*'))
print(f"Doc built for DPF server version {server_version} at:\n{server_instance.ansys_path}")
print("".rjust(40, '*'))

# Build ignore pattern
ignored_pattern = r"(ignore"
header_flag = "\"\"\""
note_flag = r".. note::"
for example in sorted(glob(r"../../examples/**/*.py")):
minimum_version_str = get_example_required_minimum_dpf_version(example)
if float(server_version) - float(minimum_version_str) < -0.05:
Expand All @@ -76,6 +76,15 @@
ignored_pattern += "|06-distributed_stress_averaging.py"
ignored_pattern += r")"

exclude_patterns = []
for tutorial_file in glob(str(Path("user_guide")/"tutorials"/"**"/"*.rst")):
if Path(tutorial_file).name == "index.rst":
continue
minimum_version_str = get_tutorial_version_requirements(tutorial_file)
if float(server_version) - float(minimum_version_str) < -0.05:
print(f"Tutorial {Path(tutorial_file).name} skipped as it requires DPF {minimum_version_str}.")
exclude_patterns.append(tutorial_file.replace("\\", "/"))

# Autoapi ignore pattern
autoapi_ignore_list = [
"*/log.py",
Expand Down Expand Up @@ -118,7 +127,6 @@
"sphinx_design",
"sphinx_jinja",
'sphinx_reredirects',
"ansys_sphinx_theme.extension.autoapi",
"jupyter_sphinx",
]

Expand Down Expand Up @@ -163,7 +171,7 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ["links_and_refs.rst"]
exclude_patterns.extend(["links_and_refs.rst"])

# make rst_epilog a variable, so you can add other epilog parts to it
rst_epilog = ""
Expand Down Expand Up @@ -411,3 +419,5 @@ def setup(app):
BUILD_EXAMPLES = True if os.environ.get("BUILD_EXAMPLES", "true") == "true" else False
if BUILD_EXAMPLES:
extensions.extend(["sphinx_gallery.gen_gallery"])

print(f"{extensions=}")
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@
Custom operators
================

.. note::

This tutorial requires DPF 11.0 or above.

This tutorial shows the basics of creating a custom operator in Python and loading it ont a server for use.

.. note:
.. note::

You can create custom operators in CPython using PyDPF-Core for use with DPF in Ansys 2023 R1 and later.

It first presents how to :ref:`create a custom DPF operator<tutorials_custom_operators_and_plugins_custom_operator_create_custom_operator>`
Expand All @@ -19,7 +24,8 @@ The next step is to :ref:`load the plugin on the server<tutorials_custom_operato

The final step is to instantiate the custom operator from the client API and :ref:`use it<tutorials_custom_operators_and_plugins_custom_operator_use_the_custom_operator>`.

.. note:
.. note::

In this tutorial the DPF client API used is PyDPF-Core but, once recorded on the server,
you can call the operators of the plugin using any of the DPF client APIs
(C++, CPython, IronPython), as you would any other operator.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ With support for custom operators, PyDPF-Core becomes a development tool offerin
The only prerequisite for creating custom operators is to be familiar with native operators.
For more information, see :ref:`ref_user_guide_operators`.

.. note:
.. note::

You can create custom operators in CPython using PyDPF-Core for use with DPF in Ansys 2023 R1 and later.

The following tutorials demonstrate how to develop such plugins using PyDPF-Core (CPython based) and how to use them.
Expand All @@ -36,44 +37,48 @@ For comprehensive examples on writing operator plugins, see :ref:`python_operato
:margin: 2

.. grid-item-card:: Create a DPF plugin with a single operator
:link: tutorials_custom_operators_and_plugins_custom_operator
:link-type: ref
:text-align: center
:link: tutorials_custom_operators_and_plugins_custom_operator
:link-type: ref
:text-align: center
:class-header: sd-bg-light sd-text-dark
:class-footer: sd-bg-light sd-text-dark

This tutorial shows how to create, load, and use a custom plugin containing a single custom operator.
This tutorial shows how to create, load, and use a custom plugin containing a single custom operator.

.. grid-item-card:: Create a DPF plugin with multiple operators
:text-align: center
:class-card: sd-bg-light
:class-header: sd-bg-light
+++
Requires DPF 11.0 or above

Coming soon
^^^
.. grid-item-card:: Create a DPF plugin with multiple operators
:text-align: center
:class-header: sd-bg-light sd-text-dark
:class-footer: sd-bg-light sd-text-dark

This tutorial shows how to create, load, and use a custom plugin with multiple operators or with complex routines.

This tutorial shows how to create, load, and use a custom plugin with multiple operators or with complex routines.
+++
Coming soon

.. grid-item-card:: Create a custom DPF plugin with third-party dependencies using Python
:text-align: center
:class-card: sd-bg-light
:class-header: sd-bg-light
:text-align: center
:class-header: sd-bg-light sd-text-dark
:class-footer: sd-bg-light sd-text-dark

Coming soon
^^^
This tutorial shows how to create a Python plug-in package with third-party dependencies.

This tutorial shows how to create a Python plug-in package with third-party dependencies.
+++
Coming soon

.. grid-item-card:: Update PyDPF-Core in the DPF installation
:text-align: center
:class-card: sd-bg-light
:class-header: sd-bg-light

Coming soon
^^^

:class-header: sd-bg-light sd-text-dark
:class-footer: sd-bg-light sd-text-dark

This tutorial shows how to update PyDPF-Core in your DPF installation.

+++
Coming soon

.. toctree::
:maxdepth: 2
:hidden:
Expand Down
Loading
Loading