Skip to content
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

Use of --subset with subscriber fails due to search_cycles check #161

Open
skorper opened this issue Mar 4, 2024 · 0 comments
Open

Use of --subset with subscriber fails due to search_cycles check #161

skorper opened this issue Mar 4, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@skorper
Copy link
Contributor

skorper commented Mar 4, 2024

As part of release 1.15.0, which contain the subsetting capability for both the subscriber and downloader, the following code is run on args for both the subscriber and downloader:

if args.subset and args.search_cycles:
# Cycle+Subset are not supported, because Harmony does not
# currently accept Cycle.
raise ValueError(
'Error: Incompatible Parameters. You\'ve provided both cycles and subset, which is '
'not allowed. Please provide either cycles or subset separately, but not both.')

This ensures a "search cycle" is not used in combination with the subsetting capability, as Harmony does not support subsetting by cycle.

There is a bug here, because only the downloader has search_cycle in its argparse namespaces. The subscriber does not support searching by cycle. This code is raising the following error:

[2024-02-20 14:48:46,166] {podaac_data_subscriber.py:402} ERROR - Uncaught exception occurred during execution.
Traceback (most recent call last):
  File "C:\Users\celiaou\Anaconda3\lib\site-packages\subscriber\podaac_data_subscriber.py", line 400, in main
    run()
  File "C:\Users\celiaou\Anaconda3\lib\site-packages\subscriber\podaac_data_subscriber.py", line 122, in run
    pa.validate(args)
  File "C:\Users\celiaou\Anaconda3\lib\site-packages\subscriber\podaac_access.py", line 224, in validate
    if args.subset and args.search_cycles:
AttributeError: 'Namespace' object has no attribute 'search_cycles'

This issue can be reproduced using the following command:

poetry run python3 subscriber/podaac_data_subscriber.py -c SWOT_L2_NALT_OGDR_SSHA_2.0 -d ./data --start-date 2023-12-01T00:00:00Z --end-date 2023-12-21T00:00:00Z --subset -b="120,-30,160,20"

We can fix this by simply moving the above check into the downloader only, and out of the common podaac_access validate function.

@skorper skorper added the bug Something isn't working label Mar 4, 2024
@skorper skorper self-assigned this Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant