Skip to content

Commit 5a7022d

Browse files
Merge pull request #12 from ASAG-ISCAS/dev_scp
2 parents 27a74d8 + 34893e3 commit 5a7022d

File tree

21 files changed

+1096
-83
lines changed

21 files changed

+1096
-83
lines changed

.gitignore

Lines changed: 131 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,131 @@
1-
__pycache__
2-
.idea
3-
.vscode
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
pip-wheel-metadata/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
*.manifest
32+
*.spec
33+
34+
# Installer logs
35+
pip-log.txt
36+
pip-delete-this-directory.txt
37+
38+
# Unit test / coverage reports
39+
htmlcov/
40+
.tox/
41+
.nox/
42+
.coverage
43+
.coverage.*
44+
.cache
45+
nosetests.xml
46+
coverage.xml
47+
*.cover
48+
*.py,cover
49+
.hypothesis/
50+
.pytest_cache/
51+
52+
# Translations
53+
*.mo
54+
*.pot
55+
56+
# Django stuff:
57+
*.log
58+
local_settings.py
59+
db.sqlite3
60+
db.sqlite3-journal
61+
62+
# Flask stuff:
63+
instance/
64+
.webassets-cache
65+
66+
# Scrapy stuff:
67+
.scrapy
68+
69+
# Sphinx documentation
70+
docs/_build/
71+
72+
# PyBuilder
73+
target/
74+
75+
# Jupyter Notebook
76+
.ipynb_checkpoints
77+
78+
# IPython
79+
profile_default/
80+
ipython_config.py
81+
82+
# pyenv
83+
.python-version
84+
85+
# pipenv
86+
Pipfile.lock
87+
88+
# PEP 582
89+
__pypackages__/
90+
91+
# Celery stuff
92+
celerybeat-schedule
93+
celerybeat.pid
94+
95+
# SageMath parsed files
96+
*.sage.py
97+
98+
# Environments
99+
.env
100+
.venv
101+
env/
102+
venv/
103+
ENV/
104+
env.bak/
105+
venv.bak/
106+
107+
# Spyder project settings
108+
.spyderproject
109+
.spyproject
110+
111+
# Rope project settings
112+
.ropeproject
113+
114+
# mkdocs documentation
115+
/site
116+
117+
# mypy
118+
.mypy_cache/
119+
.dmypy.json
120+
dmypy.json
121+
122+
# Pyre type checker
123+
.pyre/
124+
125+
# IDEs
126+
.vscode/
127+
.idea/
128+
*.swp
129+
*.swo
130+
*~
131+
.DS_Store

