30 modular linking between pyat and pyaml elements#32
Conversation
pyaml/lattice/famname_linker.py
Outdated
There was a problem hiding this comment.
Would it be possible to replace the FamNameElementsLinker by something like ElementsLinker("FamName") ?
So the default linker can be also used easliy to choose the pyAT attribute name to use.
I would except the attribute name in the ConfigModel with a default to FamName.
There was a problem hiding this comment.
Would it be possible to replace the FamNameElementsLinker by something like ElementsLinker("FamName") ?
I'm working on it. It's a bit tricky with the ConfModel...
I would except the attribute name in the ConfigModel with a default to
FamName.
I thought about that, but it's actually unnecessary since it behaves the same as not setting a linker at all.
There was a problem hiding this comment.
In the end, I can completly remove the FamNameElementsLinker, it's useless.
There was a problem hiding this comment.
In the end, I can completly remove the
FamNameElementsLinker, it's useless.
With a default ElementsLinker with FamName as default, yes FamNameElementsLinker become useless.
There was a problem hiding this comment.
Rename get_at_element() to get_first_at_element() ?
There was a problem hiding this comment.
The purpose of this method is to ensure unicity.
If you want the first of a group, you can just call get_at_elements()[0]
This method may be useless but it will depends of future developpements.
JeanLucPons
left a comment
There was a problem hiding this comment.
Make default linker configurable with the pyAT attribute name to use.
Isn't that the same as specifying the linker with attribute_linker and providing the desired name? |
… the FamName as attribute.
Your modification using: PyAtAttributeElementsLinker(PyAtAttrLinkerConfigModel(attribute_name="FamName"))is OK for me. |
Closes #30