-
Notifications
You must be signed in to change notification settings - Fork 297
Closed
Description
🐛 Bug Report
Reported here: #5926 (comment)
How To Reproduce
Steps to reproduce the behaviour:
- Call the function:
my_cube = realistic_4d_w_everything(lazy=False) - Check laziness:
print(my_cube.has_lazy_data())
Expected behaviour
Step 2 should print False, but currently prints True.
Environment
- OS & Version: [e.g., Ubuntu 20.04 LTS]
- Iris Version: [e.g., From the command line run
python -c "import iris; print(iris.__version__)"]
Observed during GHA CI, and locally by @bouweandela
Additional context
iris/benchmarks/benchmarks/generate_data/stock.py
Lines 155 to 183 in 13017e3
| def realistic_4d_w_everything(w_mesh=False, lazy=False) -> iris.cube.Cube: | |
| """Run :func:`iris.tests.stock.realistic_4d_w_everything` in ``DATA_GEN_PYTHON``. | |
| Parameters | |
| ---------- | |
| w_mesh : bool | |
| See :func:`iris.tests.stock.realistic_4d_w_everything` for details. | |
| lazy : bool | |
| If True, the Cube will be returned with all arrays as they would | |
| normally be loaded from file (i.e. most will still be lazy Dask | |
| arrays). If False, all arrays will be realised NumPy arrays. | |
| """ | |
| def _external(w_mesh_: str, save_path_: str): | |
| import iris | |
| from iris.tests.stock import realistic_4d_w_everything | |
| cube = realistic_4d_w_everything(w_mesh=bool(w_mesh_)) | |
| iris.save(cube, save_path_) | |
| save_path = (BENCHMARK_DATA / f"realistic_4d_w_everything_{w_mesh}").with_suffix( | |
| ".nc" | |
| ) | |
| if not REUSE_DATA or not save_path.is_file(): | |
| _ = run_function_elsewhere(_external, w_mesh_=w_mesh, save_path_=str(save_path)) | |
| context = nullcontext() if lazy else load_realised() | |
| with context: | |
| return iris.load_cube(save_path, "air_potential_temperature") |