funsor
funsor copied to clipboard
Replace __call__-only FunsorMeta subclasses with a _fill_defaults method
A number of funsor.terms.Funsor
subclasses include custom metaclasses derived from FunsorMeta
that only implement __call__
and whose only purpose is to fill in default values of optional arguments and convert them to funsors.
In the interest of simplifying Funsor code conceptually and making it easier to onboard new contributors, it would be good to replace these metaclasses where possible with a new classmethod
_fill_defaults
of Funsor
subclasses that serves the same purpsoe and is invoked in FunsorMeta.__call__
.
List of cases:
- [ ]
NumberMeta
- [ ]
SubsMeta
- [ ]
SliceMeta
- [ ]
CatMeta
- [ ]
ResultMeta
infunsor.factory
- others?