-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from GEOSYS/dev
build(release) : v0.0.1
- Loading branch information
Showing
15 changed files
with
918 additions
and
297 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from . import earthdatastore, datasets | ||
|
||
__version__ = "0.0.1-rc9" | ||
__version__ = "0.0.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 8 additions & 5 deletions
13
earthdaily/earthdatastore/cube_utils/asset_mapper/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
earthdaily/earthdatastore/cube_utils/asset_mapper/__update_asset_mapper_config_json.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Created on Fri Dec 15 09:03:08 2023 | ||
@author: nkk | ||
""" | ||
|
||
import earthdaily | ||
import json | ||
|
||
eds = earthdaily.earthdatastore.Auth() | ||
asset_mapper_path = ( | ||
earthdaily.earthdatastore.cube_utils.asset_mapper.__asset_mapper_config_path | ||
) | ||
asset_mapper_config = ( | ||
earthdaily.earthdatastore.cube_utils.asset_mapper.__asset_mapper_config | ||
) | ||
|
||
for collection in eds.explore(): | ||
try: | ||
assets_name = list(eds.explore(collection).item.assets.keys()) | ||
except AttributeError: | ||
print(f"collection {collection} has no items") | ||
continue | ||
for asset_name in assets_name: | ||
if asset_mapper_config.get(collection) is None: | ||
asset_mapper_config[collection] = [{}] | ||
if asset_name not in asset_mapper_config[collection][0].values(): | ||
asset_mapper_config[collection][0][asset_name] = asset_name | ||
|
||
with open(asset_mapper_path, "w", encoding="utf-8") as f: | ||
json.dump(asset_mapper_config, f, ensure_ascii=False, indent=4) |
Oops, something went wrong.