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

Attach default experiment to a measurement #4956

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion qcodes/dataset/measurements.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@
from qcodes.dataset.descriptions.param_spec import ParamSpec, ParamSpecBase
from qcodes.dataset.descriptions.rundescriber import RunDescriber
from qcodes.dataset.descriptions.versioning.rundescribertypes import Shapes
from qcodes.dataset.experiment_container import Experiment
from qcodes.dataset.experiment_container import Experiment, load_experiment
from qcodes.dataset.experiment_settings import get_default_experiment_id
from qcodes.dataset.export_config import get_data_export_automatic
from qcodes.dataset.sqlite.database import conn_from_dbpath_or_conn
from qcodes.dataset.sqlite.query_helpers import VALUE
from qcodes.parameters import (
ArrayParameter,
Expand Down Expand Up @@ -709,6 +711,10 @@ def __init__(
self.enteractions: list[ActionType] = []
self.subscribers: list[SubscriberType] = []

if not exp:
exp = load_experiment(
get_default_experiment_id(conn_from_dbpath_or_conn(None, None))
)
self.experiment = exp
self.station = station
self.name = name
Expand Down