Skip to content

Commit

Permalink
issue/161: Fix bug where --subset flag fails with data subscriber (#162)
Browse files Browse the repository at this point in the history
* fix bug where the subset flag fails for subscriber

* move arg validation to correct spot
  • Loading branch information
skorper authored Mar 7, 2024
1 parent c855903 commit 9782d1f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## [Unreleased]
### Fixed
- Fixed bug where --subset in combination with the subscriber caused errors
### Added

## [1.15.0]
Expand Down
7 changes: 0 additions & 7 deletions subscriber/podaac_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,6 @@ def validate(args):
'Please specify exactly one flag '
'from -dc, -dy, -dydoy, or -dymd')

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.')

if args.subset and args.bbox:
bounds = list(map(float, args.bbox.split(',')))
if bounds[0] > bounds[2]:
Expand Down
7 changes: 7 additions & 0 deletions subscriber/podaac_data_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ def validate(args):
if None in [args.endDate, args.startDate] and args.search_cycles is None and args.granulename is None:
raise ValueError(
"Error parsing command line arguments: Both --start-date and --end-date must be specified") # noqa E50
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.'
)


def create_parser():
Expand Down

0 comments on commit 9782d1f

Please sign in to comment.