Skip to content

Commit

Permalink
docs: update readme.md with make_diag()
Browse files Browse the repository at this point in the history
  • Loading branch information
geddy11 committed Oct 31, 2024
1 parent 41168e0 commit 13c3923
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ df = bts.solve()
print(df)
```
![result](https://github.com/geddy11/sysloss/raw/main/docs/bts.png)
```python
from sysloss.diagram import make_diag

make_diag(bts, fname="bts.png")
```
![tree](https://github.com/geddy11/sysloss/raw/main/docs/bts-tree.png)

## Documentation
The [documentation](https://sysloss.readthedocs.io/en/latest/Getting%20started.html) includes tutorials in the form of Jupyter notebooks, located in docs/nb.
Expand Down
Binary file added docs/bts-tree.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/bts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions tests/unit/test_diagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,20 @@
# SOFTWARE.

import os
import pytest
from sysloss.system import System
from sysloss.components import *
from sysloss.diagram import get_conf, make_diag, _DEF_CONF


def test_case1():
"""Test get_config()"""
"""Check get_config()"""
conf = get_conf()
assert conf == _DEF_CONF, "Default configuration"


def test_case2():
"""Test make_diag()"""
"""Check make_diag()"""
tsys = System("Test system", Source("CR2032", vo=3.0, rs=1))
tsys.add_comp("CR2032", comp=VLoss("Diode", vdrop=0.35))
tsys.add_comp(
Expand Down

0 comments on commit 13c3923

Please sign in to comment.