-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update maker_utils so that saved nodes are still returned (#218)
- Loading branch information
1 parent
c0a084d
commit c19cde4
Showing
5 changed files
with
67 additions
and
136 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
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 |
---|---|---|
@@ -1,4 +1,26 @@ | ||
import asdf | ||
|
||
NONUM = -999999 | ||
NOSTR = "dummy value" | ||
|
||
MESSAGE = "This function assumes shape is 2D, but it was given at least 3 dimensions" | ||
|
||
|
||
def save_node(node, filepath=None): | ||
""" | ||
Save the node to a file if there is a file path given, and return the node. | ||
Parameters | ||
---------- | ||
node: DNode | ||
The node to save. | ||
filepath: str | ||
(optional) File name and path to write model to. | ||
""" | ||
|
||
if filepath: | ||
af = asdf.AsdfFile() | ||
af.tree = {"roman": node} | ||
af.write_to(filepath) | ||
|
||
return node |
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
Oops, something went wrong.