Closed gilesknap closed 2 weeks ago
NOTE: this is breaking the system test because it uses ioc-template-example and that in turn is using ibek-support which has not been updated to the new schema changes yet.
NEXT CALL: adding CI to ibek support that checks all of this so I can
Some notes on the remaining points to complete in this PR
@GDYendell after around 12 hours in a debugger it finally came out pretty in my opinion.
All jina rendering and reference to pre_defines and post_defines are all handled in the Entity model validator here: https://github.com/epics-containers/ibek/blob/2bd5cb3a9a32fa17195a0553597b4b88abc00882/src/ibek/ioc.py#L97-L122
(I think we eventually agreed that define may be used as a noun, right?)
I think this PR needs to be renamed "Refactor the world"
I think this PR needs to be renamed "Refactor the world"
Was just thinking what to call it.
But here is the cool bit.
Now this has only checked support yaml for those things we have actual IOC instances for but it is a very good cross-section.
@GDYendell
I have clarified the ID discussion as follows: https://github.com/epics-containers/ibek/blob/db46dbaef4ba1f77eaa96ee12eba29908d9df6b3/src/ibek/ioc.py#L124-L139 and https://github.com/epics-containers/ibek/blob/0043ef5a11a21a929311682c20dddb062cfcb94c/src/ibek/entity_model.py#L178-L190
This change allows us to more effectively use anchors and aliases to (multiple) inherit groups of parameters from other definitions or from shared fields.
Also includes a converter tool to convert support yaml and ioc yaml to work with the latest round of changes to ibek.
The names of the classes in the code have also been changed to reflect the name changes in the schema detailed below.
The schema changes are as follows:
defs
are nowentity_models
args
are nowparameters
parameters
are a dictionary of dictionaries instead of a list of dictionariesparameters
no longer have a name field as the key in the dictionary is the namevalues
is nowpost_defines
and is also a dictionary of dictionariespre_values
is nowpre_defines
and is also a dictionary of dictionaries__utils__
is now_global
_global
functions have changed:get_var
->get
set_var
->set
counter
->incrementor
_global.get(incrementorName)
Backward compatible changes:
pre_defines
andpost_defines
now may have optionaltype:
which defaults tostr
and may belist
(of Any),int
,float
,bool
entity_model
may have ashared:
field which is alist
ofAny
shared:
at the root levelshared:
are scratch areas in which to place anchors that can be referred to by aliases - and are therefore useful for placing repeating patterns (especially ofparameters
) and then using aliases where these repeats are required.