Skip to content

Commit 944b1b5

Browse files
committed
Move iris.loading imports to top of iris main module.
1 parent 7abd9ee commit 944b1b5

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

lib/iris/__init__.py

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,23 @@ def callback(cube, field, filename):
9797
import iris._constraints
9898
import iris.config
9999
import iris.io
100+
from iris.io import save
101+
from iris.loading import LOAD_POLICY as _LOAD_POLICY
102+
from iris.loading import (
103+
CombineOptions,
104+
LoadPolicy,
105+
load,
106+
load_cube,
107+
load_cubes,
108+
load_raw,
109+
)
110+
111+
# NOTE: we make an independent local 'LOAD_POLICY' definition here, just so that we
112+
# can ensure an entry for it in our API documentation page.
113+
114+
#: A control object containing the current file loading strategy options.
115+
LOAD_POLICY = _LOAD_POLICY
116+
100117

101118
from ._deprecation import IrisDeprecation, warn_deprecated
102119

@@ -282,25 +299,6 @@ def context(self, **kwargs):
282299
_update(site_configuration)
283300

284301

285-
import iris.loading
286-
from iris.loading import (
287-
CombineOptions,
288-
LoadPolicy,
289-
load,
290-
load_cube,
291-
load_cubes,
292-
load_raw,
293-
)
294-
295-
# NOTE: we define an independent local 'LOAD_POLICY' object here, just so that we can
296-
# ensure an entry in the API documentation output page.
297-
298-
#: A control object containing the current file loading strategy options.
299-
LOAD_POLICY = iris.loading.LOAD_POLICY
300-
301-
from iris.io import save
302-
303-
304302
def sample_data_path(*path_to_join):
305303
"""Given the sample data resource, returns the full path to the file.
306304

0 commit comments

Comments
 (0)