Skip to content

Commit 56fb242

Browse files
authored
Merge pull request #11 from KTH-SML/documentation-review
Adding documentation
2 parents eb118f3 + e1372a1 commit 56fb242

7 files changed

Lines changed: 62 additions & 20 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ pip install -e ".[hj_reachability]"
3535
from pyspect.logics import *
3636
from pyspect.tlt import TLT, ContLTL
3737
from pyspect.impls.hj_reachability import TVHJImpl
38+
from pyspect.set_builder import BoundedSet, Union, HalfSpaceSet
3839

3940
# 1) Pick primitives/fragment
4041
TLT.select(ContLTL) # Continuous-time LTL

docs/get_started.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@
22

33
Follow these steps to install **pyspect** and run your first spec.
44

5+
## 0. Prerequisites
6+
7+
- Python **>= 3.12**
8+
59
## 1. Installation
610

711
```bash
812
pip install pyspect
913

10-
# With optional implementaion
14+
# With optional implementation
1115
pip install pyspect[hj_reachability]
1216
```
1317

@@ -16,8 +20,8 @@ pip install pyspect[hj_reachability]
1620
```python
1721
from pyspect.logics import *
1822
from pyspect.tlt import TLT, ContLTL
19-
from pyspect.sets import BoundedSet, Union, HalfSpaceSet
20-
from pyspect.impls.hj_reachability import HJImpl
23+
from pyspect.set_builder import BoundedSet, Union, HalfSpaceSet
24+
from pyspect.impls.hj_reachability import TVHJImpl
2125

2226
# Choose fragment
2327
TLT.select(ContLTL)
@@ -33,7 +37,7 @@ tlt = TLT(phi, where={
3337
})
3438

3539
# Realize on a backend
36-
impl = HJImpl(...)
40+
impl = TVHJImpl(...)
3741
Phi = tlt.realize(impl)
3842
print("Satisfaction set:", Phi)
3943
```
Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1+
## Reference
12

2-
*Documentation To Come...*
3-
4-
<!-- ## Reference -->
5-
6-
<!-- ::: pyspect.impls.hj_reachability
7-
options:
8-
show_root_head: false -->
3+
::: pyspect.impls.hj_reachability

docs/implementations/zonoOpt.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11

2-
*Documentation To Come...*
2+
## Reference
3+
4+
::: pyspect.impls.zonoopt

mkdocs.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ nav:
3636
- hj_reachability: implementations/hj_reachability.md
3737
- ZonoOpt: implementations/zonoOpt.md
3838
- Helper Implementations:
39-
- Base: implementations/base.md
40-
- Axes: implementations/axes.md
41-
- Plotly: implementations/plotly.md
42-
- Debug: implementations/debug.md
39+
- Base: implementations/dev/base.md
40+
- Axes: implementations/dev/axes.md
41+
- Plotly: implementations/dev/plotly.md
42+
- Debug: implementations/dev/debug.md
4343

4444
extra_javascript:
4545
- mathjax.js
@@ -52,6 +52,7 @@ plugins:
5252
python:
5353
options:
5454
show_root_heading: false
55+
show_source: false
5556

5657
markdown_extensions:
5758
admonition:

src/pyspect/impls/hj_reachability.py

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,26 @@
1-
"""
2-
Hamilton-Jacobi reachability implementations using the hj_reachability package.
1+
"""Hamilton-Jacobi backend implementations.
2+
3+
This module integrates the external ``hj_reachability`` package with
4+
``pyspect`` by providing a concrete backend for level-set operations and
5+
time-varying reachability queries used during TLT realization.
6+
7+
Provided classes:
8+
- ``TVHJImpl``: Main HJ backend operating on gridded level-set arrays.
9+
- ``TVHJImplDebugger``: Debug helper for inspecting HJ backend behavior.
10+
11+
Backend capabilities:
12+
- Set operations: ``empty``, ``complement``, ``intersect``, ``union``
13+
- Geometry: ``halfspace`` and axis-aware projections
14+
- Reachability: ``pre``, ``reach``, ``avoid`` with time-varying
15+
targets/constraints
16+
- Visualization: Plotly-based bitmap/surface/isosurface transforms
317
418
Requires:
5-
- hj_reachability
6-
- jax_tqdm
19+
- ``hj_reachability``
20+
- ``jax_tqdm``
21+
22+
Notes:
23+
- Uses JAX arrays as the underlying set/value representation.
724
"""
825

926
import functools

src/pyspect/impls/zonoopt.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
"""ZonoOpt backend implementations.
2+
3+
This module integrates the external ``zonoopt`` library with ``pyspect`` by
4+
providing a concrete backend for set operations and reachability queries used
5+
during TLT realization.
6+
7+
Provided classes:
8+
- ``ZonoOptImpl``: Main backend operating on ``zono.HybZono`` sets.
9+
- ``DoubleIntegrator``: Convenience linear dynamics model for examples.
10+
11+
Backend capabilities:
12+
- Set operations: ``empty``, ``complement``, ``intersect``, ``union``
13+
- Geometry: ``halfspace``
14+
- Reachability: ``pre``, ``reach``, ``reachF``
15+
16+
Requires:
17+
- ``zonoopt``
18+
19+
Notes:
20+
- Targets discrete-time linear dynamics workflows.
21+
"""
22+
123
import numpy as np
224
import zonoopt as zono
325
from scipy import sparse

0 commit comments

Comments
 (0)