From 954396a316a0ccba7b44857117ba5ce457761945 Mon Sep 17 00:00:00 2001 From: Patrick Peglar Date: Thu, 24 Oct 2024 16:33:03 +0100 Subject: [PATCH] Make LoadPolicy examples more consistent. --- lib/iris/__init__.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/iris/__init__.py b/lib/iris/__init__.py index fb92981250..0a3541bcb4 100644 --- a/lib/iris/__init__.py +++ b/lib/iris/__init__.py @@ -523,17 +523,16 @@ def context(self, settings=None, **kwargs): >>> path = sample_data_path("time_varying_hybrid_height", "*.pp") >>> with LOAD_POLICY.context("legacy"): - ... cubes = iris.load(path) + ... cubes = iris.load(path, "x_wind") >>> print(cubes) - 0: surface_altitude / (m) (time: 15; latitude: 144; longitude: 192) - 1: x_wind / (m s-1) (time: 2; model_level_number: 5; latitude: 144; longitude: 192) - 2: x_wind / (m s-1) (time: 12; model_level_number: 5; latitude: 144; longitude: 192) - 3: x_wind / (m s-1) (model_level_number: 5; latitude: 144; longitude: 192) + 0: x_wind / (m s-1) (time: 2; model_level_number: 5; latitude: 144; longitude: 192) + 1: x_wind / (m s-1) (time: 12; model_level_number: 5; latitude: 144; longitude: 192) + 2: x_wind / (m s-1) (model_level_number: 5; latitude: 144; longitude: 192) >>> with LOAD_POLICY.context("recommended"): - ... cube = iris.load_cube(path, "x_wind") - >>> cube - + ... cubes = iris.load(path, "x_wind") + >>> cubes + 0: x_wind / (m s-1) (model_level_number: 5; time: 15; latitude: 144; longitude: 192)> """ # Save the current state saved_settings = self.settings()