Skip to content

Commit 668526c

Browse files
committed
chore: Address comments
1 parent a05aeab commit 668526c

4 files changed

Lines changed: 109 additions & 10 deletions

File tree

CLI_REFERENCE.md

Lines changed: 104 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ $ aignostics application [OPTIONS] COMMAND [ARGS]...
145145
* `list`: List available applications.
146146
* `dump-schemata`: Output the input schema of the application...
147147
* `describe`: Describe application.
148+
* `version`: Inspect application versions and their release documents.
148149
* `run`: List, submit and manage application runs
149150

150151
### `aignostics application list`
@@ -204,6 +205,106 @@ $ aignostics application describe [OPTIONS] APPLICATION_ID
204205
* `--format TEXT`: Output format: 'text' (default) or 'json' [default: text]
205206
* `--help`: Show this message and exit.
206207

208+
### `aignostics application version`
209+
210+
Inspect application versions and their release documents.
211+
212+
**Usage**:
213+
214+
```console
215+
$ aignostics application version [OPTIONS] COMMAND [ARGS]...
216+
```
217+
218+
**Options**:
219+
220+
* `--help`: Show this message and exit.
221+
222+
**Commands**:
223+
224+
* `document`: List, describe, and download public release documents attached to an application version.
225+
226+
#### `aignostics application version document`
227+
228+
List, describe, and download public release documents attached to an application version (e.g. output schemas, model manuals).
229+
230+
**Usage**:
231+
232+
```console
233+
$ aignostics application version document [OPTIONS] COMMAND [ARGS]...
234+
```
235+
236+
**Options**:
237+
238+
* `--help`: Show this message and exit.
239+
240+
**Commands**:
241+
242+
* `list`: List public release documents attached to an application version.
243+
* `describe`: Show metadata for a single public release document.
244+
* `download`: Download a public release document to a local path.
245+
246+
##### `aignostics application version document list`
247+
248+
List public release documents attached to an application version.
249+
250+
**Usage**:
251+
252+
```console
253+
$ aignostics application version document list [OPTIONS] APPLICATION_ID
254+
```
255+
256+
**Arguments**:
257+
258+
* `APPLICATION_ID`: Id of application to list release documents for. [required]
259+
260+
**Options**:
261+
262+
* `--application-version TEXT`: Version of the application. If not provided, the latest version will be used.
263+
* `--format TEXT`: Output format: 'text' (default) or 'json' [default: text]
264+
* `--help`: Show this message and exit.
265+
266+
##### `aignostics application version document describe`
267+
268+
Show metadata for a single public release document.
269+
270+
**Usage**:
271+
272+
```console
273+
$ aignostics application version document describe [OPTIONS] APPLICATION_ID DOCUMENT_NAME
274+
```
275+
276+
**Arguments**:
277+
278+
* `APPLICATION_ID`: Id of application to describe release documents for. [required]
279+
* `DOCUMENT_NAME`: Document filename (e.g. 'output_description.pdf'). [required]
280+
281+
**Options**:
282+
283+
* `--application-version TEXT`: Version of the application. If not provided, the latest version will be used.
284+
* `--format TEXT`: Output format: 'text' (default) or 'json' [default: text]
285+
* `--help`: Show this message and exit.
286+
287+
##### `aignostics application version document download`
288+
289+
Download a public release document to a local path.
290+
291+
**Usage**:
292+
293+
```console
294+
$ aignostics application version document download [OPTIONS] APPLICATION_ID DOCUMENT_NAME
295+
```
296+
297+
**Arguments**:
298+
299+
* `APPLICATION_ID`: Id of application to download release documents for. [required]
300+
* `DOCUMENT_NAME`: Document filename (e.g. 'output_description.pdf'). [required]
301+
302+
**Options**:
303+
304+
* `--application-version TEXT`: Version of the application. If not provided, the latest version will be used.
305+
* `--output PATH`: Destination directory. Defaults to the current working directory. [default: (<current-working-directory>)]
306+
* `--help`: Show this message and exit.
307+
207308
### `aignostics application run`
208309

209310
List, submit and manage application runs
@@ -579,9 +680,9 @@ $ aignostics application run result download [OPTIONS] RUN_ID [DESTINATION_DIREC
579680
* `--create-subdirectory-for-run / --no-create-subdirectory-for-run`: Create a subdirectory for the results of the run in the destination directory [default: create-subdirectory-for-run]
580681
* `--create-subdirectory-per-item / --no-create-subdirectory-per-item`: Create a subdirectory per item in the destination directory [default: create-subdirectory-per-item]
581682
* `--wait-for-completion / --no-wait-for-completion`: Wait for run completion and download results incrementally [default: wait-for-completion]
582-
* `--qupath-project / --no-qupath-project`: Create a QuPath project referencing input slides and results.
583-
The QuPath project will be created in a subfolder of the destination directory.
584-
This option requires the QuPath extension for Launchpad: start the Launchpad with `uvx --with "aignostics" aignostics ...`
683+
* `--qupath-project / --no-qupath-project`: Create a QuPath project referencing input slides and results.
684+
The QuPath project will be created in a subfolder of the destination directory.
685+
This option requires the QuPath extension for Launchpad: start the Launchpad with `uvx --with "aignostics" aignostics ...`
585686
This options requires installation of the QuPath application: Run uvx --with "aignostics" aignostics qupath install [default: no-qupath-project]
586687
* `--help`: Show this message and exit.
587688

specifications/SPEC_PLATFORM_SERVICE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ class Documents:
349349
by ``requests`` and is therefore not forwarded to the storage backend.
350350
Returns the absolute path to the written file.
351351
352-
``destination`` must be an existing directory; the file is written as
352+
``destination`` must be a directory; the file is written as
353353
``{destination}/{document_name}``. The requested document name is the
354354
canonical filename and is used regardless of any ``Content-Disposition``
355355
served by the storage backend.

src/aignostics/platform/resources/applications.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -429,11 +429,7 @@ def download_to_path(self, document_name: str, destination: Path | str) -> Path:
429429
If ``destination`` is a directory, the file is written as
430430
``{destination}/{document_name}``; the requested document name is the canonical
431431
filename and is used regardless of any ``Content-Disposition`` served by the
432-
storage backend. If ``destination`` is a file path, the file is written there
433-
verbatim. Parent directories are created if they do not yet exist.
434-
435-
Document downloads do not carry a CRC32C checksum (unlike run artifacts);
436-
integrity is bounded by HTTPS transport and the signed-URL lifetime.
432+
storage backend. Parent directories are created if they do not yet exist.
437433
438434
Args:
439435
document_name (str): The document filename.
@@ -605,6 +601,8 @@ def _stream_document( # noqa: PLR0913, PLR0917
605601
raise ServiceException(status=HTTPStatus.SERVICE_UNAVAILABLE.value, reason="Request timed out") from e
606602
except requests.ConnectionError as e:
607603
raise ServiceException(status=HTTPStatus.SERVICE_UNAVAILABLE.value, reason="Connection failed") from e
604+
except requests.RequestException as e:
605+
raise ServiceException(status=HTTPStatus.SERVICE_UNAVAILABLE.value, reason="Request failed") from e
608606

609607
def read_content(self, document_name: str) -> bytes:
610608
"""Fetch a release document's raw content into memory.

tests/aignostics/platform/resources/applications_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ def test_documents_download_to_path_rejects_non_directory(documents: Documents,
344344
file_path = tmp_path / "some_file.pdf"
345345
file_path.write_bytes(b"content")
346346

347-
with pytest.raises(ValueError, match="must be a directory"):
347+
with pytest.raises(ValueError, match="is an existing file"):
348348
documents.download_to_path(DOCUMENT_OUTPUT_DESCRIPTION_PDF, file_path)
349349

350350

0 commit comments

Comments
 (0)