Skip to content

Commit 410310d

Browse files
authored
Add how-to for copying objects (#854)
Add a how-to guide which explains how to use the recursive_copy function. The guide builds up understanding of the function parameters by showing examples of their use. Add a parameter ``label_by_id`` to the model printer, since it is more convenient to know the ID rather than the name when trying to access objects in the model. Additionally, it allows distinguishing between the original object and its copy. Modify the doctest flags to normalize whitespace. Without this, the tree print output failed to match. Closes #830.
1 parent a7a1f42 commit 410310d

File tree

5 files changed

+1092
-16
lines changed

5 files changed

+1092
-16
lines changed

doc/source/conf.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Sphinx documentation configuration file."""
22

33
from datetime import datetime
4+
import doctest
45
import inspect
56
import os
67
import pathlib
@@ -191,6 +192,13 @@ def _signature(
191192
"pyvista.ext.viewer_directive",
192193
]
193194

195+
doctest_default_flags = (
196+
doctest.NORMALIZE_WHITESPACE
197+
| doctest.ELLIPSIS
198+
| doctest.IGNORE_EXCEPTION_DETAIL
199+
| doctest.DONT_ACCEPT_TRUE_FOR_1
200+
)
201+
194202
# Intersphinx mapping
195203
intersphinx_mapping = {
196204
"python": ("https://docs.python.org/3", None),

0 commit comments

Comments
 (0)