From 60d109f8d99f61a6b5e9a6868eb4bdf06f384636 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 19 Feb 2026 17:08:04 +0000 Subject: [PATCH 1/2] Initial plan From 8eb277a444fbd4d1d0afefe3972f7ae22e88a512 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 19 Feb 2026 17:09:27 +0000 Subject: [PATCH 2/2] Add .github/copilot-instructions.md Co-authored-by: alexlib <747110+alexlib@users.noreply.github.com> --- .github/copilot-instructions.md | 64 +++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .github/copilot-instructions.md diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000..ee7505a --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,64 @@ +# Copilot Instructions + +## Repository Overview + +This repository provides Python bindings for the [easySBA](https://users.ics.forth.gr/~lourakis/sba/) sparse bundle adjustment C library, using [pybind11](https://pybind11.readthedocs.io/). + +## Repository Layout + +- `src/` – Original C/C++ sources for the easySBA library and the license. +- `easysba/` – Python package: `__init__.py` re-exports `easy_sba` from the compiled pybind11 extension (`_easysba.cpp`). +- `tests/` – `unittest`-based test suite run with `pytest`. +- `docs/` – Usage documentation (`USAGE.md`). +- `pyproject.toml` / `setup.py` – Build configuration (setuptools + pybind11 C extension, cibuildwheel for wheels). + +## Build Requirements + +- Python 3.11+ +- C/C++ toolchain +- BLAS/LAPACK development libraries (e.g. `libblas-dev`, `liblapack-dev`, `liblapacke-dev`) +- Python packages: `numpy`, `pybind11`, `setuptools`, `wheel` + +On Ubuntu/Debian: + +```bash +sudo apt-get install -y build-essential libblas-dev liblapack-dev liblapacke-dev gfortran +``` + +Install the package locally (editable or regular): + +```bash +pip install -v . +# or with uv +uv pip install -v . +``` + +## Running Tests + +```bash +pytest +``` + +Tests that actually run the SBA solver require the environment variable `EASYSBA_RUN_SOLVER=1`: + +```bash +EASYSBA_RUN_SOLVER=1 pytest +``` + +## Code Style and Conventions + +- Python code follows standard PEP 8 conventions. +- C/C++ code in `src/` and `easysba/_easysba.cpp` follows the style of the existing sources. +- Tests live in `tests/` and use `unittest.TestCase` classes, discovered and run via `pytest`. +- Keep the public Python API minimal: `easysba.easy_sba(...)` is the single entry point. + +## Key Files + +| File | Purpose | +|---|---| +| `easysba/_easysba.cpp` | pybind11 binding: wraps the C `easy_sba` function | +| `easysba/__init__.py` | Re-exports `easy_sba` for the public package API | +| `src/sba_levmar.c` | Core Levenberg-Marquardt SBA implementation | +| `tests/test_smoke.py` | Smoke tests (import check + optional solver run) | +| `tests/test_sba_steps.py` | Step-by-step SBA tests | +| `pyproject.toml` | Build system and cibuildwheel configuration |