Skip to content

New element identifier method (names uniqueness) #14

@JeanLucPons

Description

@JeanLucPons

At the moment an element is identified by its repr method. It is not nice because in case of overloading it may fail. So an Element.get_id() -> str method is required.

# TODO: _repr_ is used for identifying element in various array. Use a get_id() method instead

It is used:

  • in the factory

name = str(elt)

  • in ControlSystem:

self.add_magnet(str(m),m)

self.add_magnet(str(e),e)

self.add_magnet(str(m),m)

  • In Simulator:

self.add_magnet(str(e),e)

self.add_magnet(str(e),e)

self.add_magnet(str(m),m)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions