Skip to content

Commit

Permalink
Fix docstring test in make_diffraction_test_data.py
Browse files Browse the repository at this point in the history
Add testing of docstrings in make_diffraction_test_data.py and
radial_utils.py. The latter was enabled by toggling show_progessbar
off in the HyperSpy configs via the hyperspy preferences while running
the doctests.
  • Loading branch information
magnunor committed Apr 23, 2021
1 parent 91c22ff commit 5ef6337
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[pytest]
addopts = --ignore=pyxem/detectors/generic_flat_detector.py --ignore=pyxem/detectors/medipix_256x256.py --ignore=pyxem/detectors/medipix_515x515.py --ignore=pyxem/dummy_data/make_diffraction_test_data.py --ignore pyxem/signals/common_diffraction.py --ignore=pyxem/signals/diffraction2d.py --ignore=pyxem/signals/indexation_results.py --ignore=pyxem/utils/marker_tools.py --ignore=pyxem/utils/radial_utils.py
addopts = --ignore=pyxem/detectors/generic_flat_detector.py --ignore=pyxem/detectors/medipix_256x256.py --ignore=pyxem/detectors/medipix_515x515.py --ignore pyxem/signals/common_diffraction.py --ignore=pyxem/signals/diffraction2d.py --ignore=pyxem/signals/indexation_results.py --ignore=pyxem/utils/marker_tools.py
2 changes: 1 addition & 1 deletion pyxem/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
def doctest_setup_teardown(request):
plt.ioff()
tmp_dir = TemporaryDirectory()
hs.preferences.General.show_progressbar = False
org_dir = os.getcwd()
os.chdir(tmp_dir.name)
yield
Expand All @@ -21,7 +22,6 @@ def doctest_setup_teardown(request):

@pytest.fixture(autouse=True)
def add_np_am(doctest_namespace):
hs.preferences.General.nb_progressbar = False
doctest_namespace["np"] = numpy
doctest_namespace["hs"] = hs
doctest_namespace["pxm"] = pxm
2 changes: 1 addition & 1 deletion pyxem/dummy_data/make_diffraction_test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def _get_elliptical_ring(xx, yy, x, y, semi_len0, semi_len1, rotation, lw_r=1):
Examples
--------
>>> from hyperspy.signals import Signal2D
>>> from pyxem.dummy_data importmake_diffraction_test_data as mdtd
>>> from pyxem.dummy_data import make_diffraction_test_data as mdtd
>>> s = Signal2D(np.zeros((110, 130)))
>>> s.axes_manager[0].offset, s.axes_manager[1].offset = -50, -80
>>> xx, yy = np.meshgrid(
Expand Down

0 comments on commit 5ef6337

Please sign in to comment.