Skip to content

Commit 7ca4d8e

Browse files
committed
Further doctest fixes.
1 parent 9a8d088 commit 7ca4d8e

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

lib/iris/loading.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -312,23 +312,29 @@ class LoadPolicy(CombineOptions):
312312
.. testsetup::
313313
314314
from iris import LOAD_POLICY
315+
loadpolicy_old_settings = LOAD_POLICY.settings()
316+
317+
.. testcleanup::
318+
319+
# restore original settings, so as not to upset other tests
320+
LOAD_POLICY.set(loadpolicy_old_settings)
315321
316322
Examples
317323
--------
318324
>>> LOAD_POLICY.set("legacy")
319325
>>> print(LOAD_POLICY)
320-
LoadPolicy(support_multiple_references=False, merge_concat_sequence='m', repeat_until_unchanged=False)
326+
LoadPolicy(equalise_cubes_kwargs=None, merge_concat_sequence='m', merge_unique=False, repeat_until_unchanged=False, support_multiple_references=False)
321327
>>> LOAD_POLICY.support_multiple_references = True
322328
>>> print(LOAD_POLICY)
323-
LoadPolicy(support_multiple_references=True, merge_concat_sequence='m', repeat_until_unchanged=False)
329+
LoadPolicy(equalise_cubes_kwargs=None, merge_concat_sequence='m', merge_unique=False, repeat_until_unchanged=False, support_multiple_references=True)
324330
>>> LOAD_POLICY.set(merge_concat_sequence="cm")
325331
>>> print(LOAD_POLICY)
326-
LoadPolicy(support_multiple_references=True, merge_concat_sequence='cm', repeat_until_unchanged=False)
332+
LoadPolicy(equalise_cubes_kwargs=None, merge_concat_sequence='cm', merge_unique=False, repeat_until_unchanged=False, support_multiple_references=True)
327333
>>> with LOAD_POLICY.context("comprehensive"):
328334
... print(LOAD_POLICY)
329-
LoadPolicy(support_multiple_references=True, merge_concat_sequence='mc', repeat_until_unchanged=True)
335+
LoadPolicy(equalise_cubes_kwargs={'apply_all': True}, merge_concat_sequence='mc', merge_unique=False, repeat_until_unchanged=True, support_multiple_references=True)
330336
>>> print(LOAD_POLICY)
331-
LoadPolicy(support_multiple_references=True, merge_concat_sequence='cm', repeat_until_unchanged=False)
337+
LoadPolicy(equalise_cubes_kwargs=None, merge_concat_sequence='cm', merge_unique=False, repeat_until_unchanged=False, support_multiple_references=True)
332338
"""
333339

334340
# Option keys are as for CombineOptions, plus the multiple-refs control

lib/iris/util.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2407,6 +2407,12 @@ def testcube(timepts):
24072407
return cube
24082408
24092409
cubes = CubeList([testcube([1., 2]), testcube([13., 14, 15])])
2410+
combinecubes_old_policysettings = iris.LOAD_POLICY.settings()
2411+
2412+
.. testcleanup::
2413+
2414+
# restore old state to avoid upsetting other tests
2415+
iris.LOAD_POLICY.set(combinecubes_old_policysettings)
24102416
24112417
>>> # Take a pair of sample cubes which can concatenate together
24122418
>>> print(cubes)

0 commit comments

Comments
 (0)