-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from qua-platform/hotfix_quam_state_path
Hotfix: active quam state is also updated when calling node.save
- Loading branch information
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import warnings | ||
from pathlib import Path | ||
from typing import Optional | ||
|
||
from qualibrate_config.models import QualibrateConfig | ||
|
||
|
||
def get_quam_state_path(config: QualibrateConfig) -> Optional[Path]: | ||
root = config.__class__._root | ||
if root is None: | ||
return None | ||
raw_config = root._raw_dict | ||
state_path = raw_config.get("quam", {}).get("state_path") | ||
if state_path is not None: | ||
return Path(state_path) | ||
am_path = raw_config.get("active_machine", {}).get("path") | ||
if am_path is None: | ||
return None | ||
warnings.warn( | ||
( | ||
'The config entry "active_machine.path" has been deprecated in ' | ||
'favor of "quam.state_path". Please update the qualibrate config ' | ||
"(~/.qualibrate/config.toml) accordingly." | ||
), | ||
DeprecationWarning, | ||
stacklevel=2, | ||
) | ||
return Path(am_path) |
This file contains 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