Skip to content

Commit 129ea0f

Browse files
committed
fix: remove top-level parameter descriptions from capabilities
1 parent 12c40cb commit 129ea0f

File tree

7 files changed

+10
-19
lines changed

7 files changed

+10
-19
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ All notable changes to this project are documented in this file.
1010
### Changed
1111
- Updated `docs/release_private_index.md` to list required pre-release verification commands: `ruff check .`, `black --check .`, `mypy nanonis_qcodes_controller`, `pytest`, and `python -m build`.
1212
- Expanded distribution readiness documentation and release tracking with concrete private-index release verification notes.
13-
- Updated `nqctl capabilities` to expose rich `parameters.items[*]` metadata (`get_cmd`, `set_cmd`, validators, safety, descriptions) for agent-driven planning of `get`/`set`/`ramp`.
14-
- Updated `nqctl capabilities` to omit empty `description` fields and fall back to non-empty command descriptions when top-level parameter descriptions are missing.
13+
- Updated `nqctl capabilities` to expose rich `parameters.items[*]` metadata (`get_cmd`, `set_cmd`, validators, safety) for agent-driven planning of `get`/`set`/`ramp`.
14+
- Updated `nqctl capabilities` to remove top-level parameter `description` output and keep descriptions on `get_cmd`/`set_cmd` only.
1515
- Updated GitHub-release install examples in `README.md` to use `<version>` placeholders.

docs/cli_contract.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ Expose a small, stable command surface that orchestration agents can call direct
55

66
## Core commands
77
- `nqctl capabilities`: returns parameters/actions/policy summary, including rich
8-
`parameters.items[*]` metadata (`get_cmd`, `set_cmd`, `vals`, `safety`, non-empty descriptions)
9-
for agent planning.
8+
`parameters.items[*]` metadata (`get_cmd`, `set_cmd`, `vals`, `safety`) for
9+
agent planning. Descriptions are exposed on `get_cmd`/`set_cmd` when present.
1010
- `nqctl observables list`: returns readable and writable parameter metadata.
1111
- `nqctl actions list`: returns supported action descriptors.
1212
- `nqctl get <parameter>`: reads one parameter value.

nanonis_qcodes_controller/cli.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,14 +1242,6 @@ def _collect_parameter_capabilities(instrument: Any) -> list[dict[str, Any]]:
12421242
"safety": safety,
12431243
}
12441244

1245-
description = _optional_text(spec.description)
1246-
if description is None and get_cmd is not None:
1247-
description = _optional_text(get_cmd.get("description"))
1248-
if description is None and set_cmd is not None:
1249-
description = _optional_text(set_cmd.get("description"))
1250-
if description is not None:
1251-
capability["description"] = description
1252-
12531245
capabilities.append(capability)
12541246
return capabilities
12551247

nanonis_qcodes_controller/resources/config/parameters.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7881,8 +7881,6 @@ parameters:
78817881
label: Zspectr Retractsecond
78827882
unit: ''
78837883
type: int
7884-
description: Configuration for the Second condition of Auto Retract in the
7885-
Z-Spectroscopy module.
78867884
get_cmd:
78877885
command: ZSpectr_RetractSecondGet
78887886
payload_index: 0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.1.2"
1+
__version__ = "0.1.3"

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "nanonis-qcodes-controller"
7-
version = "0.1.2"
7+
version = "0.1.3"
88
description = "Simulator-first bridge between Nanonis SPM and QCodes"
99
readme = "README.md"
1010
requires-python = ">=3.10"

tests/test_cli.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def fake_print_payload(payload, *, as_json: bool) -> None:
129129
assert isinstance(items, list)
130130
parameter = items[0]
131131
assert parameter["name"] == "bias_v"
132-
assert parameter["description"] == "Tip-sample bias voltage."
132+
assert "description" not in parameter
133133
assert parameter["get_cmd"]["command"] == "Bias.Get"
134134
assert parameter["get_cmd"]["description"] == "Read configured bias voltage."
135135
assert parameter["get_cmd"]["args"] == {"channel": 1}
@@ -139,7 +139,7 @@ def fake_print_payload(payload, *, as_json: bool) -> None:
139139
assert parameter["vals"]["kind"] == "numbers"
140140

141141

142-
def test_capabilities_falls_back_to_command_description_and_drops_empty_fields(monkeypatch) -> None:
142+
def test_capabilities_drops_top_level_description_and_empty_nested_fields(monkeypatch) -> None:
143143
spec = ParameterSpec(
144144
name="zspectr_retractsecond",
145145
label="Zspectr Retractsecond",
@@ -211,7 +211,8 @@ def fake_print_payload(payload, *, as_json: bool) -> None:
211211
items = parameters_payload["items"]
212212
assert isinstance(items, list)
213213
parameter = items[0]
214-
assert parameter["description"] == (
214+
assert "description" not in parameter
215+
assert parameter["get_cmd"]["description"] == (
215216
"Returns the configuration for the Second condition of the Auto Retract "
216217
"in the Z-Spectroscopy module."
217218
)

0 commit comments

Comments
 (0)