AttributeError when running check_cadet() method

Hi,

I am trying to follow the CADET Process workshop available on GitHub.

In … / 02.1.1_breakthrough.ipynb I run

simulator.check_cadet()

and get the following error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[10], line 1
----> 1 simulator.check_cadet()

File ~\AppData\Local\anaconda3\envs\cadet_workshop\Lib\site-packages\CADETProcess\simulator\cadetAdapter.py:319, in Cadet.check_cadet(self)
    316 data = cadet_model.run()
    317 os.remove(lwe_hdf5_path)
--> 319 if data.returncode == 0:
    320     flag = True
    321     print("Test simulation completed successfully")

AttributeError: 'ReturnInformation' object has no attribute 'returncode'

Additional details: Installed using conda and running in a JupyterLab notebook. I didn’t clone from github because I am on my company labtop (Windows 10 Enterprise) but I built the environment from the .yml file as recommended in the readme (copy of my env is in attachment). I have also tried the same on my personal Linux machine (Fedora 40) with the same result.

I already tried running as python script (.py file instead of running inside a iPython notebook) and also tried specifying the location of the cadet-cli executable wirh

simulator = Cadet(install_path=‘C:/Users/at1mad2/AppData/Local/anaconda3/pkgs/cadet-5.0.1-h6c8fd53_0/bin/cadet-cli.exe’)

but I still get the same error message.

Can someone help me finding out what is happening here? I guess I am making some error during the installation process, but I can’t solve it myself. Do I need to configure something in the cadet-cli before?

Thank you in advance,
Duarte Martins
environment-export.txt (5.5 KB)

1 Like

Hello,

thank you for the detailed and thorough report! I think you did everything right and this is a bug that we have fixed, but have not released in an update yet. Can you try running this command in your conda environment?
pip install git+https://github.com/fau-advanced-separations/CADET-Process.git@dev
This will install the current development version of CADET-Process and should fix that issue. If not, let me know and I’ll look more into it.

Best wishes,
Ron

1 Like

Hi Roland,

Thank you for quick answer.

I installed the dev branch as suggested in the same env however it did not fix the issue and the same issure remains. Just in case, I copied below the messages shown when I installed the dev version:

