Skip to content
This repository was archived by the owner on Oct 24, 2024. It is now read-only.

Commit a7e691e

Browse files
committed
Revert "think I've fixed the bug"
This reverts commit 52ca551.
1 parent bc848e2 commit a7e691e

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

datatree/mapping.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,6 @@ def _map_over_subtree(*args, **kwargs):
215215
# Find out how many return values we received
216216
num_return_values = _check_all_return_values(out_data_objects)
217217

218-
ancestors_of_new_root = first_tree.pathstr.removesuffix(first_tree.name)
219-
220218
# Reconstruct 1+ subtrees from the dict of results, by filling in all nodes of all result trees
221219
result_trees = []
222220
for i in range(num_return_values):
@@ -230,11 +228,7 @@ def _map_over_subtree(*args, **kwargs):
230228
output_node_data = out_data_objects[p]
231229
else:
232230
output_node_data = None
233-
234-
# Discard parentage so that new trees don't include parents of input nodes
235-
# TODO use a proper relative_path method on DataTree(/TreeNode) to do this
236-
relative_path = p.removeprefix(ancestors_of_new_root)
237-
out_tree_contents[relative_path] = output_node_data
231+
out_tree_contents[p] = output_node_data
238232

239233
new_tree = DataTree.from_dict(
240234
name=first_tree.name, data_objects=out_tree_contents

0 commit comments

Comments
 (0)