Skip to content

Commit 370f4f7

Browse files
committed
updated versioning system
1 parent 37b8fb0 commit 370f4f7

13 files changed

Lines changed: 108 additions & 620 deletions

File tree

README.md

Lines changed: 60 additions & 154 deletions
Original file line numberDiff line numberDiff line change
@@ -1,222 +1,128 @@
11
# openptv-python
22

3-
Python version of the OpenPTV library - this is *a work in progress*
3+
Unified Python/OpenPTV repository for the combined `openptv_python` core library and `pyptv` GUI.
44

5-
## What This Repo Provides
5+
Current repository version: 0.5.0
66

7-
`openptv-python` keeps the Python API as the main interface and combines three
8-
execution modes behind that API:
7+
## Overview
98

10-
- **Pure Python**: the reference implementation and the easiest path for reading,
11-
debugging, and extending the code. Always available as fallback.
12-
- **Python + Numba**: several hot kernels are JIT-compiled automatically on first
13-
use, so the Python implementation still benefits from acceleration.
14-
- **Native `optv` bindings** (default): selected operations reuse the native OpenPTV
15-
implementation. Installed by default on supported platforms (Linux, macOS, Windows).
9+
This repository now exposes one shared API and one shared version stream. The main pieces are:
1610

17-
At the moment, automatic native delegation is implemented for image
18-
preprocessing and full-frame target recognition. The rest of the library keeps
19-
the same Python API and remains usable even when those native paths are not in
20-
use.
11+
- `openptv_python`: the Python library layer, used for pure-Python execution, Numba-accelerated kernels, and shared parameter/data handling.
12+
- `pyptv`: the GUI and batch-processing layer, built on top of the same Python API.
13+
- `optv`: native bindings used where available for delegated operations such as image preprocessing and full-frame target recognition.
2114

22-
If `optv` is not available on your platform, the package automatically falls back
23-
to pure Python/Numba implementations without any configuration needed.
15+
The current setup is intentionally structured so that the same codebase can run in three modes:
2416

25-
## How this is started
17+
1. Pure Python for readability, debugging, and visual inspection.
18+
2. Pure Python plus Numba for accelerated kernels where available.
19+
3. Native `optv` delegation for selected operations when the bindings are installed.
2620

27-
This work started from the https://github.com/OpenPTV/openptv/tree/pure_python branch. It now serves as the single repository for the Python core library and the GUI layer.
21+
The GUI version shown in PyPTV comes from the shared version module in `src/openptv_python/version.py`.
2822

29-
## Supported Python Versions
23+
## Versioning
3024

31-
The project currently supports Python `>=3.11,<3.14`.
25+
Versioning is now centralized:
3226

33-
## Installation
34-
35-
### Default user install
27+
- Canonical version source: [src/openptv_python/version.py](src/openptv_python/version.py)
28+
- Package version: 0.5.0
29+
- Release boundary: this is the first combined version after merging the older `openptv_python` and `pyptv` package streams
3630

37-
#### Recommended: uv
38-
39-
Create the environment and install the runtime dependencies:
31+
To bump the version, run:
4032

4133
```bash
42-
uv venv
43-
source .venv/bin/activate
44-
uv sync
34+
python src/pyptv/bump_version.py --patch
4535
```
4636

47-
This gives you the standard runtime stack: NumPy, SciPy, Numba, YAML, and the native `optv` bindings for accelerated image preprocessing and target recognition.
37+
Use `--minor` or `--major` for larger increments. The script updates the shared version module and `pyproject.toml` together.
38+
39+
## Installation
4840

49-
If you also want the GUI application, install the GUI extra:
41+
The project supports Python `>=3.11,<3.14`.
5042

51-
```bash
52-
uv sync --extra gui
53-
```
43+
### Recommended: uv
5444

55-
#### Alternative: pip
45+
Runtime install:
5646

5747
```bash
58-
conda create -n openptv-python -c conda-forge python=3.12
59-
conda activate openptv-python
60-
pip install .
48+
uv venv
49+
source .venv/bin/activate
50+
uv sync
6151
```
6252

63-
Optional GUI application:
53+
GUI extras:
6454

6555
```bash
66-
pip install ".[gui]"
56+
uv sync --extra gui
6757
```
6858

69-
### Developer install
70-
71-
#### Recommended: uv
59+
Developer setup:
7260

7361
```bash
7462
uv venv
7563
source .venv/bin/activate
7664
uv sync --extra dev
7765
```
7866

79-
#### Alternative: conda + pip
67+
### Alternative: pip
8068

8169
```bash
8270
conda create -n openptv-python -c conda-forge python=3.12
8371
conda activate openptv-python
84-
pip install -e ".[dev]"
72+
pip install .
8573
```
8674

87-
### What gets installed
88-
89-
- The default install includes `optv` bindings for automatic native delegation on supported platforms (Linux, macOS, Windows).
90-
- The optional `gui` extra adds the PyPTV GUI and its runtime dependencies.
91-
- The optional `dev` extra adds test, docs, typing, pre-commit, and GUI tooling for contributors.
92-
- If `optv` fails to install on your platform, the package falls back to pure Python/Numba implementations automatically.
93-
94-
## Backend Behavior
95-
96-
### Pure Python backend
97-
98-
This is the base implementation for the whole library. It is always the source
99-
of truth for the Python API and remains the fallback behavior for code paths
100-
that are not delegated to `optv`.
101-
102-
### Python + Numba backend
103-
104-
Numba accelerates selected computational kernels inside the Python
105-
implementation. This is automatic; there is no separate API to enable it.
106-
Expect the first call to a JIT-compiled function to be slower due to
107-
compilation, with later calls running faster.
108-
109-
### Native `optv` backend
110-
111-
When `optv` imports successfully, `openptv-python` automatically reuses native
112-
implementations for:
75+
GUI extras:
11376

