Skip to content

Simplify subscription clip rules in the Subscriptions API SDK #1169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 24, 2025

Conversation

asonnenschein
Copy link
Contributor

This PR is intended for v3.0.0; it includes changes that will break v2.0.0. See #1162 for context.

Claude generated PR notes:

Summary of Changes

Problem Solved: Simplified subscription clip rules in the Subscriptions API SDK by removing the confusing dual code paths for clip functionality.

Changes Made:

  1. Removed clip_tool() method from planet/subscription_request.py (lines 641-673) - This method is no longer needed since custom clip AOIs are not supported in
    subscriptions.
  2. Simplified clip_to_source logic in build_request() method:
    - Changed from copying the source geometry ('aoi': source['parameters']['geometry']) to using empty parameters ('parameters': {})
    - This aligns with the API service contract where empty parameters automatically clip to subscription source geometry
  3. Updated documentation:
    - Updated docstring for clip_to_source parameter to reflect the simplified behavior
    - Updated SDK guide documentation to remove references to clip_tool() and mention that custom clip AOIs are no longer supported
  4. Updated tests:
    - Modified test expectations to check for empty parameters in clip tool configuration
    - Removed tests for the clip_tool() function
    - All existing tests continue to pass, ensuring backward compatibility for the clip_to_source functionality

API Impact:

  • The clip_to_source=True behavior remains unchanged from a user perspective
  • The clip_tool() method has been removed (breaking change, but appropriate for a 3.0.0 release)
  • Custom clip AOIs are no longer supported, simplifying the API

The implementation now has a single, clear code path for clipping: use clip_to_source=True to clip to the subscription source geometry, or clip_to_source=False
(default) for no clipping. This eliminates the previous confusion between clip_tool() and clip_to_source parameters.

@asonnenschein asonnenschein added this to the 3.0.0 Release milestone Jul 18, 2025
@asonnenschein asonnenschein requested a review from Copilot July 18, 2025 19:14
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR simplifies the subscription clip rules in the Subscriptions API SDK by removing support for custom clip AOIs and streamlining the clip-to-source functionality. The changes eliminate confusing dual code paths while maintaining backward compatibility for the clip_to_source=True behavior.

  • Removed the clip_tool() method since custom clip AOIs are no longer supported
  • Simplified clip-to-source implementation to use empty parameters instead of copying source geometry
  • Updated documentation and tests to reflect the streamlined API

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
planet/subscription_request.py Removed clip_tool() method and simplified clip-to-source logic to use empty parameters
tests/unit/test_subscription_request.py Updated test expectations for empty clip parameters and removed clip_tool tests
docs/python/sdk-guide.md Updated documentation to remove references to custom clip AOIs

@asonnenschein
Copy link
Contributor Author

Add note about breaking change to the 3.0 migration guide.

@asonnenschein asonnenschein changed the base branch from adrian/add-claude to main-3.0-dev July 23, 2025 19:58
@asonnenschein asonnenschein force-pushed the adrian/simplify-subs-clip-rules branch from a547f07 to 3338aa9 Compare July 24, 2025 13:19
@asonnenschein
Copy link
Contributor Author

Added bullet point about the v2 -> v3 breaking change in #1173.

@asonnenschein asonnenschein merged commit 4d3beef into main-3.0-dev Jul 24, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants