Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qcodes v0.40.0 breaks pytest #55

Closed
grothe6 opened this issue Sep 20, 2023 · 3 comments · Fixed by #56
Closed

qcodes v0.40.0 breaks pytest #55

grothe6 opened this issue Sep 20, 2023 · 3 comments · Fixed by #56
Assignees
Labels
bug Something isn't working

Comments

@grothe6
Copy link
Contributor

grothe6 commented Sep 20, 2023

With qcodes v0.40.0, our CI (pytest) does not work any more.
PR #54 fixes this temporarily by restricting the qcodes version.

GH actions gives this error message:

Run coverage run -m pytest --junit-xml=test-results.xml src/tests
============================= test session starts ==============================
platform linux -- Python 3.11.5, pytest-7.4.2, pluggy-1.3.0
PyQt5 5.15.9 -- Qt runtime 5.15.2 -- Qt compiled 5.15.2
rootdir: /home/runner/work/QuMADA/QuMADA
configfile: pyproject.toml
plugins: cases-3.6.14, mock-3.11.1, xvfb-3.0.0, qt-4.2.0
collected 6 items / 1 error

==================================== ERRORS ====================================
__________________ ERROR collecting src/tests/mapping_test.py __________________
ImportError while importing test module '/home/runner/work/QuMADA/QuMADA/src/tests/mapping_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
src/tests/mapping_test.py:44: in <module>
    from qumada.measurement.scripts.generic_measurement import Generic_1D_Sweep
src/qumada/measurement/scripts/__init__.py:21: in <module>
    from .generic_measurement import (
src/qumada/measurement/scripts/generic_measurement.py:33: in <module>
    from qumada.measurement.doNd_enhanced.doNd_enhanced import (
src/qumada/measurement/doNd_enhanced/doNd_enhanced.py:44: in <module>
    from qcodes.dataset.dond.do_nd_utils import (
E   ImportError: cannot import name '_catch_interrupts' from 'qcodes.dataset.dond.do_nd_utils' (/opt/hostedtoolcache/Python/3.11.5/x64/lib/python3.11/site-packages/qcodes/dataset/dond/do_nd_utils.py)
----- generated xml file: /home/runner/work/QuMADA/QuMADA/test-results.xml -----
=========================== short test summary info ============================
ERROR src/tests/mapping_test.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 2.14s ===============================
Error: Process completed with exit code 2.
@grothe6 grothe6 self-assigned this Sep 20, 2023
@grothe6 grothe6 added the bug Something isn't working label Sep 20, 2023
@grothe6
Copy link
Contributor Author

grothe6 commented Sep 20, 2023

For qcodes 0.40.0 in qcodes.dataset.dond.do_nd_utils, _catch_interrupts gets renamed to catch_interrupts. This is imported and used in doNd_enhanced.py.

We could check the used qcodes version when importing or just require qcodes 0.40.0.

@grothe6
Copy link
Contributor Author

grothe6 commented Oct 13, 2023

Changelog from QCoDeS for 0.38.0 - 0.40.0:

QCoDeS 0.38.0 (2023-04-25)

Changelog

Breaking Changes:

  • The modules qcodes_loop.data, qcodes_loop.plots, qcodes_loop.actions, qcodes_loop.loops,
    qcodes_loop.measure, qcodes_loop.extensions.slack and qcodes_loop.utils.magic,
    qcodes_loop.utils.qt_helpers have been split out into a separate package qcodes_loop.
    The respective modules in QCoDeS do still exist as deprecated aliases to the new modules in qcodes_loop
    but will be removed in a future release. To use the aliases QCoDeS must be installed with the loop extra e.g.
    you should install pip install qcodes[loop]. If you make use of these modules we recommend updating imports
    to use qcodes_loop as soon as possible. See the readme of
    qcodes_loop for more information.

    The functions qcodes.utils.helpers.tprint qcodes.utils.helpers.wait_secs and
    qcodes.utils.helpers.foreground_qt_window have been removed.
    These helper functions are only used in qcodes_loop and were moved there. (Deprecate qcodes.data plot loops actions and measure microsoft/Qcodes#4971)

  • The default configuration of QCoDeS dataset GUID_components.GUID_type has changed from explicit_sample to random_sample.
    This means that QCoDeS GUIDs will no longer start with aaaaaaaa but with a random string. This significantly reduces the risk
    of duplicate GUIDs.
    This also means that that the ability to set a sample_id as part of the dataset GUID is disabled by default. With
    the default config its therefor an error to set GUID_components.sample to anything but the default value. The original
    behavior can be restored by setting GUID_components.GUID_type to explicit_sample in the config file but is not recommended.
    Users should make use of the sample_name attached to an experiment as an alternative. Note that if you have already created
    a local config you will need to update this for the changes to take effect. (Dataset: change default guid type to use a random str microsoft/Qcodes#5031)

Improved:

Improved Drivers:

New:

New Drivers:

QCoDeS 0.39.0 (2023-06-20)

Changelog

Note that this will be the last version to support Python 3.8. Please upgrade to at least
python 3.9.

Improved:

  • The in memory cache of a dataset can now be configured both from the qcodesrc.json config file and when using dond to perform measurements.
    The Exception raised when a dond, do1d etc. measurement is interrupted (BreakConditionInterrupt) has been made public as part of the
    qcodes.dataset module so it can be intercepted and handled by the user. (Make in memory cache configurable microsoft/Qcodes#5200)
  • When writing a DataSetInMem back to a database the exp_id, counter and run_id are correctly updated
    to reflect the sate of the new database. write_metadata_to_db has also been fixed to use
    the database passed to init of the DataSetInMem class if no path is provided. (Update run_id when adding ds in mem to db microsoft/Qcodes#5209)

Improved Drivers:

QCoDeS 0.40.0 (2023-09-14)

Changelog

Improved:

Improved Drivers:

New:

  • The QCoDeS Measurement Context manager, DataSaverBuilder and DoND functions have been instrumented as OpenTelemetry traces.
    This enables users to correlate log messages with the the measurement that they were performed within.
    See the OpenTelemetry documentation for examples of how this can be used.

    The log exporting using OpenCensus within QCoDeS is expected to be deprecated and eventually removed in line
    with OpenCensus being discontinued. Users that are interested in gathering telemetry of their setups are encouraged
    to provide their own solution based on OpenTelemetry. (Instrument Measurement and dond with opentelemetry microsoft/Qcodes#5289)

  • New features: datasaver_builder and dond_into are intermediate measurement extensions designed to fill a gap between
    the low-level Measurement object and the high-level doNd functions. They allow convenient specification of parameter
    dependencies for registration and doNd-like syntax while also allowing direct access to the underlying datasaver objects. (Add datasaver_builder and dond_core microsoft/Qcodes#5294)

@grothe6
Copy link
Contributor Author

grothe6 commented Oct 13, 2023

@THuckemann
I don't see anything immediately, that could break qumada in the new QCoDeS versions, do you?

There are some new features, that could benefit the metadata acquisition (namely guid helpers from 0.38.0)
Also, also the datasaver_builder and/or dond_into from 0.40.0 could be interesting to look at.

The in memory cache of a dataset can now be configured both from the qcodesrc.json config file and when using dond to perform measurements.
The Exception raised when a dond, do1d etc. measurement is interrupted (BreakConditionInterrupt) has been made public as part of the
qcodes.dataset module so it can be intercepted and handled by the user.

Could this be beneficial in any way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant