Repository: bjlittle/geovista

Issue:
geovista.pantry.meshes are broken
## 🐛 Bug Report
<!-- Provide a clear description of the bug/issue that you're experiencing -->

```
> python -c "from geovista.pantry.meshes import dynamico; print(dynamico())"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/net/home/h05/itwl/projects/git/geovista/src/geovista/pantry/meshes.py", line 171, in dynamico
    sample = geovista.pantry.data.dynamico()
             ^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'geovista.pantry' has no attribute 'data'
```

Introduced by https://github.com/bjlittle/geovista/pull/645.

## Expected Behaviour
<!-- Provide a clear description of what you expected to happen -->

```
> python -c "from geovista.pantry.meshes import dynamico; print(dynamico())"
PolyData (0x7ff598f29720)
  N Cells:    16002
  N Points:   96012
  N Strips:   0
  X Bounds:   -1.000e+00, 1.000e+00
  Y Bounds:   -9.998e-01, 9.998e-01
  Z Bounds:   -9.999e-01, 9.999e-01
  N Arrays:   4
```

## Environment
<!-- Tell us your local Python environment package and GPU details -->

```
----------------------------------------------------------------------------------------
  Date: Fri Jan 26 01:29:00 2024 GMT

                  OS : Linux
              CPU(s) : 4
             Machine : x86_64
        Architecture : 64bit
         Environment : Python
          GPU Vendor : VMware, Inc.
        GPU Renderer : llvmpipe (LLVM 7.0, 256 bits)
         GPU Version : 3.3 (Core Profile) Mesa 18.3.4

  Python 3.12.1 | packaged by conda-forge | (main, Dec 23 2023, 08:03:24) [GCC 12.3.0]

             cartopy : 0.22.0
               click : 8.1.7
 click-default-group : 1.2.4
             cmocean : 3.0.3
            colorcet : 3.0.1
            geovista : 0.5.0.dev169
          matplotlib : 3.8.2
             netcdf4 : 1.6.5
               numpy : 1.26.3
        platformdirs : 4.1.0
               pooch : 1.8.0
            pykdtree : 1.3.10
              pyproj : 3.6.1
             pyvista : 0.43.1
              scooby : 0.9.2
                 vtk : 9.2.6
             IPython : 8.20.0
         fastparquet : 2023.10.1
jupyter_server_proxy : 4.1.0
        nest_asyncio : 1.5.8
              pandas : 2.1.4
               trame : 3.5.1
        trame_client : 2.14.2
        trame_server : 2.15.0
           trame_vtk : 2.6.3
----------------------------------------------------------------------------------------
```




