bayesflow-org / bayesflow

A Python library for amortized Bayesian workflows using generative neural networks.
https://bayesflow.org/
MIT License
372 stars 52 forks source link

Allow positional include args for FilterTransforms in Adapter #249

Open LarsKue opened 1 day ago

LarsKue commented 1 day ago

The following call will raise a confusing error:

a = bf.Adapter()
a.standardize("x")
>>> TypeError: Adapter.standardize() takes 1 positional argument but 2 were given

However, the intent is very clear: we only want to standardize x. The current way to do this is via an include list which is given as an explicit keyword argument:

a.standardize(include="x")

However, this seems a little bit ugly. We could allow users to pass this as a positional argument as well. So long as none of the keyword-only arguments are defined, we default to turning the positional argument into the include list.

paul-buerkner commented 1 day ago

I agree. makes sense to me.