Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix node docstring and add additional information #307

Merged
merged 1 commit into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bigtree/node/basenode.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ class BaseNode:
>>> b = Node("b", children=[d])
>>> a = Node("a", children=[b, c])

**BaseNode Creation**
**BaseNode Creation**

Node can be created by instantiating a `BaseNode` class or by using a *dictionary*.
If node is created with dictionary, all keys of dictionary will be stored as class attributes.
Node can be created by instantiating a `BaseNode` class or by using a *dictionary*.
If node is created with dictionary, all keys of dictionary will be stored as class attributes.

>>> from bigtree import Node
>>> root = Node.from_dict({"name": "a", "age": 90})
Expand Down
6 changes: 3 additions & 3 deletions bigtree/node/binarynode.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ class BinaryNode(node.Node):
>>> b = BinaryNode(2, right=d)
>>> a = BinaryNode(1, children=[b, c])

**BinaryNode Creation**
**BinaryNode Creation**

Node can be created by instantiating a `BinaryNode` class or by using a *dictionary*.
If node is created with dictionary, all keys of dictionary will be stored as class attributes.
Node can be created by instantiating a `BinaryNode` class or by using a *dictionary*.
If node is created with dictionary, all keys of dictionary will be stored as class attributes.

>>> from bigtree import BinaryNode
>>> a = BinaryNode.from_dict({"name": "1"})
Expand Down
6 changes: 3 additions & 3 deletions bigtree/node/dagnode.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ class DAGNode:
>>> b = DAGNode("b", children=[c])
>>> a = DAGNode("a", children=[c])

**DAGNode Creation**
**DAGNode Creation**

Node can be created by instantiating a `DAGNode` class or by using a *dictionary*.
If node is created with dictionary, all keys of dictionary will be stored as class attributes.
Node can be created by instantiating a `DAGNode` class or by using a *dictionary*.
If node is created with dictionary, all keys of dictionary will be stored as class attributes.

>>> from bigtree import DAGNode
>>> a = DAGNode.from_dict({"name": "a", "age": 90})
Expand Down
10 changes: 7 additions & 3 deletions bigtree/node/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ class Node(basenode.BaseNode):
Node is an extension of BaseNode, and is able to extend to any Python class.
Nodes can have attributes if they are initialized from `Node`, *dictionary*, or *pandas DataFrame*.

!!! note
Node names cannot contain separator symbol! This will not throw error, but you might run into issues
when performing certain functions such as export-then-import of tree.

Nodes can be linked to each other with `parent` and `children` setter methods.

Examples:
Expand Down Expand Up @@ -39,10 +43,10 @@ class Node(basenode.BaseNode):
>>> b = Node("b", children=[c, d])
>>> a = Node("a", children=[b])

**Node Creation**
**Node Creation**

Node can be created by instantiating a `Node` class or by using a *dictionary*.
If node is created with dictionary, all keys of dictionary will be stored as class attributes.
Node can be created by instantiating a `Node` class or by using a *dictionary*.
If node is created with dictionary, all keys of dictionary will be stored as class attributes.

>>> from bigtree import Node
>>> a = Node.from_dict({"name": "a", "age": 90})
Expand Down
Loading