Skip to content

Commit 871c08b

Browse files
committed
docs: fix wrong package name (#603)
0 parents  commit 871c08b

File tree

300 files changed

+87160
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

300 files changed

+87160
-0
lines changed

.nojekyll

Whitespace-only changes.

CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dev.docs.pyansys.com
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"\n\n# Adding a new gallery example\n\nThis example shows how to add a new example to the PyAnsys [Sphinx-Gallery](https://sphinx-gallery.github.io/). You can use this example as a template\nfor adding your examples.\n\nEach example should have a reference tag/key in the form:\n\n``.. _<example-name>_example:``.\n\nThe ``.. _`` is necessary. Everything that follows is your reference tag, which\ncan potentially be used within a docstring. All references should be in snake case.\n\nThe first section, which is text, provides a brief overview of what the example is.\nWhen using this example as a template, you would change the title to an appropriate\none for your example.\n\nAdd new examples as Python scripts like this:\n\n``examples/<index>-<directory-name>/<some-example>.py``\n\n<div class=\"alert alert-info\"><h4>Note</h4><p>Avoid creating directories unless absolutely necessary. If you *must*\n create a directory, make sure to add a ``README.txt`` file containing a\n reference, a title, and a one-sentence description of the directory.\n Otherwise, Sphinx ignores the new directory.</p></div>\n\nExample file names should use snake case and be hyphen-separated:\n\n``some-example.py``\n\nAfter this text section is the first code block. This is where you\ntypically set up your imports.\n"
8+
]
9+
},
10+
{
11+
"cell_type": "code",
12+
"execution_count": null,
13+
"metadata": {
14+
"collapsed": false
15+
},
16+
"outputs": [],
17+
"source": [
18+
"import pyvista as pv"
19+
]
20+
},
21+
{
22+
"cell_type": "markdown",
23+
"metadata": {},
24+
"source": [
25+
"## Section title\n\nCode blocks can be broken up with text sections, which are interpreted as\nReStructuredText.\n\nThe text sections are also translated into a markdown cell in the generated Jupyter\nnotebook or in the HTML documentation.\n\nText sections can contain any information that you may have regarding the example,\nsuch as step-by-step comments and notes regarding motivations.\n\nAs in Jupyter notebooks, if a statement is unassigned at the end of a code\nblock, output is generated and printed to the screen according to its\n``__repr__`` method. Otherwise, you can use the ``print()`` function to output text.\n\n"
26+
]
27+
},
28+
{
29+
"cell_type": "code",
30+
"execution_count": null,
31+
"metadata": {
32+
"collapsed": false
33+
},
34+
"outputs": [],
35+
"source": [
36+
"# Create a dataset and exercise its ``__repr__`` method\n\ndataset = pv.Sphere()\ndataset"
37+
]
38+
},
39+
{
40+
"cell_type": "markdown",
41+
"metadata": {},
42+
"source": [
43+
"## Plots and images\nIf you use anything that outputs an image (for example, the\n:func:`pyvista.Plotter.show` function), the resulting image is rendered in the\nHTML documentation.\n\n<div class=\"alert alert-info\"><h4>Note</h4><p>Unless ``sphinx_gallery_thumbnail_number = <int>`` is included at the top\n of the example script, the first figure (this one) is used for the\n gallery thumbnail image.\n\n Also note that this image number uses one-based indexing.</p></div>\n\n"
44+
]
45+
},
46+
{
47+
"cell_type": "code",
48+
"execution_count": null,
49+
"metadata": {
50+
"collapsed": false
51+
},
52+
"outputs": [],
53+
"source": [
54+
"dataset.plot(text=\"Example Figure\")"
55+
]
56+
},
57+
{
58+
"cell_type": "markdown",
59+
"metadata": {},
60+
"source": [
61+
"## Caveat - plotter must be within one cell\nIt's not possible to have a single :class:`pyvista.Plotter` object across\nmultiple cells because these are closed out automatically at the end of a\ncell.\n\nThis code exercise the :class:`pyvista.Actor` ``repr`` to demonstrate\nwhy you might want to instantiate a plotter without showing it in the same\ncell:\n\n"
62+
]
63+
},
64+
{
65+
"cell_type": "code",
66+
"execution_count": null,
67+
"metadata": {
68+
"collapsed": false
69+
},
70+
"outputs": [],
71+
"source": [
72+
"pl = pv.Plotter()\nactor = pl.add_mesh(dataset)\nactor"
73+
]
74+
},
75+
{
76+
"cell_type": "markdown",
77+
"metadata": {},
78+
"source": [
79+
"## This cell cannot run the plotter\nBecause the plotter is already closed by Sphinx-Gallery, the following code\nwould raise an error:\n\n>>> pl.show()\n\n"
80+
]
81+
},
82+
{
83+
"cell_type": "code",
84+
"execution_count": null,
85+
"metadata": {
86+
"collapsed": false
87+
},
88+
"outputs": [],
89+
"source": [
90+
"# You can, however, close out the plotter or access other attributes.\n\npl.close()"
91+
]
92+
},
93+
{
94+
"cell_type": "markdown",
95+
"metadata": {},
96+
"source": [
97+
"## Create a pull request\nOnce your example is complete and you've verified that it builds locally, you can\ncreate a pull request.\n\nBranches containing examples should be prefixed with ``docs/`` as per [Branch-naming conventions](https://dev.docs.pyansys.com/how-to/contributing.html#branch-naming-conventions).\n\n<div class=\"alert alert-info\"><h4>Note</h4><p>You only need to create the Python source example (PY file). Sphinx-Gallery\n automatically generates the Jupyter notebook and the RST file for generating\n the HTML documentation page.</p></div>\n\n"
98+
]
99+
}
100+
],
101+
"metadata": {
102+
"kernelspec": {
103+
"display_name": "Python 3",
104+
"language": "python",
105+
"name": "python3"
106+
},
107+
"language_info": {
108+
"codemirror_mode": {
109+
"name": "ipython",
110+
"version": 3
111+
},
112+
"file_extension": ".py",
113+
"mimetype": "text/x-python",
114+
"name": "python",
115+
"nbconvert_exporter": "python",
116+
"pygments_lexer": "ipython3",
117+
"version": "3.13.3"
118+
}
119+
},
120+
"nbformat": 4,
121+
"nbformat_minor": 0
122+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"id": 2496375,
3+
"name": "Auto-imported tag delete protections",
4+
"target": "tag",
5+
"source_type": "Repository",
6+
"enforcement": "active",
7+
"conditions": {
8+
"ref_name": {
9+
"exclude": [],
10+
"include": [
11+
"refs/tags/v*",
12+
"refs/tags/v*.*",
13+
"refs/tags/v*.*.*"
14+
]
15+
}
16+
},
17+
"rules": [
18+
{
19+
"type": "update"
20+
},
21+
{
22+
"type": "deletion"
23+
}
24+
],
25+
"bypass_actors": [
26+
{
27+
"actor_id": 5,
28+
"actor_type": "RepositoryRole",
29+
"bypass_mode": "always"
30+
},
31+
{
32+
"actor_id": 1,
33+
"actor_type": "OrganizationAdmin",
34+
"bypass_mode": "always"
35+
}
36+
]
37+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"id": 2680634,
3+
"name": "Branch naming",
4+
"target": "branch",
5+
"source_type": "Repository",
6+
"enforcement": "active",
7+
"conditions": {
8+
"ref_name": {
9+
"exclude": [
10+
"refs/heads/pre-commit-ci-update-config",
11+
"refs/heads/main",
12+
"refs/heads/gh-pages"
13+
],
14+
"include": [
15+
"~ALL"
16+
]
17+
}
18+
},
19+
"rules": [
20+
{
21+
"type": "deletion"
22+
},
23+
{
24+
"type": "non_fast_forward"
25+
},
26+
{
27+
"type": "branch_name_pattern",
28+
"parameters": {
29+
"operator": "regex",
30+
"pattern": "^(feat|fix|chore|docs|style|refactor|test|testing|perf|ci|no-ci|build|dependabot|release|maint|junk|)\\/.*",
31+
"negate": false,
32+
"name": ""
33+
}
34+
}
35+
],
36+
"bypass_actors": []
37+
}
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates.
2+
# SPDX-License-Identifier: MIT
3+
#
4+
#
5+
# Permission is hereby granted, free of charge, to any person obtaining a copy
6+
# of this software and associated documentation files (the "Software"), to deal
7+
# in the Software without restriction, including without limitation the rights
8+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
# copies of the Software, and to permit persons to whom the Software is
10+
# furnished to do so, subject to the following conditions:
11+
#
12+
# The above copyright notice and this permission notice shall be included in all
13+
# copies or substantial portions of the Software.
14+
#
15+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
# SOFTWARE.
22+
23+
# ruff: noqa: D400
24+
"""
25+
.. _adding_a_new_gallery_example:
26+
27+
Adding a new gallery example
28+
============================
29+
30+
This example shows how to add a new example to the PyAnsys `Sphinx-Gallery
31+
<https://sphinx-gallery.github.io/>`_. You can use this example as a template
32+
for adding your examples.
33+
34+
Each example should have a reference tag/key in the form:
35+
36+
``.. _<example-name>_example:``.
37+
38+
The ``.. _`` is necessary. Everything that follows is your reference tag, which
39+
can potentially be used within a docstring. All references should be in snake case.
40+
41+
The first section, which is text, provides a brief overview of what the example is.
42+
When using this example as a template, you would change the title to an appropriate
43+
one for your example.
44+
45+
Add new examples as Python scripts like this:
46+
47+
``examples/<index>-<directory-name>/<some-example>.py``
48+
49+
.. note::
50+
51+
Avoid creating directories unless absolutely necessary. If you *must*
52+
create a directory, make sure to add a ``README.txt`` file containing a
53+
reference, a title, and a one-sentence description of the directory.
54+
Otherwise, Sphinx ignores the new directory.
55+
56+
Example file names should use snake case and be hyphen-separated:
57+
58+
``some-example.py``
59+
60+
After this text section is the first code block. This is where you
61+
typically set up your imports.
62+
"""
63+
64+
import pyvista as pv
65+
66+
###############################################################################
67+
# Section title
68+
# ~~~~~~~~~~~~~
69+
#
70+
# Code blocks can be broken up with text sections, which are interpreted as
71+
# ReStructuredText.
72+
#
73+
# The text sections are also translated into a markdown cell in the generated Jupyter
74+
# notebook or in the HTML documentation.
75+
#
76+
# Text sections can contain any information that you may have regarding the example,
77+
# such as step-by-step comments and notes regarding motivations.
78+
#
79+
# As in Jupyter notebooks, if a statement is unassigned at the end of a code
80+
# block, output is generated and printed to the screen according to its
81+
# ``__repr__`` method. Otherwise, you can use the ``print()`` function to output text.
82+
83+
# Create a dataset and exercise its ``__repr__`` method
84+
85+
dataset = pv.Sphere()
86+
dataset
87+
88+
###############################################################################
89+
# Plots and images
90+
# ~~~~~~~~~~~~~~~~
91+
# If you use anything that outputs an image (for example, the
92+
# :func:`pyvista.Plotter.show` function), the resulting image is rendered in the
93+
# HTML documentation.
94+
#
95+
# .. note::
96+
#
97+
# Unless ``sphinx_gallery_thumbnail_number = <int>`` is included at the top
98+
# of the example script, the first figure (this one) is used for the
99+
# gallery thumbnail image.
100+
#
101+
# Also note that this image number uses one-based indexing.
102+
103+
dataset.plot(text="Example Figure")
104+
105+
###############################################################################
106+
# Caveat - plotter must be within one cell
107+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
108+
# It's not possible to have a single :class:`pyvista.Plotter` object across
109+
# multiple cells because these are closed out automatically at the end of a
110+
# cell.
111+
#
112+
# This code exercise the :class:`pyvista.Actor` ``repr`` to demonstrate
113+
# why you might want to instantiate a plotter without showing it in the same
114+
# cell:
115+
116+
pl = pv.Plotter()
117+
actor = pl.add_mesh(dataset)
118+
actor
119+
120+
###############################################################################
121+
# This cell cannot run the plotter
122+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
123+
# Because the plotter is already closed by Sphinx-Gallery, the following code
124+
# would raise an error:
125+
#
126+
# >>> pl.show()
127+
128+
# You can, however, close out the plotter or access other attributes.
129+
130+
pl.close()
131+
132+
###############################################################################
133+
# Create a pull request
134+
# ~~~~~~~~~~~~~~~~~~~~~
135+
# Once your example is complete and you've verified that it builds locally, you can
136+
# create a pull request.
137+
#
138+
# Branches containing examples should be prefixed with ``docs/`` as per `Branch-naming conventions
139+
# <https://dev.docs.pyansys.com/how-to/contributing.html#branch-naming-conventions>`_.
140+
#
141+
# .. note::
142+
#
143+
# You only need to create the Python source example (PY file). Sphinx-Gallery
144+
# automatically generates the Jupyter notebook and the RST file for generating
145+
# the HTML documentation page.
Binary file not shown.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"id": 2496378,
3+
"name": "Auto-imported tag create protections",
4+
"target": "tag",
5+
"source_type": "Repository",
6+
"enforcement": "active",
7+
"conditions": {
8+
"ref_name": {
9+
"exclude": [],
10+
"include": [
11+
"refs/tags/v*",
12+
"refs/tags/v*.*",
13+
"refs/tags/v*.*.*"
14+
]
15+
}
16+
},
17+
"rules": [
18+
{
19+
"type": "creation"
20+
},
21+
{
22+
"type": "update"
23+
}
24+
],
25+
"bypass_actors": [
26+
{
27+
"actor_id": 2,
28+
"actor_type": "RepositoryRole",
29+
"bypass_mode": "always"
30+
},
31+
{
32+
"actor_id": 5,
33+
"actor_type": "RepositoryRole",
34+
"bypass_mode": "always"
35+
},
36+
{
37+
"actor_id": 1,
38+
"actor_type": "OrganizationAdmin",
39+
"bypass_mode": "always"
40+
}
41+
]
42+
}

0 commit comments

Comments
 (0)