Skip to content
Merged

logs #16

Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions energyml-utils/src/energyml/utils/data/datasets_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,7 @@ def read_external_dataset_array(
def get_path_in_external(obj) -> List[Any]:
"""
See :func:`get_path_in_external_with_path`. Only the value is returned, not the dot path into the object

:param obj:
:return:
"""
Expand All @@ -596,14 +597,14 @@ def get_proxy_uri_for_path_in_external(obj: Any, dataspace_name_or_uri: Union[st
"""
Search all PathInHdfFile or PathInExternalFile in the object and return a map of uri to list of path found
in the object for this uri.

:param obj:
:param dataspace_name_or_uri: the dataspace name or uri to search
:return: { uri : [ path_in_external1, path_in_external2, ... ], ... }
"""
if dataspace_name_or_uri is not None and isinstance(dataspace_name_or_uri, str):
dataspace_name_or_uri = dataspace_name_or_uri.strip()
ds_name = dataspace_name_or_uri
ds_uri = dataspace_name_or_uri
if isinstance(dataspace_name_or_uri, str):
if dataspace_name_or_uri is not None:
if not dataspace_name_or_uri.startswith("eml:///"):
Expand All @@ -614,13 +615,12 @@ def get_proxy_uri_for_path_in_external(obj: Any, dataspace_name_or_uri: Union[st
assert ds_uri is not None, f"Cannot parse dataspace uri {dataspace_name_or_uri}"
ds_name = ds_uri.dataspace
elif isinstance(dataspace_name_or_uri, Uri):
ds_uri = dataspace_name_or_uri
ds_name = dataspace_name_or_uri.dataspace

uri_path_map = {}
_piefs = get_path_in_external_with_path(obj)
if _piefs is not None and len(_piefs) > 0:
logging.info(f"Found {_piefs} datasets in object {get_obj_uuid(obj)}")
# logging.info(f"Found {_piefs} datasets in object {get_obj_uuid(obj)}")

# uri_path_map[uri] = _piefs
for item in _piefs:
Expand All @@ -631,7 +631,7 @@ def get_proxy_uri_for_path_in_external(obj: Any, dataspace_name_or_uri: Union[st
)
# Then unpack
path, pief = item
logging.info(f"\t test : {path_last_attribute(path)}")
# logging.info(f"\t test : {path_last_attribute(path)}")
if "hdf" in path_last_attribute(path).lower():
dor = get_object_attribute(
obj=obj, attr_dot_path=path[: -len(path_last_attribute(path))] + "hdf_proxy"
Expand Down
2 changes: 0 additions & 2 deletions energyml-utils/src/energyml/utils/introspection.py
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,6 @@ def get_obj_pkg_pkgv_type_uuid_version(

if ct is not None:
ct_match = parse_content_type(ct)
logging.debug("ct : %S", ct_match)
if ct_match is not None:
pkg = ct_match.group("domain")
pkg_v = ct_match.group("domainVersion")
Expand All @@ -1125,7 +1124,6 @@ def get_obj_pkg_pkgv_type_uuid_version(
try:
qt = get_object_attribute_no_verif(obj, "qualified_type")
qt_match = parse_qualified_type(qt)
logging.debug("qt : %s %s", qt, obj.__dict__, qt_match)
if qt_match is not None:
pkg = qt_match.group("domain")
pkg_v = qt_match.group("domainVersion")
Expand Down