stanfordLINQS / SQcircuit

Superconducting quantum circuit analyzer
BSD 3-Clause "New" or "Revised" License
43 stars 7 forks source link

[Bug report] loop_description fails due to misspelling of id_str for loops? #3

Closed zachparrott closed 2 years ago

zachparrott commented 2 years ago

loop_description() fails due to changed attribute name for id_str.

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Input In [139], in <cell line: 1>()
----> 1 cr.loop_description()

File ~\Miniconda3\envs\scq\lib\site-packages\SQcircuit\circuit.py:732, in Circuit.loop_description(self)
    727 """
    728 Print out the external flux distribution over inductive elements.
    729 """
    731 # maximum length of element ID strings
--> 732 nr = max([len(el.idStr) for _, el in self.indElemLst])
    734 # maximum length of loop ID strings
    735 nh = max([len(lp.idStr) for lp in self.loops])

File ~\Miniconda3\envs\scq\lib\site-packages\SQcircuit\circuit.py:732, in <listcomp>(.0)
    727 """
    728 Print out the external flux distribution over inductive elements.
    729 """
    731 # maximum length of element ID strings
--> 732 nr = max([len(el.idStr) for _, el in self.indElemLst])
    734 # maximum length of loop ID strings
    735 nh = max([len(lp.idStr) for lp in self.loops])

AttributeError: 'Junction' object has no attribute 'idStr'

Seems the variable used to be called idStr and changed to id_str but not updated in circuit/loop_description()

https://github.com/stanfordLINQS/SQcircuit/blob/751160dd4045afc1a45515f758841127d1e6d847/SQcircuit/circuit.py#L732-L751

taha1373 commented 2 years ago

Thanks a lot @zachparrott! I will fix this ASAP in the next patch!(0.0.11)