Skip to content

Commit

Permalink
style: Tidy 🎨
Browse files Browse the repository at this point in the history
  • Loading branch information
luukvdmeer committed Mar 5, 2024
1 parent 31bc70f commit c24a70c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
8 changes: 2 additions & 6 deletions semantique/datacube.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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):
Expand Down Expand Up @@ -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)
Expand All @@ -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):
Expand Down
3 changes: 1 addition & 2 deletions semantique/mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit c24a70c

Please sign in to comment.