Skip to content

subscriptions: make source type optional for planetary_variable_source function #1125

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

charcey
Copy link
Contributor

@charcey charcey commented Apr 30, 2025

In draft mode until the next major release is cut!

Related Issue(s):

Closes #

Proposed Changes:

For inclusion in changelog (if applicable):

  1. planetary_variable_source constructor doesn't require var_type at all. If using planetary_variable_source please refer to the new function signature here.

Not intended for changelog:

  1. Added a test

Diff of User Interface
Previously changes were made to make source type optional. However, in the planetary_variable_source definition, var_type is still required though allowed to be null. This MR changes that such that var_type need not be included at all. This does reorder input arguments, so users should reference the release notes.

Old behavior:

pv_source = planetary_variable_source(
    var_type=None,
    var_id="SWC-AMSR2-X_V5.0_1000",
    start_time=datetime.fromisoformat("2022-12-07T00:00:00Z"),
    end_time=datetime.fromisoformat("2022-12-16T00:00:00Z"),
    geometry={
        "coordinates": [
            [
                [139.56481933, 35.42374884],
                [140.10314941, 35.42374884],
                [140.10314941, 35.77102915],
                [139.56481933, 35.77102915],
                [139.56481933, 35.42374884],
            ]
        ],
        "type": "Polygon",
    },
)

New behavior:

pv_source = planetary_variable_source(
    start_time=datetime.fromisoformat("2022-12-07T00:00:00Z"),
    end_time=datetime.fromisoformat("2022-12-16T00:00:00Z"),
    geometry={
        "coordinates": [
            [
                [139.56481933, 35.42374884],
                [140.10314941, 35.42374884],
                [140.10314941, 35.77102915],
                [139.56481933, 35.77102915],
                [139.56481933, 35.42374884],
            ]
        ],
        "type": "Polygon",
    },
)

PR Checklist:

  • This PR is as small and focused as possible
  • If this PR includes proposed changes for inclusion in the changelog, the title of this PR summarizes those changes and is ready for inclusion in the Changelog.
  • I have updated docstrings for function changes and docs in the 'docs' folder for user interface / behavior changes
  • This PR does not break any examples or I have updated them

(Optional) @mentions for Notifications:

@charcey charcey marked this pull request as draft April 30, 2025 18:13
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.

1 participant