Catlab.jl icon indicating copy to clipboard operation
Catlab.jl copied to clipboard

Use uniform representation of schemas

Open olynch opened this issue 1 year ago • 1 comments

There should be a consistent data type for schemas. Right now, we have type-level schemas and value-level schemas. With the upcoming changes to the julia compiler, this should no longer be necessary. A schema should then be something that looks like the following.

(obs = (:E,:V), attrtypes=(:Weight), homs = (src=(:E,:V), tgt=(:E,:V)), attrs = (weight=(:E,:Weight)))

It has to be a namedtuple instead of a struct because then it can be stuck inside a type. There can also be a "dynamic" version, where obs and attrtypes are vectors and homs and attrs are dicts. Then we can get rid of the whole SchemaDesc, SchemaDescType, SchemaDescTypeType garbage.

olynch avatar Sep 06 '22 17:09 olynch

For reference, this feature will be enabled by PR https://github.com/JuliaLang/julia/pull/46300, which should land in Julia v1.9.

epatters avatar Sep 07 '22 20:09 epatters