Ensure MDBObjectMeta._find_existing() works
From @wjvriend
Als ik het SimulateRawScience notebook run in combinatie met de Oracle database dan loopt de code hier vast:
>>> mydetector = Detector() >>> mydetectorlist = [mydetector] >>> mydetectorarray = DetectorArray( ... name='testdetector', ... detector_array_list=mydetectorlist, ... exposure_action=myexposureaction, ... dark_current=DarkCurrent(value=2.0), ... shot_noise=ShotNoise(state=True), ... qecurve=QuantumEfficiencyCurve(realfilename="QE_detector_H2RG.dat"), ... linearity=LinearityCurve(realfilename="FPA_linearity.dat"), ... ) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/net/dataserver2/data/users/wjvriend/micado/miniconda3/envs/micadowise/lib/python3.9/site-packages/micado/main/MDBObjectMeta.py", line 226, in __call__ s = cls._construct_object_from_attributes(*args, **kwargs) File "/net/dataserver2/data/users/wjvriend/micado/miniconda3/envs/micadowise/lib/python3.9/site-packages/micado/main/MDBObjectMeta.py", line 618, in _construct_object_from_attributes s_existing = cls._find_existing(**kwargs) File "/net/dataserver2/data/users/wjvriend/micado/miniconda3/envs/micadowise/lib/python3.9/site-packages/micado/main/MDBObjectMeta.py", line 714, in _find_existing lenq = len(q) File "/net/dataserver2/data/users/wjvriend/micado/miniconda3/envs/micadowise/lib/python3.9/site-packages/common/database/DBOracleSelect.py", line 281, in __len__ return self._use_env_directives()._length() File "/net/dataserver2/data/users/wjvriend/micado/miniconda3/envs/micadowise/lib/python3.9/site-packages/common/database/DBOracleSelect.py", line 289, in _length return database.execute_select(query, *self.param, **kwargs)[0][0] File "/net/dataserver2/data/users/wjvriend/micado/miniconda3/envs/micadowise/lib/python3.9/site-packages/common/database/DatabaseOracle.py", line 184, in execute_select cursor.execute(query, args) cx_Oracle.DatabaseError: ORA-00904: "$"."detector_array_list": invalid identifier
Zover ik kan zien queried MDBObjectMeta._find_existing() voor een bestaand object. Alleen detector_array_list is een lijst van objecten, en niet een direct attribuut waar je met cls.name == value op kan querien.
Kan ik de tussenlaag die MDBObjectMeta implementeerd uitschakelen?