114-
- image preprocessing
115-
- full-frame target recognition / segmentation
116-
117-
These native paths are validated against the Python implementation by parity
118-
tests, so results stay backend-independent.
119-
120-
### Backend Capability Table
121-
122-
| Operation | Pure Python | Python + Numba | Native `optv` |
123-
| --- | --- | --- | --- |
124-
| Image preprocessing | Yes | Yes | Yes, automatic delegation |
125-
| Target recognition / segmentation | Yes | Yes | Yes, automatic delegation |
126-
| Point reconstruction | Yes | Partial internal kernels | Not used by default |
127-
| Correspondence search / stereo matching | Yes | Partial internal kernels | Not used by default |
128-
| Tracking | Yes | Partial internal kernels | Not used by default |
129-
| Sequence parameter I/O | Yes | No | Available in native bindings |
130-
131-
`Not used by default` means the native path exists in benchmarks or conversion
132-
helpers, but the regular `openptv-python` runtime path still uses the Python
133-
implementation unless that operation is explicitly integrated later.
134-
135-
## Getting Started
136-
137-
### 1. Install the project
138-
139-
Use one of the installation methods above.
77+
```bash
78+
pip install "[gui]"
79+
```
14080

141-
### 2. Verify imports
81+
Developer extras:
14282

14383
```bash
144-
uv run python - <<'PY'
145-
import openptv_python
146-
import numba
147-
import optv
148-
149-
print("optv ok", optv.__version__)
150-
print("openptv_python ok")
151-
print("numba ok", numba.__version__)
152-
PY
84+
pip install "[dev]"
15385
```
15486

155-
### 3. Start using the Python API
87+
## Usage
15688

157-
```python
158-
>>> import openptv_python
159-
160-
```
89+
### Python API
16190

162-
### 4. Run the test suite
91+
```python
92+
import openptv_python
16393

164-
```bash
165-
uv run make
94+
print(openptv_python.__version__)
16695
```
16796

168-
Stress and performance tests are part of the default suite now. If you need a
169-
faster validation pass locally, you can skip them explicitly:
97+
### GUI
17098

17199
```bash
172-
OPENPTV_SKIP_STRESS_BENCHMARKS=1 uv run make
100+
uv run pyptv
173101
```
174102

175-
### Workflow for developers/contributors
103+
The GUI is versioned from the same shared source as the library.
176104

177-
Recommended contributor workflow with `uv`:
105+
## Documentation
178106

179-
```bash
180-
uv venv
181-
source .venv/bin/activate
182-
make env-update
183-
```
107+
Detailed guides live under [docs/](docs/), especially the PyPTV guides in [docs/pyptv](docs/pyptv/README.md).
184108

185-
This keeps the local environment synced to the locked developer dependency set.
109+
## Testing
186110

187-
If you prefer the conda workflow instead:
111+
Run the focused test suites with:
188112

189113
```bash
190-
conda create -n openptv-python -c conda-forge python=3.12
191-
conda activate openptv-python
192-
make conda-env-update
114+
uv run --with pytest pytest -q tests/openptv_python tests/pyptv
193115
```
194116

195-
Before pushing to GitHub, use the developer install above and then run the
196-
following commands:
197-
198-
1. Update the environment: `make env-update` by default, or `make conda-env-update` if you are using the conda workflow
199-
1. If you are using pip instead of uv, install the editable developer environment: `pip install -e ".[dev]"`
200-
1. Sync with the latest [template](https://github.com/ecmwf-projects/cookiecutter-conda-package) (optional): `make template-update`
201-
1. Run quality assurance checks: `make qa`
202-
1. Run tests: `make unit-tests`
203-
1. Run the static type checker: `make type-check`
204-
1. Build the documentation (see [Sphinx tutorial](https://www.sphinx-doc.org/en/master/tutorial/)): `make docs-build`
117+
The repository also contains test datasets in [tests/testing_folder](tests/testing_folder/).
205118

206-
### License
119+
## Repository Structure
207120

208-
```
209-
Copyright 2023, OpenPTV consortium.
210-
211-
Licensed under the Apache License, Version 2.0 (the "License");
212-
you may not use this file except in compliance with the License.
213-
You may obtain a copy of the License at
121+
- `src/openptv_python/`: shared Python library code and canonical version module
122+
- `src/pyptv/`: GUI, batch tools, and compatibility helpers
123+
- `docs/`: Sphinx documentation
124+
- `tests/`: library, GUI, and fixture tests
214125

215-
http://www.apache.org/licenses/LICENSE-2.0
126+
## License
216127

217-
Unless required by applicable law or agreed to in writing, software
218-
distributed under the License is distributed on an "AS IS" BASIS,
219-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
220-
See the License for the specific language governing permissions and
221-
limitations under the License.
222-
```
128+
Apache License, Version 2.0.

0 commit comments

Comments
 (0)