Connectivity Class (AVD-1595)#3968
Conversation
| """ | ||
| A CF-UGRID topology connectivity, describing the topological relationship | ||
| between two lists of dimensional elements. One or more connectivities | ||
| make up a CF-UGRID topology - a constituent of a CF-UGRID mesh. |
There was a problem hiding this comment.
Not quite sure I agree on the description here...
The Connectivity is a definition (in terms of indices) of the interconnection between geometrical elements of a mesh, see here.
Could we make this doc-string a wee bit more specific to the role and purpose of Connectivity?
There was a problem hiding this comment.
I really struggled to come up with a decent description, any help is appreciated.
There was a problem hiding this comment.
@bjlittle please could you provide a suggestion for us to talk over? Thanks 🍺
There was a problem hiding this comment.
@trexfeathers This is good, but there are quite a few things to mull over and address. So let's discuss them together.
I'd also question whether we want to inherit all the behaviour of the _DimensionalMetadata class i.e., do we need a slimmer base class of _DimensionalMetadata and inherit from that instead.
I'd also question inheriting the _DimensionMetadata.__getitem__ behaviour, which copies the payload... perhaps we may want to consider avoiding such standard behaviour for all mesh like objects.
Also, we may want to consider moving all this functionality to iris.experimental.ugrid - but that's definately out of scope of this PR
|
Back to you @bjlittle 🙂 Thanks for all your helpful comments, I'm pleased with how things have come out. I've addressed everything except #3968 (comment), since we were planning to talk about this. I also haven't taken any actions on your general notes but there seems to be a general awareness of those anyway. |
|
@trexfeathers Awesome work, thanks for sticking with it 👍 💯 🎉 Let's see the utility of 🍻 |
|
Thanks @bjlittle, much appreciated!
I suppose that was my point - before we know the answer I'd rather make it explicit rather than implicit. |
🚀 Pull Request
Description
Adds the
Connectivityand accompanyingConnectivityMetadataclasses - the first of many steps to allow Iris' core data model to represent the CF-UGRID unstructured mesh format in addition to the existing CF structured grid format. Note this is targeting the newmesh-data-modelfeature branch.'Connectivity' name chosen since the most faithful interpretation of the UGRID conventions is that a topology is made up of one or more self-contained connectivities.
Implemented as another member of
iris.coords, sinceConnectivitybenefits from inheriting the majority of_DimensionalMetadata's functionality.Connectivitydeviates slightly from existing_DimensionalMetadatachildren:cube_dimsis just overridden withNotImplementedError.As such none of them have a
.settermethod, and either need a special method to modify or the user is expected to create a newConnectivitywith their new attribute values.indicesarray attribute are only meaningful subject to several requirements regardingshapeanddtype, soindicesis heavily validated whenever it is set.Consult Iris pull request check list