linkml-arrays chat #2020
Replies: 8 comments 25 replies
-
@rly i had this thought and wanted to jot it down rl quick and realized we didn't have a public meta-discussion place and so made this. ok so part of what i have been trying to puzzle about with the labeled arrays spec is the sort of 'unseatedness' of the label axes - that it is good that they can be declared independently, but it still feels like it would be an implementation and authorship challenge to keep track of the labeling/index dimensions as basically parallel slots/attrs to the main array slot. in trying to refactor the pydantic generator i got to thinking how nice it would be if we could just have a 1:1 map between metamodel properties and generator methods - if a slot has this prop, mutate the I think that these problems can be seen as the same problem - It's difficult to schematize "horizontal" relationships between things at the same level. Since linkml is recursively defined, where the metamodel is in the syntax of the schema, could the same syntax be used to schematize relationships between props as eg. relationship of the indexing dimensions to the array? just wanted to jot the thought down quickly without doing a full investigation of eg. existing ways it's possible to describe horizontal dependencies, but something as simple as a syntax like array:
modifies:
- range as a generic indication that "other things about this property or if it's specified with a dict, the value specifies the way that the interaction happens array:
modifies:
range: after so "array" is to be handled "after" the usual range computation - do everything else you would do normally, and then this one. so in the case of a generator, you would compute the range as normal, and then pass it in to the array method. and then the parameterized form (to complete the usual trirumvirate of array, array:
modifies:
range:
type: after
param1: whatever so eg. for generators, if a parameter had to specify it came in a specific order in a processing chain, etc. To know when a keyword is applicable, it could use the usual metamodel way of defining itself slots:
after:
is_a: linkml:modifier
domain:
- SlotExpression
- SlotDefinition and so then with the case of the labeled arrays you could have something like MyClass:
attributes:
values:
range: int
array:
index1:
range: TemperatureType
modifies:
values: indexes
# or
index2:
range: LatitudeType
modifies:
values:
type: indexes
dimension: 0
curie: # ... |
Beta Was this translation helpful? Give feedback.
-
First array representation just dropped, u can use it today! Guide: https://linkml.io/linkml/schemas/arrays.html this builds on the broader refresh of the pydantic generator and its templating system: https://linkml.io/linkml/generators/pydantic.html#templates more 2 come <3 |
Beta Was this translation helpful? Give feedback.
-
On the topic of how to define an array slot within a DataArray class as an array class instead of as a slot, so that one can
@cmungall and I thought about creating a simple, degenerate Array class that follows a particular pattern where exactly one attribute is an array. These classes would be identified using This raises an issue where it does not really make sense to put Open to thoughts and ideas! |
Beta Was this translation helpful? Give feedback.
-
Something to follow but is not totally relevant to this effort is the Python Array API standard: https://data-apis.org/array-api/latest/index.html Also potentially relevant is ZEP0004 on Zarr Conventions: zarr-developers/zarr-specs#262 |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
sorry for not responding earlier. I am not certain whether we are talking about the same thing. I mean to describe what each value of the transformation matrix means, the matrix when you have yx instead of xy looks different for example from the affine matrix when having xy. In any case with the transforms, usually the coordinate space is named and then transforms are described for how to get data in a particular coordinate system. |
Beta Was this translation helpful? Give feedback.
-
Returning to work partially, pushed an update to numpydantic that takes over control of the shape syntax (part of the longer term plan to get rid of nptyping and make a cleaner, more inspectable syntax) and adds shape ranges so annotations dont have to be so verbose: Should be able to pull the numpydantic generator early next week, really not much work at all since a lot of the work is done in the npd package. Then with that linkml arrays become extremely implementation general and ready to use in normal contexts where ppl are usually using array libraries instead of lists of lists. Some fun stuff in there like direct support for videos, and will be standing by to add in support for labeled arrays and an interface to xarray. |
Beta Was this translation helpful? Give feedback.
-
What is up arrays chat we got ourselves a new array representation and its a hoot and a half- linkml about to be able to hook into whatever the heck array library you want |
Beta Was this translation helpful? Give feedback.
-
Wanted to make a general discussion thread for linkml-arrays. as a meta-thread, let's try and use the in-post replies as much as possible to group conversations <3
plz edit this root post/propose edits to the root post as relevant.
Status
NDArrays
Labeled Arrays
linkml-arrays
has the current draftReferences
repo: https://github.com/linkml/linkml-arrays/
.. (lmk what else)
Beta Was this translation helpful? Give feedback.
All reactions