Skip to content

Commit f20d7c9

Browse files
authored
Merge pull request #205 from csiro-coasts/geometry-rewrite
Geometry rewrite
2 parents 4c6d724 + 5b02bac commit f20d7c9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+3483
-1299
lines changed

continuous-integration/docs.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ channels:
33

44
dependencies:
55
- geos ~=3.12.2
6-
- python =3.12
6+
- python =3.14
77
- wheel
88
- pip:
9-
- -r ./requirements-3.12.txt
9+
- -r ./requirements-3.14.txt
1010
- -e ..[docs]
1.03 MB
Binary file not shown.
313 KB
Loading
127 KB
Loading
3.54 KB
Loading

docs/api/conventions/arakawa-c.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,11 @@ Arakawa C grid datasets have four :ref:`grids <grids>`:
1414
*face*, *left*, *back*, and *node*.
1515
:class:`ArakawaCGridKind` represents this.
1616
Each grid is :ref:`indexed <indexing>` by a grid kind and two integers *i* and *j*.
17-
The convention native index type is :data:`ArakawaCIndex`.
1817

1918
.. autoclass:: ArakawaCGridKind
2019
:members:
2120
:undoc-members:
2221

23-
.. autodata:: ArakawaCIndex
24-
2522
Topology
2623
========
2724

docs/api/conventions/grid.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,11 @@ Indexing
1717
CF grid datasets have one :ref:`grid <grids>`: *face*.
1818
:class:`CFGridKind` represents this.
1919
Each face is :ref:`indexed <indexing>` by two integers *x* and *y*.
20-
The convention native index type is :data:`CFGridIndex`.
2120

2221
.. autoclass:: CFGridKind
2322
:members:
2423
:undoc-members:
2524

26-
.. autodata:: CFGridIndex
27-
2825
Topology
2926
========
3027

docs/api/conventions/interface.rst

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,33 @@ the :class:`~emsarray.conventions.Convention` interface.
1515
.. autofunction:: emsarray.open_dataset
1616
.. autofunction:: emsarray.get_dataset_convention
1717

18-
.. autoclass:: emsarray.conventions.Convention
19-
:members:
18+
Convention
19+
==========
2020

21-
.. autoclass:: emsarray.conventions.DimensionConvention
21+
All dataset conventions have the following methods:
2222

23-
.. autoattribute:: grid_dimensions
24-
.. automethod:: unpack_index
25-
.. automethod:: pack_index
23+
.. autoclass:: emsarray.conventions.Convention
24+
:members:
2625

27-
.. autoclass:: emsarray.conventions.SpatialIndexItem
26+
.. autoclass:: emsarray.conventions.Grid
2827
:members:
2928

29+
Concepts
30+
========
31+
3032
.. type:: GridKind
3133

32-
Some type that can enumerate the different :ref:`grid types <grids>`
33-
present in a dataset.
34-
This can be an :class:`enum.Enum` listing each different kind of grid.
34+
All datasets define variables on one or more :ref:`grid<grids>`.
35+
:type:`GridKind` enumerates all the available grids for a specific convention,
36+
while :class:`Grid` provides methods for introspecting a particular grid.
37+
38+
The :type:`GridKind` for a dataset is usually an :class:`enum.Enum` listing each different kind of grid.
39+
40+
.. rubric:: Notes
3541

3642
:type:`Index` values will be included in the feature properties
3743
of exported geometry from :mod:`emsarray.operations.geometry`.
38-
If the index type includes the grid kind,
44+
As the native index for a convention usually includes the grid kind,
3945
the grid kind needs to be JSON serializable.
4046
The easiest way to achieve this is to make your GridKind type subclass :class:`str`:
4147

@@ -59,6 +65,20 @@ the :class:`~emsarray.conventions.Convention` interface.
5965
this should be a tuple whos first element is :type:`.GridKind`.
6066
For conventions with a single grid, :type:`.GridKind` is not required.
6167

68+
Dimension conventions
69+
=====================
70+
71+
Most dataset conventions have grids that are uniquely identifiable by their dimensions.
72+
For these conventions the DimensionConvention subclass provides many default implementations.
73+
These details are most relevant for developers implementing new Convention subclasses.
74+
75+
.. autoclass:: emsarray.conventions.DimensionConvention
76+
77+
.. autoattribute:: grid_dimensions
78+
79+
.. autoclass:: emsarray.conventions.DimensionGrid
80+
:members: dimensions
81+
6282
.. autoclass:: emsarray.conventions.Specificity
6383
:members:
6484
:undoc-members:

docs/api/conventions/ugrid.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,11 @@ Indexing
1313
UGRID datasets have three :ref:`grids <grids>`: *face*, *edge* and *node*.
1414
:class:`UGridKind` represents this.
1515
Each grid is :ref:`indexed <indexing>` by a single integer.
16-
The convention native index type is :data:`UGridIndex`.
1716

1817
.. autoclass:: UGridKind
1918
:members:
2019
:undoc-members:
2120

22-
.. autodata:: UGridIndex
23-
2421
Topology
2522
========
2623

docs/api/plot.rst

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
emsarray.plot
33
=============
44

5-
.. currentmodule:: emsarray.plot
5+
.. module:: emsarray.plot
66

77
Plotting an entire figure
88
=========================
@@ -14,6 +14,15 @@ and have limited customisation options.
1414
Consult the :ref:`examples gallery <examples>`
1515
for demonstrations on making more customised plots.
1616

17+
The :ref:`examples <examples>` section contains many worked examples on how to generate plots.
18+
:ref:`example-plot-with-clim` is a good place to start.
19+
20+
Shortcuts
21+
=========
22+
23+
These functions will generate an entire plot,
24+
but have limited customisation options.
25+
1726
.. autofunction:: plot_on_figure
1827
.. autofunction:: animate_on_figure
1928

@@ -36,3 +45,36 @@ Utilities
3645
.. autofunction:: polygons_to_collection
3746
.. autofunction:: bounds_to_extent
3847
.. autofunction:: make_plot_title
48+
49+
Artist functions
50+
================
51+
52+
.. module:: emsarray.plot.artists
53+
54+
These functions will make a matplotlib :class:`~matplotlib.artist.Artist`
55+
that can plot variables directly from a support emsarray dataset.
56+
These functions and the associated artists can be imported from
57+
:mod:`emsarray.plot.artists`.
58+
59+
.. autofunction:: make_polygon_scalar_collection
60+
.. autofunction:: make_polygon_vector_quiver
61+
.. autofunction:: make_polygon_contour
62+
.. autofunction:: make_node_scalar_artist
63+
64+
Artists
65+
=======
66+
67+
.. autoclass:: GridArtist
68+
:members: set_data_array
69+
70+
.. autoclass:: PolygonScalarCollection
71+
:members: from_grid
72+
73+
.. autoclass:: PolygonVectorQuiver
74+
:members: from_grid
75+
76+
.. autoclass:: PolygonTriContourSet
77+
:members: from_grid
78+
79+
.. autoclass:: NodeTriMesh
80+
:members: from_grid

0 commit comments

Comments
 (0)