Skip to content

Commit 9782d1f

Browse files
author
Stepheny Perez
authored
issue/161: Fix bug where --subset flag fails with data subscriber (#162)
* fix bug where the subset flag fails for subscriber * move arg validation to correct spot
1 parent c855903 commit 9782d1f

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
55

66
## [Unreleased]
77
### Fixed
8+
- Fixed bug where --subset in combination with the subscriber caused errors
89
### Added
910

1011
## [1.15.0]

subscriber/podaac_access.py

-7
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,6 @@ def validate(args):
221221
'Please specify exactly one flag '
222222
'from -dc, -dy, -dydoy, or -dymd')
223223

224-
if args.subset and args.search_cycles:
225-
# Cycle+Subset are not supported, because Harmony does not
226-
# currently accept Cycle.
227-
raise ValueError(
228-
'Error: Incompatible Parameters. You\'ve provided both cycles and subset, which is '
229-
'not allowed. Please provide either cycles or subset separately, but not both.')
230-
231224
if args.subset and args.bbox:
232225
bounds = list(map(float, args.bbox.split(',')))
233226
if bounds[0] > bounds[2]:

subscriber/podaac_data_downloader.py

+7
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ def validate(args):
4444
if None in [args.endDate, args.startDate] and args.search_cycles is None and args.granulename is None:
4545
raise ValueError(
4646
"Error parsing command line arguments: Both --start-date and --end-date must be specified") # noqa E50
47+
if args.subset and args.search_cycles:
48+
# Cycle+Subset are not supported, because Harmony does not
49+
# currently accept Cycle.
50+
raise ValueError(
51+
'Error: Incompatible Parameters. You\'ve provided both cycles and subset, which is '
52+
'not allowed. Please provide either cycles or subset separately, but not both.'
53+
)
4754

4855

4956
def create_parser():

0 commit comments

Comments
 (0)