Skip to content

Commit

Permalink
fixing output media type and roles output for assets
Browse files Browse the repository at this point in the history
  • Loading branch information
dchandan committed Oct 17, 2023
1 parent f22c1a2 commit efd9230
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions STACpopulator/implementations/CMIP6-UofT/add_CMIP6.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import argparse
import json
import logging
from datetime import datetime
from typing import Any, Dict, List, Literal, MutableMapping
Expand Down Expand Up @@ -160,9 +161,8 @@ def create_stac_item(self, item_name: str, item_data: MutableMapping[str, Any])
except:
LOGGER.warning(f"Failed to add Datacube extension to item {item_name}")

# print(obj.item.to_dict())
# return obj.item.to_dict()
print(item.to_dict())
# return json.dumps(item.to_dict())
print(json.dumps(item.to_dict()))

def validate_stac_item_cv(self, data: MutableMapping[str, Any]) -> bool:
# Validation is done at the item creating stage, using the Properties class.
Expand Down
1 change: 1 addition & 0 deletions STACpopulator/stac_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ def STAC_item_from_metadata(iid: str, attrs: MutableMapping[str, Any], item_prop
root = {}

for name, url in root.items():
name = str(name) # converting name from siphon.catalog.CaseInsensitiveStr to str
asset = pystac.Asset(href=url, media_type=media_types.get(name), roles=asset_roles.get(name))
item.add_asset(name, asset)

Expand Down

0 comments on commit efd9230

Please sign in to comment.