upb-lea / transistordatabase

A unified software engineering tool for managing and evaluating power transistors
https://upb-lea.github.io/transistordatabase/
GNU General Public License v3.0
48 stars 10 forks source link

get_object_i_e_simplified and get_object_r_e_simplified were marked as staticmethod as a mistake #72

Closed gituser789 closed 2 years ago

gituser789 commented 2 years ago

Describe the bug get_object_i_e_simplified and get_object_r_e_simplified were marked as staticmethod, due to a compiler warning. But due to code() and compile(), the compiler was not able to detect that this is NOT a staticmethod.

To Reproduce

import transistordatabase as tdb

transistor1 = tdb.load('Fuji_2MBI300XBE120-50')
r_e_object = transistor1.get_object_r_e_simplified(e_on_off_rr="e_on",
                                      t_j=125,
                                      v_g=15,
                                      v_supply=600,
                                      normalize_t_to_v=10)

Expected behavior return the object what the user is looking for instead of error

Error Code

  File "databaseClasses.py", line 922, in get_object_r_e_simplified
    candidate_datasets = eval(code)
  File "<string>", line 1, in <module>
NameError: name 'self' is not defined

Desktop (please complete the following information):