(cadet_workshop) C:\Users\at1mad2>pip install git+https://github.com/fau-advanced-separations/CADET-Process.git@dev
Collecting git+https://github.com/fau-advanced-separations/CADET-Process.git@dev
  Cloning https://github.com/fau-advanced-separations/CADET-Process.git (to revision dev) to c:\users\at1mad2\appdata\local\temp\pip-req-build-13d0zy3d
  Running command git clone --filter=blob:none --quiet https://github.com/fau-advanced-separations/CADET-Process.git 'C:\Users\at1mad2\AppData\Local\Temp\pip-req-build-13d0zy3d'
  Running command git checkout -b dev --track origin/dev
  branch 'dev' set up to track 'origin/dev'.
  Switched to a new branch 'dev'
  Resolved https://github.com/fau-advanced-separations/CADET-Process.git to commit 8384f14e2b49529cc92c47909a9e18b4bea8085d
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: addict==2.3 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from CADET-Process==0.9.1) (2.3.0)
Requirement already satisfied: cadet-python>=1.0 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from CADET-Process==0.9.1) (1.0.1)
Requirement already satisfied: corner>=2.2.1 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from CADET-Process==0.9.1) (2.2.3)
Requirement already satisfied: diskcache>=5.4.0 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from CADET-Process==0.9.1) (5.6.3)
Requirement already satisfied: hopsy>=1.4.0 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from CADET-Process==0.9.1) (1.5.2)
Requirement already satisfied: joblib>=1.3.0 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from CADET-Process==0.9.1) (1.4.2)
Requirement already satisfied: numpy>=1.21 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from CADET-Process==0.9.1) (1.26.4)
Requirement already satisfied: matplotlib>=3.4 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from CADET-Process==0.9.1) (3.9.2)
Requirement already satisfied: numba>=0.55.1 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from CADET-Process==0.9.1) (0.60.0)
Requirement already satisfied: pathos>=0.2.8 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from CADET-Process==0.9.1) (0.3.3)
Requirement already satisfied: psutil>=5.9.8 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from CADET-Process==0.9.1) (6.1.0)
Requirement already satisfied: pymoo>=0.6 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from CADET-Process==0.9.1) (0.6.1.3)
Requirement already satisfied: scipy>=1.11 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from CADET-Process==0.9.1) (1.14.1)
Requirement already satisfied: h5py in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from cadet-python>=1.0->CADET-Process==0.9.1) (3.12.1)
Requirement already satisfied: filelock in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from cadet-python>=1.0->CADET-Process==0.9.1) (3.16.1)
Requirement already satisfied: PolyRound>=0.2.10 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from hopsy>=1.4.0->CADET-Process==0.9.1) (0.3.0)
Requirement already satisfied: optlang>=1.7.0 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from hopsy>=1.4.0->CADET-Process==0.9.1) (1.8.2)
Requirement already satisfied: mcbackend in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from hopsy>=1.4.0->CADET-Process==0.9.1) (0.5.2)
Requirement already satisfied: pandas in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from hopsy>=1.4.0->CADET-Process==0.9.1) (2.2.3)
Requirement already satisfied: tqdm in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from hopsy>=1.4.0->CADET-Process==0.9.1) (4.67.1)
Requirement already satisfied: scikit-learn in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from hopsy>=1.4.0->CADET-Process==0.9.1) (1.5.2)
Requirement already satisfied: arviz in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from hopsy>=1.4.0->CADET-Process==0.9.1) (0.20.0)
Requirement already satisfied: contourpy>=1.0.1 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from matplotlib>=3.4->CADET-Process==0.9.1) (1.3.1)
Requirement already satisfied: cycler>=0.10 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from matplotlib>=3.4->CADET-Process==0.9.1) (0.12.1)
Requirement already satisfied: fonttools>=4.22.0 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from matplotlib>=3.4->CADET-Process==0.9.1) (4.55.0)
Requirement already satisfied: kiwisolver>=1.3.1 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from matplotlib>=3.4->CADET-Process==0.9.1) (1.4.7)
Requirement already satisfied: packaging>=20.0 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from matplotlib>=3.4->CADET-Process==0.9.1) (24.2)
Requirement already satisfied: pillow>=8 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from matplotlib>=3.4->CADET-Process==0.9.1) (11.0.0)
Requirement already satisfied: pyparsing>=2.3.1 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from matplotlib>=3.4->CADET-Process==0.9.1) (3.2.0)
Requirement already satisfied: python-dateutil>=2.7 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from matplotlib>=3.4->CADET-Process==0.9.1) (2.9.0.post0)
Requirement already satisfied: llvmlite<0.44,>=0.43.0dev0 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from numba>=0.55.1->CADET-Process==0.9.1) (0.43.0)
Requirement already satisfied: ppft>=1.7.6.9 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from pathos>=0.2.8->CADET-Process==0.9.1) (1.7.6.9)
Requirement already satisfied: dill>=0.3.9 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from pathos>=0.2.8->CADET-Process==0.9.1) (0.3.9)
Requirement already satisfied: pox>=0.3.5 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from pathos>=0.2.8->CADET-Process==0.9.1) (0.3.5)
Requirement already satisfied: multiprocess>=0.70.17 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from pathos>=0.2.8->CADET-Process==0.9.1) (0.70.17)
Requirement already satisfied: autograd>=1.4 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from pymoo>=0.6->CADET-Process==0.9.1) (1.7.0)
Requirement already satisfied: cma==3.2.2 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from pymoo>=0.6->CADET-Process==0.9.1) (3.2.2)
Requirement already satisfied: alive-progress in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from pymoo>=0.6->CADET-Process==0.9.1) (3.2.0)
Requirement already satisfied: Deprecated in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from pymoo>=0.6->CADET-Process==0.9.1) (1.2.15)
Requirement already satisfied: swiglpk>=5.0.8 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from optlang>=1.7.0->hopsy>=1.4.0->CADET-Process==0.9.1) (5.0.12)
Requirement already satisfied: sympy>=1.12.0 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from optlang>=1.7.0->hopsy>=1.4.0->CADET-Process==0.9.1) (1.13.3)
Requirement already satisfied: pytz>=2020.1 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from pandas->hopsy>=1.4.0->CADET-Process==0.9.1) (2024.2)
Requirement already satisfied: tzdata>=2022.7 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from pandas->hopsy>=1.4.0->CADET-Process==0.9.1) (2024.2)
Requirement already satisfied: six>=1.5 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from python-dateutil>=2.7->matplotlib>=3.4->CADET-Process==0.9.1) (1.16.0)
Requirement already satisfied: about-time==4.2.1 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from alive-progress->pymoo>=0.6->CADET-Process==0.9.1) (4.2.1)
Requirement already satisfied: grapheme==0.6.0 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from alive-progress->pymoo>=0.6->CADET-Process==0.9.1) (0.6.0)
Requirement already satisfied: setuptools>=60.0.0 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from arviz->hopsy>=1.4.0->CADET-Process==0.9.1) (75.6.0)
Requirement already satisfied: xarray>=2022.6.0 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from arviz->hopsy>=1.4.0->CADET-Process==0.9.1) (2024.11.0)
Requirement already satisfied: h5netcdf>=1.0.2 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from arviz->hopsy>=1.4.0->CADET-Process==0.9.1) (1.4.1)
Requirement already satisfied: typing-extensions>=4.1.0 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from arviz->hopsy>=1.4.0->CADET-Process==0.9.1) (4.12.2)
Requirement already satisfied: xarray-einstats>=0.3 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from arviz->hopsy>=1.4.0->CADET-Process==0.9.1) (0.8.0)
Requirement already satisfied: wrapt<2,>=1.10 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from Deprecated->pymoo>=0.6->CADET-Process==0.9.1) (1.17.0)
Requirement already satisfied: betterproto==2.0.0b6 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from mcbackend->hopsy>=1.4.0->CADET-Process==0.9.1) (2.0.0b6)
Requirement already satisfied: hagelkorn in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from mcbackend->hopsy>=1.4.0->CADET-Process==0.9.1) (1.2.3)
Requirement already satisfied: grpclib<0.5.0,>=0.4.1 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from betterproto==2.0.0b6->mcbackend->hopsy>=1.4.0->CADET-Process==0.9.1) (0.4.7)
Requirement already satisfied: threadpoolctl>=3.1.0 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from scikit-learn->hopsy>=1.4.0->CADET-Process==0.9.1) (3.5.0)
Requirement already satisfied: colorama in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from tqdm->hopsy>=1.4.0->CADET-Process==0.9.1) (0.4.6)
Requirement already satisfied: mpmath<1.4,>=1.1.0 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from sympy>=1.12.0->optlang>=1.7.0->hopsy>=1.4.0->CADET-Process==0.9.1) (1.3.0)
Requirement already satisfied: h2<5,>=3.1.0 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from grpclib<0.5.0,>=0.4.1->betterproto==2.0.0b6->mcbackend->hopsy>=1.4.0->CADET-Process==0.9.1) (4.1.0)
Requirement already satisfied: multidict in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from grpclib<0.5.0,>=0.4.1->betterproto==2.0.0b6->mcbackend->hopsy>=1.4.0->CADET-Process==0.9.1) (6.1.0)
Requirement already satisfied: hyperframe<7,>=6.0 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from h2<5,>=3.1.0->grpclib<0.5.0,>=0.4.1->betterproto==2.0.0b6->mcbackend->hopsy>=1.4.0->CADET-Process==0.9.1) (6.0.1)
Requirement already satisfied: hpack<5,>=4.0 in c:\users\at1mad2\appdata\local\anaconda3\envs\cadet_workshop\lib\site-packages (from h2<5,>=3.1.0->grpclib<0.5.0,>=0.4.1->betterproto==2.0.0b6->mcbackend->hopsy>=1.4.0->CADET-Process==0.9.1) (4.0.0)

