linkml / linkml-arrays

Support for loading and dumping N-dimensional arrays in LinkML.
https://linkml.github.io/linkml-arrays
BSD 3-Clause "New" or "Revised" License
5 stars 1 forks source link

add spatialdata testdata #10

Open melonora opened 7 months ago

melonora commented 7 months ago

This PR allows the generation of a SpatialData object at test time. This is done by using a pytest.fixture. Here, tmp_path is a fixture from _pytest.tmpdir.

It contains all the components currently present in SpatialData. More information here: github and scverse

SpatialData itself builds on top of OME-NGFF.

sneakers-the-rat commented 7 months ago

can we generate this with blobs().write() at test time so we can keep it up to date with however spatialdata may update its format as well?

also what is the fate of this package anyway? should format tests go in the main test suite or here? on the one hand gathering all the array tests here would be nice, on the other hand if we're doing the work in the main repo (rather than importing from here) this could get desync'd

melonora commented 7 months ago

This would be possible at test time as far as I am aware.

cmungall commented 7 months ago

@melonora do you want to modify the PR or make a new one?

melonora commented 7 months ago

I can modify the PR. Is it ok to add spatialdata as a dependency in order to create the files at test time?

cmungall commented 7 months ago

Adding as a test dependency should be fine

On Sat, Feb 24, 2024 at 4:12 AM Wouter-Michiel Vierdag < @.***> wrote:

I can modify the PR. Is it ok to add spatialdata as a dependency in order to create the files at test time?

— Reply to this email directly, view it on GitHub https://github.com/linkml/linkml-arrays/pull/10#issuecomment-1962344756, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAMMOMH5UQJC55GGMQRWY3YVHKJDAVCNFSM6AAAAABC4VREVCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRSGM2DINZVGY . You are receiving this because you commented.Message ID: @.***>

melonora commented 7 months ago

I am trying to update the PR, just with poetry resolving the dependencies seems to take forever. This does not seem to be due to a conflict arising. I already adjusted the python dependency to >=3.9,<3.13 to comply with the xarray requirements.

melonora commented 7 months ago

@cmungall I think this should be good to go now. I made it so that the data can be created on the fly by using a fixture. The demo test demonstrates this.

sneakers-the-rat commented 7 months ago

I like what im seeing here. Is the plan to use this repo for extended testing of the generators in the main linkml repo? Im mostly finished with the pure lists of lists implementation and am about to start the more advanced one that can hook into array libraries, and it would be cool to be testing on real data from a real format like this

melonora commented 7 months ago

I like what im seeing here. Is the plan to use this repo for extended testing of the generators in the main linkml repo? Im mostly finished with the pure lists of lists implementation and am about to start the more advanced one that can hook into array libraries, and it would be cool to be testing on real data from a real format like this

Would you like fixtures for the individual components as well? Because that can be added too.

sneakers-the-rat commented 7 months ago

Idk exactly what would be good yet, but will revisit when it's time to test the pydanticgen implementation of arrays