Skip to content

High-level Client with Image Handling etc.#5

Merged
snus-kin merged 24 commits into
mainfrom
feature/image
Sep 5, 2025
Merged

High-level Client with Image Handling etc.#5
snus-kin merged 24 commits into
mainfrom
feature/image

Conversation

@snus-kin

@snus-kin snus-kin commented Aug 13, 2025

Copy link
Copy Markdown
Contributor

This pull request introduces a new async-enabled Athena client library for image classification, including a modular pipeline for image preprocessing, compression, batching, and classification. It also adds example usage, developer documentation, and improves test coverage reporting. The changes are grouped below by theme.

Core Athena Client Implementation:

  • Added AthenaClient class with async methods for image classification, supporting context management and error handling (src/athena_client/client/athena_client.py).
  • Introduced AthenaOptions dataclass for client configuration, including host, deployment, batching, and transformation options (src/athena_client/client/athena_options.py).
  • Added secure channel creation utility supporting token authentication (src/athena_client/client/channel.py).
  • Implemented deployment selector for listing available model deployments (src/athena_client/client/deployment_selector.py).
  • Defined custom exception classes for error handling (src/athena_client/client/exceptions.py).

Async Image Processing Pipeline:

  • Added abstract async transformer base class for pipeline middleware (src/athena_client/client/transformers/async_transfomer.py).
  • Implemented image resizing middleware to ensure expected dimensions (src/athena_client/client/transformers/image_resizer.py).
  • Added Brotli compression middleware for image data (src/athena_client/client/transformers/brotli_compressor.py).
  • Created transformer for converting image bytes to classification inputs (src/athena_client/client/transformers/classification_input.py).
  • Implemented request batcher for grouping classification inputs into requests (src/athena_client/client/transformers/request_batcher.py).

Documentation and Examples:

  • Added an example script demonstrating async classification and usage of the client (examples/example.py).
  • Expanded README.md with TODOs for async pipelines and correlation ID strategies.
  • Added module docstrings and documentation for transformers and tests (src/athena_client/client/__init__.py, src/athena_client/client/transformers/__init__.py, tests/transformers/__init__.py) [1] [2] [3].

Build and Test Improvements:

  • Enhanced test workflow to report coverage and post coverage comments in CI (.github/workflows/build_and_test.yml).
  • Added pytest-cov to dev dependencies and updated Python dependencies for async/image processing (pyproject.toml).
  • Improved dev tooling configuration for virtual environments and type checking (pyproject.toml).

Constants and Utilities:

  • Added constants for expected image dimensions used by the classifier (src/athena_client/client/consts.py).

These changes collectively establish a robust, extensible async client for Athena image classification and lay the groundwork for future pipeline enhancements and developer usability.

This comment was marked as outdated.

- Implement async transformers for image resizing, compression, and
classification input conversion - Add request batching middleware for
ClassifyRequest streaming - Add tests for async transformers and
batching logic - Update dependencies: add anyio, brotli, numpy,
pytest-cov - Update .gitignore for .env files - Add coverage reporting
to CI workflow - Document async pipeline and correlation ID TODOs in
README
@github-actions

github-actions Bot commented Aug 13, 2025

Copy link
Copy Markdown

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/athena_client/client
   athena_client.py1112082%116–128, 235–242, 261–285, 291–292, 298–299
   channel.py85989%99–100, 105–106, 163–164, 180–182
   correlation.py20195%36
   deployment_selector.py23387%75, 91–92
src/athena_client/client/transformers
   async_transformer.py15287%38–39
   request_batcher.py76791%53, 61, 88, 104, 120, 141–142
TOTAL5014292% 

Tests Skipped Failures Errors Time
100 0 💤 0 ❌ 0 🔥 1.925s ⏱️

@snus-kin snus-kin requested a review from Copilot August 19, 2025 08:32

This comment was marked as outdated.

@snus-kin snus-kin requested a review from Copilot August 27, 2025 10:22

This comment was marked as outdated.

@snus-kin snus-kin requested a review from Copilot September 5, 2025 11:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request introduces a comprehensive async-enabled Athena client library for image classification, featuring OAuth authentication, image processing pipeline, and streaming capabilities. The implementation provides a high-level interface while maintaining extensibility through modular components.

Key changes include:

  • OAuth credential helper with automatic token refresh and secure channel creation
  • Async image processing pipeline with resizing, compression, and format conversion transformers
  • Comprehensive test suite with mock utilities and enhanced CI/CD coverage reporting

Reviewed Changes

Copilot reviewed 65 out of 74 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/athena_client/client/athena_client.py Main client class with async context management and streaming classification
src/athena_client/client/channel.py OAuth credential helper and secure channel creation utilities
src/athena_client/client/transformers/ Modular async pipeline with image resizing, compression, and batching
tests/ Comprehensive test coverage with mock utilities and timeout behavior tests
examples/ Working examples demonstrating OAuth authentication and image processing
docs/ Complete documentation with API reference, examples, and development guides

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/athena_client/grpc_wrappers/classifier_service.py
@snus-kin snus-kin merged commit 88cd0d2 into main Sep 5, 2025
3 checks passed
@iwillspeak iwillspeak deleted the feature/image branch February 12, 2026 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants