fractal-analytics-platform / fractal-tasks-core

Main tasks for the Fractal analytics platform
https://fractal-analytics-platform.github.io/fractal-tasks-core/
BSD 3-Clause "New" or "Revised" License
12 stars 6 forks source link

De-duplicate Pydantic models in `lib_channels.py` and `lib_ngff.py` #540

Open tcompa opened 10 months ago

tcompa commented 10 months ago

Likely the solution will be to import models from lib_ngff.py into lib_channels.py, and then add/override methods or attributes (e.g. as in Channel and FractalChannel(Channel)). The goal is clearly to avoid having two definitions of the same model.

Also: functions like get_channel_from_image_zarr should probably become methods of the appropriate object (NgffImageMeta, if they are sufficiently general).

Ideally this should not lead to any change of existing JSON Schemas.