I also noted that the version number of cadet-process did not change (neither did those of cadet and cadet-python) but I am note sure if that is relevant/expected as I am fairly inexperienced with git and version control.
I also tried running as .py script but with the same result.

Do you have a further suggestion?

Thank you again for the help.
Duarte

Hey,

if that’s the full output then it didn’t reinstall CADET-Process (because it was already installed).
Let’s try this again with
pip install git+https://github.com/fau-advanced-separations/CADET-Process.git@dev --force-reinstall --no-deps

hi,

I ran the force reinstall command you suggested above and got the following output:

(cadet_workshop) C:\Users\at1mad2>pip install git+https://github.com/fau-advanced-separations/CADET-Process.git@dev --force-reinstall --no-deps
Collecting git+https://github.com/fau-advanced-separations/CADET-Process.git@dev
  Cloning https://github.com/fau-advanced-separations/CADET-Process.git (to revision dev) to c:\users\at1mad2\appdata\local\temp\pip-req-build-zhuqa46g
  Running command git clone --filter=blob:none --quiet https://github.com/fau-advanced-separations/CADET-Process.git 'C:\Users\at1mad2\AppData\Local\Temp\pip-req-build-zhuqa46g'
  Running command git checkout -b dev --track origin/dev
  branch 'dev' set up to track 'origin/dev'.
  Switched to a new branch 'dev'
  Resolved https://github.com/fau-advanced-separations/CADET-Process.git to commit 8384f14e2b49529cc92c47909a9e18b4bea8085d
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: CADET-Process
  Building wheel for CADET-Process (pyproject.toml) ... done
  Created wheel for CADET-Process: filename=CADET_Process-0.9.1-py3-none-any.whl size=46249 sha256=6777f6ddea07dce0b4d4a780eb6cf63d8fffced339cb1f53bdb3ea3c360c8ed1
  Stored in directory: C:\Users\at1mad2\AppData\Local\Temp\pip-ephem-wheel-cache-sv7ogmmw\wheels\7f\39\3c\45357f9169a582bfd0e80a5f98bb719999797bf20e036dd5f7
