Make ComponentField
and PartialComponent
support self
argument in lambda
#135
Labels
feature
New feature or request
Feature motivation
Let's assume I have an extended model that takes an existing model (both models are zookeeper factories) and adds a bunch of layers on top. The most straightforward way to do this would be as follows:
However, this raises
because the lambda function passed to
base_model
is not allowed to have any arguments. This is problematic, because it simply needs to access the existing model, which is an attribute of the surrounding task. It is also not possible to define this as a property, becauseComponentField
cannot be used to decorate properties.For now, I simply have to make the base model a
ComponentField
in theExtendModel
class, and rely on zookeeper to properly configure it from the surroundingExperiment
class, but it looks a bit confusing.Feature description
It would be very useful if
ComponentField
detects whether the argument to the lambda function isself
, and passes the correct value if this is the case.The text was updated successfully, but these errors were encountered: