Replies: 2 comments 8 replies
|
I don't think I need |
1. EasyScienceYou mentioned that
What exactly does “as a backup strategy” mean here? How undo/redo stack is planned to be handled if 2. EasyDiffractionIn EasyDiffraction, I do not use The In this case, the corresponding unique names would be:
This gives me a natural way to serialize and deserialize data to and from CIF. It also makes debugging much easier because the names remain meaningful and domain-specific. For me, So, for diffraction, a non-CIF-based generic |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This question got recently raised by @damskii9992.
In the
EasySciencemodule it is probably a decent question, since not much functionality depends on explicitly using theunique_nameattribute. It is being used in:However, it is important to look at implementation in technique-specific libraries as well.
In reflectometry,
unique_nameis the internal object identifier used to keep ER objects, object-map entries, fitting parameters, and calculator-wrapper storage aligned.Obviously, it is not intended to be the user-facing display name.
The most important usage is in
The calculator creates backend materials, layers, assemblies, and models using
unique_nameas the dictionary key in wrapper storage. The refnx wrapper then stores objects under that key instorage['material'],storage['layer'],storage['item'], andstorage['model'].( calculator_base.py L56-L117, wrapper.py L28-L52 )
When a model receives an interface, it calls
generate_bindings(). Those bindings create the calculator-side objects and attachItemContainerlinks so parameter updates on EasyReflectometry objects can update the corresponding backend object.( model.py L181-L184, calculator_base.py L87-L117 )
User-facing names can repeat, but backend IDs must not collide. Constructors generate a new
unique_namewhen one is not supplied, so two objects both namedSiO2 layercan still be distinct internally.( material.py L57-L58], layer.py L65-L66, model.py L81-L82)
Parameter unique names are derived from the owning object's
unique_name, for examplef'{unique_name}_Thickness'orf'{unique_name}_Sld'. This makes individual parameters identifiable across fitting, serialization, summaries, and posterior analysis.(layer.py L69-L80, material.py L60-L72 )
Thus, in reflectometry, removing
unique_namewould require a significant amount of refactoring.All reactions