Successfully built CADET-Process
Installing collected packages: CADET-Process
  Attempting uninstall: CADET-Process
    Found existing installation: CADET-Process 0.9.1
    Uninstalling CADET-Process-0.9.1:
      Successfully uninstalled CADET-Process-0.9.1
Successfully installed CADET-Process-0.9.1

however when I go back to workshop file I get a different error message at the very first import, more specifically while importing ComponentSystem, see below the details.

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[1], line 1
----> 1 from CADETProcess.processModel import ComponentSystem
      3 component_system = ComponentSystem(1)

File ~\AppData\Local\anaconda3\envs\cadet_workshop\Lib\site-packages\CADETProcess\__init__.py:20
     16 from .CADETProcessError import *
     18 from . import log
---> 20 from .settings import Settings
     22 settings = Settings()
     24 from . import sysinfo

File ~\AppData\Local\anaconda3\envs\cadet_workshop\Lib\site-packages\CADETProcess\settings.py:22
     19 import tempfile
     20 from warnings import warn
---> 22 from CADETProcess.dataStructure import Structure
     23 from CADETProcess.dataStructure import Bool, Switch
     26 __all__ = ['Settings']

ModuleNotFoundError: No module named 'CADETProcess.dataStructure'

can you advise me further?

thank you,
Duarte

Hi Duarte,

please excuse the current state of CADET-Process. We were very focussed on the release CADET-Core v5 and now we need to catch up in the higher level packages so we will have to ask for a bit of patience.

The latest issue you’re describing is related to this here: Dev branch pip install not working. An update will follow shortly.

1 Like

Hi Johannes,

I understand that. I will keep an eye on that post.

Thank you,
Duarte