Skip to content

HHChannel: uninitialized gates show up in wildcardFind and cause silent crash when accessed #503

Open
@subhacom

Description

@subhacom

Even when any of the Xpower/Ypower/Zpower is not set, so that the actual gate object does not exist, all three show up as children of the HHChannel.
One can access the child gate with moose.element(f'{channel.path}/{gateName}'). One can even access its name field. But attempt to access any other field results in a silent crash.

Example for reproducing:

In [1]: import moose

In [2]: ch = moose.HHChannel('ch')

In [3]: moose.le(ch)
Elements under /ch[0]
    /ch[0]/gateX
    /ch[0]/gateY
    /ch[0]/gateZ

Out[3]: ['/ch[0]/gateX', '/ch[0]/gateY', '/ch[0]/gateZ']

In [4]: gate = moose.element(f'{ch.path}/gateX')

In [5]: gate
Out[5]: <moose.HHGate id=487 dataIndex=0 path=/ch[0]/gateX[0]>

In [6]: gate.name
Out[6]: 'gateX'

In [7]: gate.min

Metadata

Metadata

Assignees

No one assigned

    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