Can I combine a custom schema registry with functions schemas ? This does not work:
{:malli/schema
[:function
{:registry malli/malli-registry}
[:=>
[:cat
[:sequential [:or vector? fn?]]
[:sequential [:map {:closed true}
[:split-uid {:optional true} string?]
[:train [:fn dataset?]]
[:test {:optional true} [:fn dataset?]]]]
fn?
[:enum :accuracy :loss]]
:scicloj.metamorph.ml/optimize-hyperparas--evaluation-result]
where
malli/malli-registry
is a custom 'compound registryI gen an "invalid schema" exception, when instrumenting the function
I don't think you can use Registry objects as :registry. https://github.com/metosin/malli/issues/913
You should add : and its deps to the global registry instead https://github.com/metosin/malli#changing-the-default-registry
Or if it doesn't have IntoSchema's and you're not in CLJS you can probably try {:registry (mr/-schemas malli/malli-registry)}.
Another common solution is to define malli-registry as data like (def malli-registry {::foo int?, ::bar :any}) then plug it in wherever it needs to go. Uses more memory tho.