-
Notifications
You must be signed in to change notification settings - Fork 0
Add Copilot coding agent instructions #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 | | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The statement "Tests live in
tests/and useunittest.TestCaseclasses" is not entirely accurate. Whiletest_smoke.pyusesunittest.TestCase,test_sba_steps.pyuses plain pytest functions with pytest decorators like@pytest.mark.parametrize. Consider updating this to reflect both testing styles: "Tests live intests/and use eitherunittest.TestCaseclasses or plain pytest functions, discovered and run viapytest."