Skip to content

Review and address v0.8.0 milestone issues#476

Open
dotsdl wants to merge 4 commits intomainfrom
claude/v0.8.0-milestone-issues-QH6jy
Open

Review and address v0.8.0 milestone issues#476
dotsdl wants to merge 4 commits intomainfrom
claude/v0.8.0-milestone-issues-QH6jy

Conversation

@dotsdl
Copy link
Member

@dotsdl dotsdl commented Jan 9, 2026

Implements #474 by replacing the return_protocoldagresults boolean parameter with a new return_as parameter that accepts three string options:

  • 'ProtocolResult' (default): Returns aggregated ProtocolResult combining all successful ProtocolDAGResults via Transformation.gather()
  • 'ProtocolResults': Returns a list of individual ProtocolResults, one for each successful ProtocolDAGResult by calling gather([pdr]) on each
  • 'ProtocolDAGResults': Returns the raw list of ProtocolDAGResults

Changes:

  • Updated get_transformation_results() with new return_as parameter
  • Updated get_network_results() with new return_as parameter
  • Updated _get_network_results() helper to pass return_as
  • Added deprecation warning for return_protocoldagresults parameter
  • Added comprehensive tests for new functionality and backward compatibility
  • Updated type hints to reflect new return types

The old return_protocoldagresults parameter is maintained for backward compatibility but deprecated with a warning.

claude added 4 commits January 9, 2026 20:56
Implements #474 by replacing the `return_protocoldagresults` boolean
parameter with a new `return_as` parameter that accepts three string
options:

- 'ProtocolResult' (default): Returns aggregated ProtocolResult combining
  all successful ProtocolDAGResults via Transformation.gather()
- 'ProtocolResults': Returns a list of individual ProtocolResults, one
  for each successful ProtocolDAGResult by calling gather([pdr]) on each
- 'ProtocolDAGResults': Returns the raw list of ProtocolDAGResults

Changes:
- Updated get_transformation_results() with new return_as parameter
- Updated get_network_results() with new return_as parameter
- Updated _get_network_results() helper to pass return_as
- Added deprecation warning for return_protocoldagresults parameter
- Added comprehensive tests for new functionality and backward compatibility
- Updated type hints to reflect new return types

The old return_protocoldagresults parameter is maintained for backward
compatibility but deprecated with a warning.
Improves the API design by using a StrEnum instead of magic strings
for the return_as parameter, providing better IDE support, type safety,
and discoverability.

Changes:
- Added ResultFormat StrEnum with three values:
  - PROTOCOL_RESULT: Aggregated result (default)
  - PROTOCOL_RESULTS: Individual results per ProtocolDAGResult
  - PROTOCOL_DAG_RESULTS: Raw ProtocolDAGResults
- Updated method signatures to accept ResultFormat | Literal[str]
- Updated internal logic to handle both enum and string values
- Exported ResultFormat from both interface and top-level modules
- Updated docstrings to document enum usage
- Added comprehensive tests using enum values
- Maintained backward compatibility with string values

Users can now use:
- client.get_transformation_results(tf, return_as=ResultFormat.PROTOCOL_RESULTS)
- client.get_transformation_results(tf, return_as='ProtocolResults')

Both work identically, but the enum provides better developer experience
with autocomplete and type checking.
- Applied black formatting to client.py and test_client.py
- Added `from __future__ import annotations` to fix Sphinx autodoc
  issues with complex type hints (Literal and union types)

This ensures the docs build correctly and code follows project style.
Added blank lines before bullet lists in docstrings to fix
reStructuredText parsing errors in Sphinx documentation build.

This resolves the 'Unexpected indentation' and 'Block quote ends
without a blank line' errors from the docs build.
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