feat(dataset): expose ParamSpecBase from qcodes.dataset#8037
Open
officialasishkumar wants to merge 1 commit intomicrosoft:mainfrom
Open
feat(dataset): expose ParamSpecBase from qcodes.dataset#8037officialasishkumar wants to merge 1 commit intomicrosoft:mainfrom
officialasishkumar wants to merge 1 commit intomicrosoft:mainfrom
Conversation
``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>
Collaborator
|
@officialasishkumar We normally only export the same symbol once. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #7369.
ParamSpecBaseis the base class used for buildingInterDependencies_graphs on the public API surface, but until this change it was only importable fromqcodes.parameters.qcodes.dataset.__init__only re-exported the legacyParamSpecclass, which meant users following the documented dataset-centric entry points had to reach intoqcodes.parametersto obtain it.This PR re-exports
ParamSpecBasefromqcodes.datasetand adds it to__all__so the public namespace matches the recommended usage.ParamSpecBaseto the re-exports insrc/qcodes/dataset/__init__.pyand__all__.tests/dataset/test_dependencies.pythat pins the identity of the re-export and its membership in__all__.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.