INSTALL.md

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
# Installation Guide for PyBDR
2+
3+
PyBDR is a set-boundary based reachability analysis toolbox for Python.
4+
5+
## Prerequisites
6+
7+
- **Conda or Miniconda** ([Download here](https://docs.conda.io/en/latest/miniconda.html))
8+
- Git (for cloning the repository)
9+
10+
## Quick Installation (3 Steps)
11+
12+
```bash
13+
# Step 1: Create conda environment with all dependencies
14+
conda env create -f environment.yml
15+
16+
# Step 2: Activate the environment
17+
conda activate pybdr
18+
19+
# Step 3: Install PyBDR
20+
pip install -e .
21+
```
22+
23+
**That's it!** The `environment.yml` automatically installs Python 3.8+, all dependencies, and the required `cddlib` C library.
24+
25+
## Alternative: Install in Existing Conda Environment
26+
27+
If you already have a conda environment:
28+
29+
```bash
30+
# Activate your environment
31+
conda activate your_env_name
32+
33+
# Install cddlib C library
34+
conda install -c conda-forge cddlib
35+
36+
# Install PyBDR (this will install all Python dependencies including codac pre-release)
37+
pip install -e .
38+
```
39+
40+
## For Developers
41+
42+
```bash
43+
# Clone and setup
44+
git clone https://github.com/ASAG-ISCAS/PyBDR.git
45+
cd PyBDR
46+
conda env create -f environment.yml
47+
conda activate pybdr
48+
49+
# Install with development dependencies
50+
pip install -e ".[dev]"
51+
52+
# Run tests
53+
pytest
54+
```
55+
56+
## Verifying Installation
57+
58+
After installation, verify that PyBDR is correctly installed:
59+
60+
```python
61+
import pybdr
62+
from pybdr.geometry import Interval, Zonotope
63+
from pybdr.algorithm import ASB2008CDC
64+
65+
# Create a simple interval
66+
interval = Interval([0, 1], [1, 2])
67+
print(f"Interval created: {interval}")
68+
69+
print("PyBDR successfully installed!")
70+
```
71+
72+
## Troubleshooting
73+
74+
### Issue: `pycddlib` build fails with "cddlib/setoper.h not found"
75+
76+
**Cause**: The `cddlib` C library is not installed.
77+
78+
**Solution**: Make sure you've installed `cddlib` via conda:
79+
80+
```bash
81+
conda install -c conda-forge cddlib
82+
```
83+
84+
### Issue: CVXPY installation fails
85+
86+
**Solution**: CVXPY is included in `environment.yml`. If you're installing manually, use conda:
87+
88+
```bash
89+
conda install -c conda-forge cvxpy
90+
```
91+
92+
### Issue: "No module named 'pybdr'" after installation
93+
94+
**Solution**: Make sure you've activated the correct conda environment:
95+
96+
```bash
97+
conda activate pybdr
98+
```
99+
100+
### Issue: Codac installation or "No module named 'codac'"
101+
102+
**Cause**: Codac v2 is only available as a pre-release version.
103+
104+
**Solution**: Codac pre-release is automatically included when you run `pip install -e .`. If you need to install it manually:
105+
106+
```bash
107+
pip install "codac>=2.0.0.dev20"
108+
```
109+
110+
Or reinstall PyBDR:
111+
112+
```bash
113+
pip install -e . --force-reinstall
114+
```
115+
116+
## Package Structure
117+
118+
After installation, PyBDR provides the following modules:
119+
120+
```
121+
pybdr/
122+
├── algorithm/ # Reachability analysis algorithms
123+
├── dynamic_system/ # System models (continuous, discrete, hybrid)
124+
├── geometry/ # Geometric representations (intervals, zonotopes, polytopes)
125+
├── model/ # Pre-defined system models
126+
├── util/ # Utility functions
127+
└── misc/ # Miscellaneous utilities
128+
```
129+
130+
## Updating PyBDR
131+
132+
If you installed in development mode (`pip install -e .`), simply pull the latest changes:
133+
134+
```bash
135+
cd PyBDR
136+
git pull origin master
137+
```
138+
139+
## Uninstalling
140+
141+
To remove PyBDR:
142+
143+
```bash
144+
pip uninstall pybdr
145+
```
146+
147+
To remove the entire conda environment:
148+
149+
```bash
150+
conda deactivate
151+
conda env remove -n pybdr
152+
```
153+
154+
## Support
155+
156+
For issues and questions:
157+
158+
- GitHub Issues: https://github.com/ASAG-ISCAS/PyBDR/issues
159+
- Documentation: https://asag-iscas.github.io/docs.pybdr/
160+
161+
## Dependencies
162+
163+
PyBDR depends on:
164+
165+
- **numpy** (≥1.20.0): Numerical computations
166+
- **scipy** (≥1.7.0): Scientific computing
167+
- **pypoman** (≥0.5.4): Polytope manipulation
168+
- **cvxpy** (≥1.1.0): Convex optimization
169+
- **matplotlib** (≥3.3.0): Visualization
170+
171+
**System dependencies (automatically installed via conda):**
172+
173+
- **cddlib**: C library for polytope computations (required by pypoman)
174+
175+
All dependencies are automatically installed when using the `environment.yml` file with conda.

MANIFEST.in

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Include documentation and license files
2+
include README.md
3+
include LICENSE.md
4+
include INSTALL.md
5+
include environment.yml
6+
7+
# Include documentation images
8+
recursive-include doc *.png *.jpg *.jpeg *.gif *.svg
9+
10+
# Exclude unwanted files
11+
exclude .gitignore
12+
recursive-exclude * __pycache__
13+
recursive-exclude * *.py[co]
14+
recursive-exclude * *.so
15+
recursive-exclude * *.dylib
16+
17+
# Exclude test and benchmark files from distribution
18+
recursive-exclude test *
19+
recursive-exclude benchmarks *

0 commit comments

Comments
 (0)