The PandaHub.get_net_value_from_db method used the variable name "element" once for the type of element for which to look up a specified value ("load", "sgen", "bus", "trafo", etc.) and once for the MongoDB document retrieved from the database. This led to a TypeError when calling the method, as "element" was used to determine dtypes in line 895 after it went from being the element type to the db document. Fix this by determining dtypes prior to the DB query. Furthermore, rename the collection retrieved from the DB to "documents" and "document" for clarity, which is consistent with the implementation of ph.set_net_value_in_db.
The
PandaHub.get_net_value_from_db
method used the variable name "element" once for the type of element for which to look up a specified value ("load", "sgen", "bus", "trafo", etc.) and once for the MongoDB document retrieved from the database. This led to a TypeError when calling the method, as "element" was used to determinedtypes
in line 895 after it went from being the element type to the db document. Fix this by determining dtypes prior to the DB query. Furthermore, rename the collection retrieved from the DB to "documents" and "document" for clarity, which is consistent with the implementation ofph.set_net_value_in_db
.