Skip to content

Commit

Permalink
🎨 Remove base directories Repository and Archive (close #48)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelrpl committed Aug 11, 2021
1 parent 8fdb821 commit 9ed10b6
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion bdc_collectors/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def path(self, collection: Collection, prefix=None) -> Path:

year_month = sensing_date.strftime('%Y-%m')

scene_path = Path(prefix or '') / 'Repository/Archive' / collection.name / year_month / self.parser.tile_id()
scene_path = Path(prefix or '') / collection.name / year_month / self.parser.tile_id()

scene_path = scene_path / self.parser.scene_id

Expand Down
2 changes: 1 addition & 1 deletion bdc_collectors/dgi/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def path(self, collection: Collection, prefix=None) -> Path:

version = 'v{0:03d}'.format(collection.version)

scene_path = Path(prefix or '') / 'Repository/Archive' / collection.name / version / year_month
scene_path = Path(prefix or '') / collection.name / version / year_month

return scene_path

Expand Down
5 changes: 1 addition & 4 deletions bdc_collectors/modis/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ def path(self, collection: Collection, prefix=None, cube_prefix=None) -> Path:

relative = Path(collection.name) / version / tile[:3] / tile[3:] / year / scene_id

if cube_prefix is None:
cube_prefix = 'Mosaic' if collection.collection_type == 'cube' else 'Archive'

scene_path = Path(prefix or '') / f'Repository/{cube_prefix}' / relative
scene_path = Path(prefix or '') / relative

return scene_path

Expand Down
4 changes: 2 additions & 2 deletions bdc_collectors/scihub/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def compressed_file(self, collection, prefix=None):

relative = Path(collection.name) / version / tile[:2] / tile[2] / tile[3:] / year / scene_id

scene_path = Path(prefix or '') / 'Repository/Archive' / relative
scene_path = Path(prefix or '') / relative

return scene_path / f'{scene_id}.zip'

Expand All @@ -95,7 +95,7 @@ def path(self, collection: Collection, prefix=None) -> Path:

relative = Path(collection.name) / version / tile[:2] / tile[2] / tile[3:] / year / self.parser.scene_id

scene_path = Path(prefix or '') / 'Repository/Archive' / relative
scene_path = Path(prefix or '') / relative

return scene_path

Expand Down
4 changes: 2 additions & 2 deletions bdc_collectors/usgs/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def _path(self, collection: Collection, prefix=None) -> Path:

path, row = tile_id[:3], tile_id[-3:]

scene_path = base / 'Repository/Archive' / collection.name / version / path / row / year / scene_id
scene_path = base / collection.name / version / path / row / year / scene_id

return scene_path

Expand Down Expand Up @@ -97,7 +97,7 @@ def path(self, collection: Collection, prefix=None) -> Path:

year_month = sensing_date.strftime('%Y-%m')

scene_path = Path(prefix or '') / 'Repository/Archive' / collection.name / year_month / self.parser.tile_id()
scene_path = Path(prefix or '') / collection.name / year_month / self.parser.tile_id()

return scene_path

Expand Down

0 comments on commit 9ed10b6

Please sign in to comment.