Skip to content

runtime warning for add-edge #154

Description

@flyaflya

For the following code:

pgm = daft.PGM(dpi = 150, alternate_style="outer")

pgm.add_node("sb","Start\nBalance", 1, 4, aspect = 2.2, observed = True, plot_params = {'facecolor': 'cadetblue'})
pgm.add_node("ba","Bet\nAmount", 1, 3, aspect = 2.2, shape = "rectangle", plot_params = {'facecolor': 'thistle'})

pgm.add_edge("sb", "ba")
pgm.render()

I get a runtime warning error message:

/usr/local/lib/python3.7/dist-packages/daft.py:843: RuntimeWarning: divide by zero encountered in double_scalars
  * (np.sign(dy) or 1.0)
<matplotlib.axes._axes.Axes at 0x7f2085d4d190>

image

The graph renders just fine, but I am unsure whether I am doing something wrong or if the Warning should not really occur. Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions