DiCarloLab-Delft / PycQED_py3

Python3 version of PycQED using QCoDeS as backend
MIT License
68 stars 41 forks source link

Upgrade to Python 3.7 #692

Closed wvlothuizen closed 1 year ago

wvlothuizen commented 2 years ago

Python 3.6 has reached end-of-life (see https://www.python.org/downloads/release/python-366/), and only supports old versions of QCoDes. So we should move on, note that CI already tests on 3.7 in addition to 3.6

wvlothuizen commented 2 years ago

Note that 3.7 also had its final release already (https://peps.python.org/pep-0537/), so further upgrades are needed

wvlothuizen commented 2 years ago

Also see https://github.com/DiCarloLab-Delft/UserEnv/pull/54

MiguelSMoreira commented 2 years ago

@MiniSean could we consider briefly testing these updates on the Aprilia setup with some standard measurement routines?

MiniSean commented 2 years ago

@MiguelSMoreira yes definitely! This is the perfect time to update on Aprillia since we are warm this week. Should be cold and operational upcoming Monday. Let us establish a baseline in the form of some standard measurements and then work on testing the updates. Pretty much all other packages are already updated beyond 3.6 so that shouldn't pose any problems.

MiniSean commented 2 years ago

Using virtual environment at python 3.7.9 to test updates on Aprilia setup (pycqed version: 24572d4)

Progress report (requirements installation): Pre-run pip install qutip as suggested by requirements.txt. (Successful installation of version 4.7.0) Succesfully installed all requirements except:

Instead, run pip install qutechopenql --verbose --verbose --verbose --no-index -f https://github.com/DiCarloLab-Delft/OpenQL/releases as suggested by requirements.txt

While running this installation, hit the following error:

The conflict is caused by: qutechopenql 0.10.4 depends on msvc-runtime; platform_system == "Windows" qutechopenql 0.10.3 depends on msvc-runtime; platform_system == "Windows" qutechopenql 0.10.2 depends on msvc-runtime; platform_system == "Windows" To fix this you could try to:

  1. loosen the range of package versions you've specified
  2. remove package versions to allow pip attempt to solve the dependency conflict

Is this a known issue or does this require a newer version of VS build tools? (currently running version 2017)

wvlothuizen commented 2 years ago

IIRC, a pip install msvc-runtime will do (although I must say that I don't understand the conflict implied in the error message).

Otherwise, maybe try replacing pip install qutechopenql by pip install qutechopenql==0.10.4 (older versions make little sense anyway)

MiniSean commented 2 years ago

Simply pip install msvc-runtime did the trick indeed. Followed by the pip install qutechopenql --verbose --verbose --verbose --no-index -f https://github.com/DiCarloLab-Delft/OpenQL/releases successfully installs version 0.10.4.

Continuing with:

AssertionError: b'*RST\nSTATus:PRESet\n*CLS\nwlist:waveform:dele[163 chars]C?\n' != b'*RST\r\nSTATus:PRESet\r\n*CLS\r\nwlist:wavefor[185 chars]\r\n'

The failure originates from comparing two *.txt files by the read_bytes() method. The created text files from the test are virtually identical, but differ in the fact that one of them includes \r (carriage return) sign. I don't expect this to be an actual issue for creating SCPI files as instruments will likely skip signatures like '\r', '\n', etc. I also doubt this is python 3.7 related.

wvlothuizen commented 2 years ago

This is indeed an existing 'issue' that Windows and Unix disagree on line endings. The actual instrument accepts both flavours

MiniSean commented 2 years ago

Majority of test cases now pass (400 passed, 57 skipped, 5 xfailed). As expected there are quite some deprecation warnings which we can address later. Once Aprilia is back cold I will run a couple of basic experiments to try and catch any 3.7-related problems. Pushed changes to 043a515 (Sorry @MiguelSMoreira, your credentials were apparently still active on Aprilia. Should be replaced with my own now.)

wvlothuizen commented 2 years ago

I recently fixed some tests, pulling branch 'develop' may improve the test score