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

[Feature/podaac-6305] Fix issue with collections without perfect matching file names with granule ur's #180

Merged
merged 2 commits into from
Mar 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -12,10 +12,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
### Fixed
- **PODAAC-6303 (issues/167)**
- Fixed issue where -gr and -sd/-ed (temporal) cannot be used together as a query
- **PODAAC-6305 (issues/160)**
- Fixed issue when -gr and cycle are used together, and when sometimes the granule name is a subset of what's found in CMR (`SWOT_GPR_2PfP474_001_20230328_220206_20230328_225311` in `SWOT_GPR_2PfP474_002_20230328_225311_20230328_234417_swot`)
### Removed
- Removed python 3.7 from supported builds


## [1.15.2]
### Fixed
- Fixed bug where --subset in combination with the subscriber caused errors
10 changes: 7 additions & 3 deletions subscriber/podaac_access.py
Original file line number Diff line number Diff line change
@@ -293,15 +293,15 @@ def prepare_time_output(times, prefix, file, args, ts_shift):


def prepare_cycles_output(data_cycles, prefix, file):
""""
"""
Create output directory using OUTPUT_DIR/CYCLE_NUMBER
.update stored in OUTPUT_DIR/

Parameters
----------
data_cycles : list
list of tuples consisting of granule names and cycle numbers
prefix : string
prefix : string
prefix for output path, either custom output -d or short name
file : string
granule file name
@@ -311,8 +311,12 @@ def prepare_cycles_output(data_cycles, prefix, file):
write_path : string
string path to where granules will be written
"""
'''
for each 'data_cycles', build a list that contains the substring 'file' in the granule column,
and get the first tuple
'''
cycle_match = [
cycle for cycle in data_cycles if cycle[0] == splitext(basename(file))[0]
cycle for cycle in data_cycles if splitext(basename(file))[0] in cycle[0]
][0]
cycle_dir = "c" + cycle_match[1].zfill(4)
check_dir(join(prefix, cycle_dir))
1 change: 0 additions & 1 deletion tests/test_downloader_regression.py
Original file line number Diff line number Diff line change
@@ -123,4 +123,3 @@ def test_downloader_temporal_and_granule_together():
assert len([name for name in os.listdir('./TMP') if
os.path.isfile('./TMP/' + name) and "citation.txt" not in name]) == 2
shutil.rmtree('./TMP')
assert True