You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When merging multiple configurations it would be nice (arguably expected) if interpolated values were treated as lazily as possible - i.e. values are only interpolated at the last possible moment, enabling the source value to be modified by other configs. Currently merging happens from the left, and expansion is performed immediately on update to a child, so updates to "parent" values do not affect later interpolations.
An example with a motivating case when this might arise:
I believe this can be implemented in a manner still consistent with the right-to-left precedence of overwritten keys as long as there are no reference loops. A simple algorithm would partially merge configs from left-to-right while deferring and retaining any merges to interpolated values. Then interpolated value sources would be expanded one-by-one in order by topologically sorted dependency. Any deferred merges to that interpolated value would be applied left-to-right. This would proceed through the topological order until all interpolated values are expanded and updated.
I'll readily admit this is a complex utilization / desire, but if the semantics of what I describe are well-defined (as I believe they are) I think it would be preferred to the current behavior of eager expansion.
Apologies if this has been discussed elsewhere - I was unable to find anything.
Thanks!
Additional context
OmegaConf version: 2.3.0
Python version: 3.9.19
Operating system: Mac
The text was updated successfully, but these errors were encountered:
When merging multiple configurations it would be nice (arguably expected) if interpolated values were treated as lazily as possible - i.e. values are only interpolated at the last possible moment, enabling the source value to be modified by other configs. Currently merging happens from the left, and expansion is performed immediately on update to a child, so updates to "parent" values do not affect later interpolations.
An example with a motivating case when this might arise:
This is also not solvable with a simple reordering - see e.g.:
I believe this can be implemented in a manner still consistent with the right-to-left precedence of overwritten keys as long as there are no reference loops. A simple algorithm would partially merge configs from left-to-right while deferring and retaining any merges to interpolated values. Then interpolated value sources would be expanded one-by-one in order by topologically sorted dependency. Any deferred merges to that interpolated value would be applied left-to-right. This would proceed through the topological order until all interpolated values are expanded and updated.
I'll readily admit this is a complex utilization / desire, but if the semantics of what I describe are well-defined (as I believe they are) I think it would be preferred to the current behavior of eager expansion.
Apologies if this has been discussed elsewhere - I was unable to find anything.
Thanks!
Additional context
The text was updated successfully, but these errors were encountered: