Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/aignostics/application/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ def application_describe( # noqa: C901, PLR0912


@run_app.command(name="execute")
def run_execute( # noqa: PLR0913
def run_execute( # noqa: PLR0913, PLR0917
application_id: Annotated[
str,
typer.Argument(help="Id of application version to execute."),
Expand Down Expand Up @@ -641,7 +641,7 @@ def run_prepare(


@run_app.command(name="upload")
def run_upload( # noqa: PLR0913
def run_upload( # noqa: PLR0913, PLR0917
application_id: Annotated[
str,
typer.Argument(help="Id of the application to upload data for. "),
Expand Down Expand Up @@ -754,7 +754,7 @@ def update_progress(bytes_uploaded: int, source: Path, platform_bucket_url: str)


@run_app.command("submit")
def run_submit( # noqa: PLR0913
def run_submit( # noqa: PLR0913, PLR0917
application_id: Annotated[
str,
typer.Argument(help="Id of the application to submit run for."),
Expand Down Expand Up @@ -889,7 +889,7 @@ def run_submit( # noqa: PLR0913


@run_app.command("list")
def run_list( # noqa: PLR0913
def run_list( # noqa: PLR0913, PLR0917
verbose: Annotated[bool, typer.Option(help="Show application details")] = False,
limit: Annotated[int | None, typer.Option(help="Maximum number of runs to display")] = None,
tags: Annotated[
Expand Down Expand Up @@ -1642,7 +1642,7 @@ def run_share_token_revoke(


@result_app.command("download")
def result_download( # noqa: C901, PLR0913, PLR0915
def result_download( # noqa: C901, PLR0913, PLR0915, PLR0917
run_id: Annotated[str, typer.Argument(..., help="Id of the run to download results for")],
destination_directory: Annotated[
Path,
Expand Down
6 changes: 3 additions & 3 deletions src/aignostics/application/_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def update_progress(
download_progress_queue.put_nowait(progress)


def download_available_items( # noqa: PLR0913
def download_available_items( # noqa: PLR0913, PLR0917
progress: DownloadProgress,
application_run: Run,
destination_directory: Path,
Expand Down Expand Up @@ -223,7 +223,7 @@ def download_available_items( # noqa: PLR0913
downloaded_items.add(item.external_id)


def download_item_artifact( # noqa: PLR0913
def download_item_artifact( # noqa: PLR0913, PLR0917
progress: DownloadProgress,
run: Run,
artifact: Any, # noqa: ANN401
Expand Down Expand Up @@ -285,7 +285,7 @@ def download_item_artifact( # noqa: PLR0913
)


def download_file_with_progress( # noqa: PLR0913
def download_file_with_progress( # noqa: PLR0913, PLR0917
progress: DownloadProgress,
signed_url: str,
artifact_path: Path,
Expand Down
2 changes: 1 addition & 1 deletion src/aignostics/application/_gui/_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class SearchInput:
_runs_last_refresh_time: datetime | None = None


async def _frame( # noqa: C901, PLR0913, PLR0915
async def _frame( # noqa: C901, PLR0913, PLR0915, PLR0917
navigation_title: str,
navigation_icon: str | None = None,
navigation_icon_color: str | None = None,
Expand Down
18 changes: 9 additions & 9 deletions src/aignostics/application/_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ def _apply_mappings_to_entry(entry: dict[str, Any], mappings: list[str]) -> None
Service._process_key_value_pair(entry, key_value, external_id)

@staticmethod
def generate_metadata_from_source_directory( # noqa: PLR0913
def generate_metadata_from_source_directory( # noqa: PLR0913, PLR0917
source_directory: Path,
application_id: str,
application_version: str | None = None,
Expand Down Expand Up @@ -432,7 +432,7 @@ def generate_metadata_from_source_directory( # noqa: PLR0913
raise RuntimeError(message) from e

@staticmethod
def application_run_upload( # noqa: PLR0913
def application_run_upload( # noqa: PLR0913, PLR0917
application_id: str,
metadata: list[dict[str, Any]],
application_version: str | None = None,
Expand Down Expand Up @@ -501,7 +501,7 @@ def application_run_upload( # noqa: PLR0913
open(source_file_path, "rb") as f,
):

def read_in_chunks( # noqa: PLR0913
def read_in_chunks( # noqa: PLR0913, PLR0917
external_id: str,
file_size: int,
upload_progress_queue: Any | None = None, # noqa: ANN401
Expand Down Expand Up @@ -535,7 +535,7 @@ def read_in_chunks( # noqa: PLR0913
return True

@staticmethod
def application_runs_static( # noqa: PLR0913
def application_runs_static( # noqa: PLR0913, PLR0917
application_id: str | None = None,
application_version: str | None = None,
external_id: str | None = None,
Expand Down Expand Up @@ -606,7 +606,7 @@ def application_runs_static( # noqa: PLR0913
)
]

def application_runs( # noqa: C901, PLR0912, PLR0913, PLR0915
def application_runs( # noqa: C901, PLR0912, PLR0913, PLR0915, PLR0917
self,
application_id: str | None = None,
application_version: str | None = None,
Expand Down Expand Up @@ -828,7 +828,7 @@ def application_run(self, run_id: str, share_token: str | None = None) -> Run:
logger.exception(message)
raise RuntimeError(message) from e

def application_run_submit_from_metadata( # noqa: PLR0913
def application_run_submit_from_metadata( # noqa: PLR0913, PLR0917
self,
application_id: str,
metadata: list[dict[str, Any]],
Expand Down Expand Up @@ -996,7 +996,7 @@ def application_run_submit_from_metadata( # noqa: PLR0913
logger.exception(message)
raise RuntimeError(message) from e

def application_run_submit( # noqa: PLR0913, PLR0912, C901, PLR0915
def application_run_submit( # noqa: PLR0913, PLR0912, C901, PLR0915, PLR0917
self,
application_id: str,
items: list[InputItem],
Expand Down Expand Up @@ -1629,7 +1629,7 @@ def application_run_revoke_share_token(self, run_id: str, share_token_id: str) -
raise NotFoundException(message)

@staticmethod
def application_run_download_static( # noqa: PLR0913
def application_run_download_static( # noqa: PLR0913, PLR0917
run_id: str,
destination_directory: Path,
create_subdirectory_for_run: bool = True,
Expand Down Expand Up @@ -1674,7 +1674,7 @@ def application_run_download_static( # noqa: PLR0913
download_progress_queue,
)

def application_run_download( # noqa: C901, PLR0912, PLR0913, PLR0915
def application_run_download( # noqa: C901, PLR0912, PLR0913, PLR0915, PLR0917
self,
run_id: str,
destination_directory: Path,
Expand Down
2 changes: 1 addition & 1 deletion src/aignostics/platform/resources/applications.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ def _prepare_document_request(
return endpoint_url, token_provider, ssl_verify, proxy

# Private helper; splitting params would require a thin DTO.
def _stream_document( # noqa: PLR0913
def _stream_document( # noqa: PLR0913, PLR0917
self,
url: str,
write_chunk: t.Callable[[bytes], object],
Expand Down
6 changes: 3 additions & 3 deletions src/aignostics/platform/resources/runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@ def __call__(self, run_id: str) -> Run:
"""
return Run(self._api, run_id)

def submit( # noqa: PLR0913
def submit( # noqa: PLR0913, PLR0917
self,
application_id: str,
items: list[ItemCreationRequest],
Expand Down Expand Up @@ -983,7 +983,7 @@ def submit( # noqa: PLR0913
operation_cache_clear() # Clear all caches since we added a new run
return Run(self._api, str(res.run_id))

def list( # noqa: PLR0913
def list( # noqa: PLR0913, PLR0917
self,
application_id: str | None = None,
application_version: str | None = None,
Expand Down Expand Up @@ -1031,7 +1031,7 @@ def list( # noqa: PLR0913
)
)

def list_data( # noqa: PLR0913
def list_data( # noqa: PLR0913, PLR0917
self,
application_id: str | None = None,
application_version: str | None = None,
Expand Down
4 changes: 2 additions & 2 deletions src/aignostics/qupath/_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ def get_installation_path() -> Path:
return Path(platformdirs.user_data_dir(__project_name__)).resolve()

@staticmethod
def _download_qupath( # noqa: C901, PLR0912, PLR0913, PLR0915
def _download_qupath( # noqa: C901, PLR0912, PLR0913, PLR0915, PLR0917
version: str,
path: Path,
platform_system: str | None = None,
Expand Down Expand Up @@ -759,7 +759,7 @@ def _extract_qupath( # noqa: C901, PLR0912, PLR0915
raise RuntimeError(message)

@staticmethod
def install_qupath( # noqa: PLR0913
def install_qupath( # noqa: PLR0913, PLR0917
version: str = QUPATH_VERSION,
path: Path | None = None,
reinstall: bool = True,
Expand Down
2 changes: 1 addition & 1 deletion src/aignostics/utils/_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def gui_register_pages() -> None:
page_builder.register_pages()


def gui_run( # noqa: PLR0913
def gui_run( # noqa: PLR0913, PLR0917
native: bool = True,
show: bool = False,
host: str | None = None,
Expand Down
7 changes: 4 additions & 3 deletions tests/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,10 @@ The decorator intercepts `nocache` and does not pass it to the wrapped function.
@cached_operation(ttl=60)
def f() -> int: ...

f() # populates cache
f() # cache hit, f not re-run
f(nocache=True) # re-runs f, refreshes cache

f() # populates cache
f() # cache hit, f not re-run
f(nocache=True) # re-runs f, refreshes cache
```

See `nocache_test.py` for the full decorator / client / edge-case coverage.
Expand Down
2 changes: 1 addition & 1 deletion tests/aignostics/application/cli_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1307,7 +1307,7 @@ def test_cli_run_result_delete_fails_on_no_arg(runner: CliRunner, record_propert
"""Check run result delete command runs successfully."""
record_property("tested-item-id", "SPEC-APPLICATION-SERVICE")
result = runner.invoke(cli, ["application", "run", "result", "delete"])
assert "Missing argument 'RUN_ID'." in normalize_output(result.stderr)
assert "Missing argument 'run_id'." in normalize_output(result.stderr)
assert result.exit_code == 2


Expand Down
2 changes: 1 addition & 1 deletion tests/aignostics/cli_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def test_cli_gui_run(runner: CliRunner, monkeypatch: pytest.MonkeyPatch) -> None
mock_register_pages_called = False
mock_app_mount_called = False

def mock_ui_run( # noqa: PLR0913
def mock_ui_run( # noqa: PLR0913, PLR0917
title="",
favicon="",
native=False,
Expand Down
6 changes: 3 additions & 3 deletions tests/aignostics/dataset/gui_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ async def test_gui_idc_downloads(user: User, tmp_path: Path, silent_logging: boo
)


async def _gui_idc_download_fails_with_invalid_inputs( # noqa: PLR0913
async def _gui_idc_download_fails_with_invalid_inputs( # noqa: PLR0913, PLR0917
user: User, tmpdir, source_input: str, expected_notification: str, silent_logging: None, record_property
) -> None:
"""Test that the download fails with appropriate notification."""
Expand Down Expand Up @@ -104,7 +104,7 @@ async def _gui_idc_download_fails_with_invalid_inputs( # noqa: PLR0913
],
)
@pytest.mark.timeout(timeout=60)
async def test_gui_idc_download_fails_with_no_inputs( # noqa: PLR0913
async def test_gui_idc_download_fails_with_no_inputs( # noqa: PLR0913, PLR0917
user: User, tmpdir, source_input: str, expected_notification: str, silent_logging: None, record_property
) -> None:
"""Test that the download fails with appropriate notification when no IDs are provided."""
Expand All @@ -130,7 +130,7 @@ async def test_gui_idc_download_fails_with_no_inputs( # noqa: PLR0913
),
],
)
async def test_gui_idc_download_fails_with_invalid_inputs( # noqa: PLR0913
async def test_gui_idc_download_fails_with_invalid_inputs( # noqa: PLR0913, PLR0917
user: User, tmpdir, source_input: str, expected_notification: str, silent_logging: None, record_property
) -> None:
"""Test that the download fails with appropriate notification when invalid IDs are provided."""
Expand Down
6 changes: 3 additions & 3 deletions tests/aignostics/platform/e2e_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
TEST_APP_STRESS_FIND_AND_VALIDATE_TIMEOUT_SECONDS = 60 * 60 # 60 minutes


def _build_wsi_input_item( # noqa: PLR0913
def _build_wsi_input_item( # noqa: PLR0913, PLR0917
gs_url: str,
crc32c: str,
width: int,
Expand Down Expand Up @@ -189,7 +189,7 @@ def _get_spots_payload_for_test_app(expires_seconds: int, count: int) -> list[pl
]


def _submit_and_validate( # noqa: PLR0913
def _submit_and_validate( # noqa: PLR0913, PLR0917
application_id: str,
application_version: str,
payload: list[platform.InputItem],
Expand Down Expand Up @@ -276,7 +276,7 @@ def _submit_and_validate( # noqa: PLR0913
return run


def _submit_and_wait( # noqa: PLR0913
def _submit_and_wait( # noqa: PLR0913, PLR0917
application_id: str,
application_version: str,
payload: list[platform.InputItem],
Expand Down
4 changes: 2 additions & 2 deletions tests/aignostics/qupath/gui_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ async def test_gui_qupath_install_only(
)
@pytest.mark.timeout(timeout=60 * 10)
@pytest.mark.sequential
async def test_gui_qupath_install_and_launch( # noqa: PLR0913
async def test_gui_qupath_install_and_launch( # noqa: PLR0913, PLR0917
user: User, runner: CliRunner, silent_logging: None, qupath_teardown, qupath_save_restore: None, record_property
) -> None:
"""Test that the user can install and launch QuPath via the GUI."""
Expand Down Expand Up @@ -143,7 +143,7 @@ async def test_gui_qupath_install_and_launch( # noqa: PLR0913
)
@pytest.mark.timeout(timeout=60 * 15)
@pytest.mark.sequential
async def test_gui_run_qupath_install_to_inspect( # noqa: C901, PLR0912, PLR0913, PLR0915
async def test_gui_run_qupath_install_to_inspect( # noqa: C901, PLR0912, PLR0913, PLR0915, PLR0917
user: User,
runner: CliRunner,
tmp_path: Path,
Expand Down
Loading
Loading