daft-dev / daft-dev/daft

runtime warning for add-edge

Open
#154 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
687
Forks
121
PR merge metrics
No merged PRs in 30d

Description

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)

```

![image](https://user-images.githubusercontent.com/17184441/182432664-72ee514b-2c34-45f6-af52-dc34277a35dd.png)

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.