Discussion:
codecov[bot]: ## [Codecov](https://app.codecov.io/gh/bjlittle/geovista/pull/673?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Bill+Little) Report
Attention: `79 lines` in your changes are missing coverage. Please review.
> Comparison is base [(`884d6ba`)](https://app.codecov.io/gh/bjlittle/geovista/commit/884d6baed97aa96cddbdc5e0803658bbffc7c1d5?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Bill+Little) 94.49% compared to head [(`ee9f6eb`)](https://app.codecov.io/gh/bjlittle/geovista/pull/673?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Bill+Little) 93.00%.

| [Files](https://app.codecov.io/gh/bjlittle/geovista/pull/673?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Bill+Little) | Patch % | Lines |
|---|---|---|
| [tests/pantry/meshes/test.py](https://app.codecov.io/gh/bjlittle/geovista/pull/673?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Bill+Little#diff-dGVzdHMvcGFudHJ5L21lc2hlcy90ZXN0LnB5) | 28.82% | [79 Missing :warning: ](https://app.codecov.io/gh/bjlittle/geovista/pull/673?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Bill+Little) |

<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff             @@
##             main     #673      +/-   ##
==========================================
- Coverage   94.49%   93.00%   -1.50%     
==========================================
  Files         128      129       +1     
  Lines        4778     4889     +111     
==========================================
+ Hits         4515     4547      +32     
- Misses        263      342      +79     
```



</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/bjlittle/geovista/pull/673?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Bill+Little).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Bill+Little).


Patch:
diff --git a/src/geovista/pantry/data.py b/src/geovista/pantry/data.py
index 0d9529f..5092d1d 100644
--- a/src/geovista/pantry/data.py
+++ b/src/geovista/pantry/data.py
@@ -73,11 +73,11 @@ class CloudPreference(_MixinStrEnum, Enum):
 
     """
 
-    HIGH = "high"
     LOW = "low"
     MEDIUM = "medium"
-    MESH = "mesh"
+    HIGH = "high"
     VERY_HIGH = "very_high"
+    MESH = "mesh"
 
 
 @dataclass(frozen=True)
diff --git a/src/geovista/pantry/meshes.py b/src/geovista/pantry/meshes.py
index aa20359..3e7b75b 100644
--- a/src/geovista/pantry/meshes.py
+++ b/src/geovista/pantry/meshes.py
@@ -20,7 +20,7 @@ import lazy_loader as lazy
 from geovista.bridge import Transform
 from geovista.cache import CACHE
 from geovista.common import Preference
-import geovista.pantry
+import geovista.pantry.data
 
 if TYPE_CHECKING:
     import pyvista as pv


Test patch:
diff --git a/tests/pantry/meshes/test__points_cells.py b/tests/pantry/meshes/test__points_cells.py
new file mode 100644
index 0000000..bbaca74
--- /dev/null
+++ b/tests/pantry/meshes/test__points_cells.py
@@ -0,0 +1,199 @@
+# Copyright (c) 2021, GeoVista Contributors.
+#
+# This file is part of GeoVista and is distributed under the 3-Clause BSD license.
+# See the LICENSE file in the package root directory for licensing details.
+
+"""Unit-tests for :func:`geovista.pantry.meshes`."""
+from __future__ import annotations
+
+import pytest
+
+from geovista.pantry import meshes
+
+
+@pytest.mark.parametrize("preference", ["low", "medium", "high", "very_high", "mesh"])
+def test_cloud_amount(preference):
+    """Test generation of cloud amount meshes."""
+    mesh = meshes.cloud_amount(preference=preference)
+    assert mesh.n_points == 3538946
+    assert mesh.n_cells == 3538944
+
+
+def test_cloud_amount__preference_bad():
+    """Test bad preference for cloud amount mesh."""
+    emsg = (
+        "Expected a preference of 'low' or 'medium' or 'high' or 'very_high' "
+        "or 'mesh'."
+    )
+    with pytest.raises(ValueError, match=emsg):
+        _ = meshes.cloud_amount(preference="bad")
+
+
+def test_dynamico():
+    """Test generation of dynamico mesh."""
+    mesh = meshes.dynamico()
+    assert mesh.n_points == 96012
+    assert mesh.n_cells == 16002
+
+
+def test_fesom():
+    """Test generation of fesom mesh."""
+    mesh = meshes.fesom()
+    assert mesh.n_points == 2283462
+    assert mesh.n_cells == 126859
+
+
+@pytest.mark.parametrize("preference", ["cell", "point"])
+def test_fvcom_tamar(preference):
+    """Test generation of tamar mesh."""
+    mesh = meshes.fvcom_tamar(preference=preference)
+    assert mesh.n_points == 39910
+    assert mesh.n_cells == 75400
+
+
+def test_fvcom_tamar__preference_bad():
+    """Test bad preference for fvcom tamar mesh."""
+    emsg = "Expected a preference of 'cell' or 'point'"
+    with pytest.raises(ValueError, match=emsg):
+        _ = meshes.fvcom_tamar(preference="bad")
+
+
+def test_icon_soil():
+    """Test generation of icon soil mesh."""
+    mesh = meshes.icon_soil()
+    assert mesh.n_points == 61440
+    assert mesh.n_cells == 20480
+
+
+def test_lam_equator():
+    """Test generation of lam equator mesh."""
+    mesh = meshes.lam_equator()
+    assert mesh.n_points == 25
+    assert mesh.n_cells == 16
+
+
+def test_lam_falklands():
+    """Test generation of lam falklands mesh."""
+    mesh = meshes.lam_falklands()
+    assert mesh.n_points == 25
+    assert mesh.n_cells == 16
+
+
+def test_lam_london():
+    """Test generation of lam london mesh."""
+    mesh = meshes.lam_london()
+    assert mesh.n_points == 25
+    assert mesh.n_cells == 16
+
+
+def test_lam_new_zealand():
+    """Test generation of lam new zealand mesh."""
+    mesh = meshes.lam_new_zealand()
+    assert mesh.n_points == 25
+    assert mesh.n_cells == 16
+
+
+def test_lam_pacific():
+    """Test generation of lam pacific mesh."""
+    mesh = meshes.lam_pacific()
+    assert mesh.n_points == 153549
+    assert mesh.n_cells == 152764
+
+
+def test_lam_polar():
+    """Test generation of lam polar mesh."""
+    mesh = meshes.lam_polar()
+    assert mesh.n_points == 25
+    assert mesh.n_cells == 16
+
+
+def test_lam_uk():
+    """Test generation of lam uk mesh."""
+    mesh = meshes.lam_uk()
+    assert mesh.n_points == 25
+    assert mesh.n_cells == 16
+
+
+@pytest.mark.parametrize(
+    ("resolution", "n_points", "n_cells"),
+    [("c48", 13826, 13824), ("c96", 55298, 55296), ("c192", 221186, 221184)],
+)
+def test_lfric(resolution, n_points, n_cells):
+    """Test generation of lfric mesh."""
+    mesh = meshes.lfric(resolution=resolution)
+    assert mesh.n_points == n_points
+    assert mesh.n_cells == n_cells
+
+
+def test_lfric__resolution_bad():
+    """Test bad resolution for lfric mesh."""
+    wmsg = "unknown LFRic cubed-sphere resolution"
+    with pytest.warns(UserWarning, match=wmsg):
+        mesh = meshes.lfric(resolution="bad")
+    assert mesh.n_points == 55298
+    assert mesh.n_cells == 55296
+
+
+def test_lfric_orog():
+    """Test generation of lfric orog mesh."""
+    mesh = meshes.lfric_orog()
+    assert mesh.n_points == 13826
+    assert mesh.n_cells == 13824
+
+
+def test_lfric_sst():
+    """Test generation of lfric sst mesh."""
+    mesh = meshes.lfric_sst()
+    assert mesh.n_points == 13826
+    assert mesh.n_cells == 13824
+
+
+def test_regular_grid():
+    """Test generation of regular grid mesh."""
+    mesh = meshes.regular_grid(resolution="r10")
+    assert mesh.n_points == 176
+    assert mesh.n_cells == 150
+
+
+def test_regular_grid__resolution_bad():
+    """Test bad resolution of regular grid mesh."""
+    wmsg = "Unknown regular grid resolution"
+    with pytest.warns(UserWarning, match=wmsg):
+        mesh = meshes.regular_grid(resolution="x100")
+    assert mesh.n_points == 5551
+    assert mesh.n_cells == 5400
+
+
+def test_oisst_avhrr_sst():
+    """Test generation of oisst avhrr sst mesh."""
+    mesh = meshes.oisst_avhrr_sst()
+    assert mesh.n_points == 1038961
+    assert mesh.n_cells == 1036800
+
+
+def test_um_orca2():
+    """Test generation of um orca2 mesh."""
+    mesh = meshes.um_orca2()
+    assert mesh.n_points == 106560
+    assert mesh.n_cells == 26640
+
+
+def test_um_orca2_cloud():
+    """Test generation of um orca2 cloud mesh."""
+    mesh = meshes.um_orca2_cloud()
+    assert mesh.n_points == 265791
+    assert mesh.n_cells == 265791
+
+
+def test_ww3_global_smc():
+    """Test generation of ww3 global smc mesh."""
+    mesh = meshes.ww3_global_smc()
+    assert mesh.n_points == 2665312
+    assert mesh.n_cells == 666328
+
+
+def test_ww3_global_tri():
+    """Test generation of ww3 global tri mesh."""
+    mesh = meshes.ww3_global_tri()
+    assert mesh.n_points == 16160
+    assert mesh.n_cells == 30559