MCPcopy Create free account
hub / github.com/daft-dev/daft / add_node

Method add_node

daft.py:119–214  ·  view source on GitHub ↗

Add a :class:`Node` to the model. :param node: The plain-text identifier for the nodeself. Can also be the :class:`Node` to retain backward compatibility. :param content: The display form of the variable. :param x: T

(
        self,
        node,
        content="",
        x=0,
        y=0,
        scale=1.0,
        aspect=None,
        observed=False,
        fixed=False,
        alternate=False,
        offset=[0.0, 0.0],
        fontsize=None,
        plot_params={},
        label_params=None,
        shape="ellipse",
    )

Source from the content-addressed store, hash-verified

117 self._ctx.close()
118
119 def add_node(
120 self,
121 node,
122 content="",
123 x=0,
124 y=0,
125 scale=1.0,
126 aspect=None,
127 observed=False,
128 fixed=False,
129 alternate=False,
130 offset=[0.0, 0.0],
131 fontsize=None,
132 plot_params={},
133 label_params=None,
134 shape="ellipse",
135 ):
136 """
137 Add a :class:`Node` to the model.
138
139 :param node:
140 The plain-text identifier for the nodeself.
141 Can also be the :class:`Node` to retain backward compatibility.
142
143 :param content:
144 The display form of the variable.
145
146 :param x:
147 The x-coordinate of the node in *model units*.
148
149 :param y:
150 The y-coordinate of the node.
151
152 :param scale: (optional)
153 The diameter (or height) of the node measured in multiples of
154 ``node_unit`` as defined by the :class:`PGM` object.
155
156 :param aspect: (optional)
157 The aspect ratio width/height for elliptical nodes; default 1.
158
159 :param observed: (optional)
160 Should this be a conditioned variable?
161
162 :param fixed: (optional)
163 Should this be a fixed (not permitted to vary) variable?
164 If `True`, modifies or over-rides ``diameter``, ``offset``,
165 ``facecolor``, and a few other ``plot_params`` settings.
166 This setting conflicts with ``observed``.
167
168 :param alternate: (optional)
169 Should this use the alternate style?
170
171 :param offset: (optional)
172 The ``(dx, dy)`` offset of the label (in points) from the default
173 centered position.
174
175 :param fontsize: (optional)
176 The fontsize to use.

Callers 15

test_bcaFunction · 0.95
test_classicFunction · 0.95
test_deconvolutionFunction · 0.95
test_exoplanetsFunction · 0.95
test_fixedFunction · 0.95
test_gaiaFunction · 0.95
test_galexFunction · 0.95
test_huey_p_newtonFunction · 0.95
test_logoFunction · 0.95
test_mrfFunction · 0.95
test_no_circlesFunction · 0.95
test_no_grayFunction · 0.95

Calls 1

NodeClass · 0.85

Tested by 15

test_bcaFunction · 0.76
test_classicFunction · 0.76
test_deconvolutionFunction · 0.76
test_exoplanetsFunction · 0.76
test_fixedFunction · 0.76
test_gaiaFunction · 0.76
test_galexFunction · 0.76
test_huey_p_newtonFunction · 0.76
test_logoFunction · 0.76
test_mrfFunction · 0.76
test_no_circlesFunction · 0.76
test_no_grayFunction · 0.76