diff --git a/semantique/datacube.py b/semantique/datacube.py index f170b8c8..bcfa9953 100644 --- a/semantique/datacube.py +++ b/semantique/datacube.py @@ -232,7 +232,7 @@ def layout(self, value): self._layout = {} if value is None else self._parse_layout(value) def _parse_layout(self, obj): - # Function to recursively parse and metadata objects to make them autocomplete friendly + # Recursively parse metadata objects to make them autocomplete friendly. def _parse(current_obj, ref_path): if "type" in current_obj and "values" in current_obj: current_obj["reference"] = copy.deepcopy(ref_path) @@ -245,13 +245,11 @@ def _parse(current_obj, ref_path): for item in current_obj["values"] } return - # If not a "layer", traverse deeper into the object. for key, value in current_obj.items(): if isinstance(value, dict): new_ref_path = ref_path + [key] _parse(value, new_ref_path) - # Start parsing from the root object. for key, value in obj.items(): if isinstance(value, dict): @@ -521,7 +519,7 @@ def layout(self, value): self._layout = {} if value is None else self._parse_layout(value) def _parse_layout(self, obj): - # Function to recursively parse and metadata objects to make them autocomplete friendly + # Recursively parse metadata objects to make them autocomplete friendly. def _parse(current_obj, ref_path): if "type" in current_obj and "values" in current_obj: current_obj["reference"] = copy.deepcopy(ref_path) @@ -534,13 +532,11 @@ def _parse(current_obj, ref_path): for item in current_obj["values"] } return - # If not a "layer", traverse deeper into the object. for key, value in current_obj.items(): if isinstance(value, dict): new_ref_path = ref_path + [key] _parse(value, new_ref_path) - # Start parsing from the root object. for key, value in obj.items(): if isinstance(value, dict): diff --git a/semantique/mapping.py b/semantique/mapping.py index 6783086d..f354cc90 100644 --- a/semantique/mapping.py +++ b/semantique/mapping.py @@ -149,8 +149,7 @@ def translate(self, *reference, property = None, extent, datacube, if len(properties) == 1: out = properties[0] else: - func = getattr(reducers, "all_") - out = Collection(properties).merge(func) + out = Collection(properties).merge(reducers.all_) else: try: property = ruleset[property]