Skip to content

feat(dataset): expose ParamSpecBase from qcodes.dataset#8037

Open
officialasishkumar wants to merge 1 commit intomicrosoft:mainfrom
officialasishkumar:export_param_spec_base
Open

feat(dataset): expose ParamSpecBase from qcodes.dataset#8037
officialasishkumar wants to merge 1 commit intomicrosoft:mainfrom
officialasishkumar:export_param_spec_base

Conversation

@officialasishkumar
Copy link
Copy Markdown

Summary

Closes #7369.

ParamSpecBase is the base class used for building InterDependencies_ graphs on the public API surface, but until this change it was only importable from qcodes.parameters. qcodes.dataset.__init__ only re-exported the legacy ParamSpec class, which meant users following the documented dataset-centric entry points had to reach into qcodes.parameters to obtain it.

This PR re-exports ParamSpecBase from qcodes.dataset and adds it to __all__ so the public namespace matches the recommended usage.

  • Add ParamSpecBase to the re-exports in src/qcodes/dataset/__init__.py and __all__.
  • Add a regression test in tests/dataset/test_dependencies.py that pins the identity of the re-export and its membership in __all__.
  • Add a newsfragment.

Test plan

  • pytest tests/dataset/test_dependencies.py — 19 passed locally.
  • python -c "from qcodes.dataset import ParamSpecBase; from qcodes.parameters import ParamSpecBase as P; assert ParamSpecBase is P" succeeds.

``ParamSpecBase`` is the canonical base class used for building ``InterDependencies_``
graphs on the public API surface, but until now it was only importable from
:mod:`qcodes.parameters`, while :mod:`qcodes.dataset` only re-exported the legacy
:class:`~qcodes.dataset.descriptions.param_spec.ParamSpec` class. Users who followed
the documented dataset-centric entry points had to reach into ``qcodes.parameters``
to construct dependency graphs.

Re-export ``ParamSpecBase`` from ``qcodes.dataset`` and add it to ``__all__`` so the
public namespace matches the actual recommended usage. Adds a regression test that
pins both the re-export and its presence in ``__all__``.

Closes microsoft#7369

Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
@officialasishkumar officialasishkumar requested a review from a team as a code owner April 13, 2026 10:29
@jenshnielsen
Copy link
Copy Markdown
Collaborator

@officialasishkumar
Thansk for the contribution. However, ParamSpecBase is exported from qcodes.parameters where it is currently defined. This is because the dataset module depends on the parameters module which means that the parameters module cannot depend on the dataset module and ParamSpecBase is required in the parameters module. See https://microsoft.github.io/Qcodes/api/parameters/index.html#qcodes.parameters.ParamSpecBase

We normally only export the same symbol once.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

qcodes.dataset exports ParamSpec and not ParamSpecBase

2 participants