From 59f18ee42cf3afb7899a86657560583ef7b41428 Mon Sep 17 00:00:00 2001 From: Xylar Asay-Davis Date: Thu, 27 Jul 2023 11:13:03 +0200 Subject: [PATCH 1/2] Fix cosine bell viz step The `lon` and `lat` fields are not available in the MPAS mesh file, but rather come from remapping to a regular lat-lon grid. --- polaris/ocean/tests/global_convergence/cosine_bell/viz.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/polaris/ocean/tests/global_convergence/cosine_bell/viz.py b/polaris/ocean/tests/global_convergence/cosine_bell/viz.py index a5be36535..16898f698 100644 --- a/polaris/ocean/tests/global_convergence/cosine_bell/viz.py +++ b/polaris/ocean/tests/global_convergence/cosine_bell/viz.py @@ -112,13 +112,12 @@ def run(self): remapper = viz_map.get_remapper() - ds_mesh = xr.open_dataset('mesh.nc') ds_init = xr.open_dataset('initial_state.nc') ds_init = ds_init[['tracer1', ]].isel(Time=0, nVertLevels=0) ds_init = remapper.remap(ds_init) ds_init.to_netcdf('remapped_init.nc') - plot_global(ds_mesh.lon.values, ds_mesh.lat.values, + plot_global(ds_init.lon.values, ds_init.lat.values, ds_init.tracer1.values, out_filename='init.png', config=config, colormap_section='cosine_bell_viz', @@ -129,7 +128,7 @@ def run(self): ds_out = remapper.remap(ds_out) ds_out.to_netcdf('remapped_final.nc') - plot_global(ds_mesh.lon.values, ds_mesh.lat.values, + plot_global(ds_init.lon.values, ds_init.lat.values, ds_out.tracer1.values, out_filename='final.png', config=config, colormap_section='cosine_bell_viz', From 9b2f28d0bbc567de1991bbde23ed07c73ee999e9 Mon Sep 17 00:00:00 2001 From: Xylar Asay-Davis Date: Thu, 27 Jul 2023 11:53:20 +0200 Subject: [PATCH 2/2] Constrain matplotlib We don't want to use version 3.7.2 because of a known bug with tight layouts and insets: matplotlib/matplotlib#26291 --- deploy/conda-dev-spec.template | 2 +- setup.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy/conda-dev-spec.template b/deploy/conda-dev-spec.template index ff8dfa301..0fc019b4b 100644 --- a/deploy/conda-dev-spec.template +++ b/deploy/conda-dev-spec.template @@ -19,7 +19,7 @@ lxml {% if include_mache %} mache={{ mache }} {% endif %} -matplotlib-base +matplotlib-base >=3.6.0,!=3.7.2 metis mpas_tools={{ mpas_tools }} nco diff --git a/setup.cfg b/setup.cfg index ef3978153..c276d468d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -31,7 +31,7 @@ install_requires = jigsawpy==0.3.3 jupyter lxml - matplotlib + matplotlib>=3.6.0,!=3.7.2 netcdf4 numpy progressbar2