In the spirit of creating lightweight interface-defining packages (see TuringLang/Bijectors.jl#199 which resulted in InverseFunctions.jl and ChangesOfVariables.jl):
While adding an interface-test utility to ChangesOfVariables.jl today, I needed a helper function _to_realvec_and_back - which does exactly what ParameterHandling.flatten does. And I needed it for exactly what #27 is requesting. :-)
It would be nice not to reinvent this, but ParameterHandling would of course be way to heavy a dependency for ChangesOfVariables - and even if it wasn't, we'd end up with a circular dependency since Bijectors will use ChangesOfVariables soon, so ParameterHandling will too.
I think the flatten/unflatten functionality of ParameterHandling does something very fundamental, and is orthogonal to it's variable transformation capabilities. Would you consider splitting it out into a lightweight package (basically the contents of flatten.jl)?
A truly lightweight recursive flatten/unflatten interface package could IMHO find use in many places in the ecosystem. flatten may be a bit too generic a name for the function (we probably have several flattens in the ecosystem), but how about flatten_and_back or so?
CC @willtebbutt, @paschermayr, @devmotion
Update: ChangesOfVariables.test_with_logabsdet_jacobian now has an additional optional argument to pass a transformation, which solves the dependency problem. Users will be able to use ParameterHandling for variable transformations during the test without a direct dependency between the two packages (after #27 is solved).
In the spirit of creating lightweight interface-defining packages (see TuringLang/Bijectors.jl#199 which resulted in InverseFunctions.jl and ChangesOfVariables.jl):
While adding an interface-test utility to ChangesOfVariables.jl today, I needed a helper function _to_realvec_and_back - which does exactly what
ParameterHandling.flattendoes. And I needed it for exactly what #27 is requesting. :-)It would be nice not to reinvent this, but
ParameterHandlingwould of course be way to heavy a dependency forChangesOfVariables- and even if it wasn't, we'd end up with a circular dependency sinceBijectorswill useChangesOfVariablessoon, soParameterHandlingwill too.I think the flatten/unflatten functionality of
ParameterHandlingdoes something very fundamental, and is orthogonal to it's variable transformation capabilities. Would you consider splitting it out into a lightweight package (basically the contents offlatten.jl)?A truly lightweight recursive flatten/unflatten interface package could IMHO find use in many places in the ecosystem.
flattenmay be a bit too generic a name for the function (we probably have severalflattens in the ecosystem), but how aboutflatten_and_backor so?CC @willtebbutt, @paschermayr, @devmotion
Update:
ChangesOfVariables.test_with_logabsdet_jacobiannow has an additional optional argument to pass a transformation, which solves the dependency problem. Users will be able to use ParameterHandling for variable transformations during the test without a direct dependency between the two packages (after #27 is solved).