-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changing matpyuda structured objects to use dictionaries instead of l…
…ists for child objects. Also updating matpyuda tests
- Loading branch information
Stephen Dixon
authored and
Stephen Dixon
committed
Aug 1, 2023
1 parent
b49e0ff
commit 4cc5f2a
Showing
4 changed files
with
89 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
source/wrappers/matlab/pyuda_interface/+matpyuda/get_node_from_path.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
function node = get_node_from_path(input_node, pathstr) | ||
tokens = split(pathstr, "/"); | ||
try | ||
node = input_node.children(tokens(1)); | ||
catch ME | ||
throw(ME) | ||
end | ||
|
||
if length(tokens) > 1 | ||
try | ||
node = get_node_from_tokens(node, tokens(2:end)); | ||
catch ME | ||
throw(ME) | ||
end | ||
end | ||
end | ||
|
||
function node = get_node_from_tokens(input_node, tokens) | ||
try | ||
node = input_node.children(tokens(1)); | ||
catch ME | ||
throw(ME) | ||
end | ||
|
||
if length(tokens) > 1 | ||
try | ||
node = matpyuda.get_node_from_tokens(node, tokens(2:end)); | ||
catch ME | ||
throw(ME) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters