MicroTCA-Tech-Lab / frugy

FRU Generator YAML

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The Fru class constructor modifies initdict

OlekTk opened this issue · comments

commented

I would like to initialize several Fru class instances from a common initialization dictionary (changing only the serial number in between). Unfortunately, after constructing the first Fru object, creating another one fails. Here is the minimal test case:

from frugy.fru import Fru

dict = {'MultirecordArea': [{'type': 'ModuleCurrentRequirements', 'current_draw': 4.0}]}

Fru(dict)
print("1st done")
Fru(dict)
print("2nd done")

After running it, I see "1st done" printed out, and then an exception is thrown before the second print.

Somehow the 'type' element gets removed from the initialization dictionary. I believe this was not an intended behavior.

Tested on version 0.4.0 installed by pip.

Best regards,
Aleksander from DMCS