-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve configuration section merging of vectors #134
Comments
I understand the usefulness of what you propose, but I believe that it is basically the worst default behavior possible. Now, I also agree that the current behavior is very suboptimal - because very tricky. I guess that the rationale for it was to allow overriding some fields in an array without overriding the rest. If I was to change this behavior, I would go for always overriding the complete array. This is the only policy that allows the user to completely define its configuration in every situation, and therefore is definitely the best default option. Unfortunately, again, changing the behavior would very probably have strange effects on existing configuration systems. Having a graceful way to do these types of upgrade is on my todo list, but we all know how these things are sometimes. Making this configurable, while always seemingly sounding interesting, is IMO not a good idea in this case. The flexibility you are seeking would bring the whole YAML loader closer to a programmable configuration language. YAML (or XML, JSON, ...) is really not meant for this, thus implementing it would IMO make the whole system overly complex, and for existing, but relatively few, use-cases. Doing this kind of flexible stuff is best done in a higher level layer. In Syskit systems, we end up having these kind of flexible configurations (which are few in the end) done within the Syskit system itself (e.g. in ruby). |
I agree with you on the configurability.
|
It's not, unfortunately. Using What you just proposed makes. However, the use-case I feel is the most generally useful (at least, is the most useful for me :P) is not present:
I'm really feeling un-helpful here. I agree that the current behavior must be changed but as I said we still don't have ways to cleanly change this type of behavior "cleanly" (e.g. through policy files the way Ruby on Rails or CMake do it), which IMO makes it impossible to change right now. And we don't have the time here to finally implement this mechanism. My suggestion would be the following:
Or if you feel like investing some time implementing the policy system ;-) |
Currently, merging configuration sections with vectors results in an element-wise, recursive overwriting (or failure if overwrite=false). As a user, I would expect appending vector-like structures or a setting to select/define the behavior.
The recursive processing will also result in partial overwrites of elements of vectors within nested structures/maps, if the size differs.
I think it could be a useful feature for structuring more complex system configurations but needs improvement to be actually usable.
Example:
Consider applying the following configuration sections. If overwrite is enabled, you will end up with
joint_names: ["finger_1", "finger_2"]
, or a failure otherwise. Instead, I would expectjoint_names: ["joint_1", "joint_2", "finger_1", "finger_2"]
. In addition, you get a filter "f2", with coeffs5, 6, 3, 4
.The text was updated successfully, but these errors were encountered: