'Cadet' object has no attribute '_cadet_runner_class'

Hi,

I’m transitioning from MATLAB to python and facing some trouble.

I’ve been trying to run a trial simulation, taken from one of the jupyter-notebook tutorials on the CADET github. I can run it on jupyter lab, but when I use the code to build my own simulation in an IDE (Spyder), I run into trouble. I’m not sure why this should be, since we’re supposedly using the same cadet installation.

I’ve attached the minimum working code below. ‘cadet_model_test.py’ imports functions from the other file.

I face the following error at the cadet.run() step: (environment name is ‘env_cadet23’)

File ~/anaconda3/envs/env_cadet23/lib/python3.10/site-packages/spyder_kernels/py3compat.py:356 in compat_exec
exec(code, globals, locals)
File ~/Projects/CADET_projects/HIC_GSK/cadet_model_test.py:55
data = model.run()
File ~/anaconda3/envs/env_cadet23/lib/python3.10/site-packages/cadet/cadet.py:213 in run
data = self.cadet_runner.run(simulation=self.root.input, filename=self.filename, timeout=timeout, check=check)
File ~/anaconda3/envs/env_cadet23/lib/python3.10/site-packages/cadet/cadet.py:176 in cadet_runner
if self._cadet_runner_class is not None:
AttributeError: ‘Cadet’ object has no attribute ‘_cadet_runner_class’

System details:
Python: 3.10.12
Operating System: Ubuntu 20.04.5 LTS
Kernel: Linux 5.15.0-78-generic
Architecture: x86-64

cadet_.zip (2.2 KB)

Any help would be appreciated! Thanks.

Hi Soumi,

you need to specify Cadet.cadet_path as the system path to your cadet-cli.exe. I recommend adding this before the line
cadet_template = Cadet()

Best regards,
Jan

1 Like

Thank you! I understand now.

1 Like