-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ArrayData
: Allow defining array(s) on construction
Currently, the constructor does not allow to define any arrays to set when constructing a new node, so one is forced to multi line code: node = ArrayData() node.set_array('a', np.array([1, 2])) node.set_array('b', np.array([3, 4])) This commit allows initialization upon construction simplifying the code above to: node = ArrayData({'a': np.array([1, 2]), 'b': np.array([3, 4])}) Note that it is also possible to pass a single array to the constructor, in which case the array name is taken from the `default_array_name` class attribute. For backwards compatibility, it remains possible to construct an `ArrayData` without any arrays.
- Loading branch information
Showing
2 changed files
with
36 additions
and
2 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