Add Copilot instructions for repository context - #4
Conversation
Co-authored-by: fbischoff <7567292+fbischoff@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Configures repository-specific guidance for GitHub Copilot coding agent so generated changes align with existing project patterns (molecule utilities, Z-matrix handling, testing/CI expectations).
Changes:
- Adds
.github/copilot-instructions.mddescribing project scope, coding conventions, and testing practices - Documents expected CI behavior and supported Python versions
- Captures domain-specific conventions (unit conversion constant,
obabelintegration, z-matrix/XYZ consistency)
| - **Supported versions**: Python 3.9, 3.10, and 3.11 | ||
| - Always ensure code is compatible with all supported versions | ||
| - CI runs tests against all three versions |
There was a problem hiding this comment.
The stated supported Python versions (3.9–3.11) don’t match the repo’s CI configuration: .github/workflows/pytest.yml currently runs against Python 3.8 as well. Update these instructions (or the CI matrix) so the documented support and actual test matrix are consistent.
| - **Supported versions**: Python 3.9, 3.10, and 3.11 | |
| - Always ensure code is compatible with all supported versions | |
| - CI runs tests against all three versions | |
| - **Supported versions**: Python 3.8, 3.9, 3.10, and 3.11 | |
| - Always ensure code is compatible with all supported versions | |
| - CI runs tests against all four versions |
| - Pure Python implementation available as fallback | ||
|
|
There was a problem hiding this comment.
This claims a “pure Python implementation available as fallback” for Z-matrix/XYZ conversions, but Molecule.to_zmatrix() always calls obabel and raises ObabelNotFoundError when it’s missing (there’s no runtime fallback to _xyz_to_zmatrix_self). Consider rewording to clarify that only from_zmatrix() is pure-Python, or implement an actual fallback path in to_zmatrix().
| - Pure Python implementation available as fallback | |
| - Z-matrix parsing (`from_zmatrix()`) is implemented in pure Python | |
| - Z-matrix generation (`to_zmatrix()`) currently requires `obabel` and raises `ObabelNotFoundError` if it is not available |
| ## CI/CD | ||
|
|
||
| ### GitHub Actions | ||
| - **Workflow file**: `.github/workflows/python-pytest.yml` | ||
| - **Trigger**: Pushes and PRs to `main` or `master` branches | ||
| - **Matrix testing**: Runs on Python 3.9, 3.10, and 3.11 | ||
| - **Steps**: | ||
| 1. Checkout code | ||
| 2. Set up Python | ||
| 3. Cache pip dependencies | ||
| 4. Install dependencies (pytest and numpy) | ||
| 5. Run pytest with `-q -r a` flags | ||
|
|
||
| ### CI Requirements | ||
| - All tests must pass on all supported Python versions | ||
| - No external dependencies (like Open Babel) required in CI | ||
|
|
There was a problem hiding this comment.
The CI section describes a single workflow (python-pytest.yml) and its steps, but the repo also has .github/workflows/pytest.yml with a different Python matrix and dependency install behavior. To avoid misleading Copilot, either document both workflows (and their differences) or remove/rename the unused one so there’s a single source of truth.
| ## Project Structure | ||
|
|
||
| ``` | ||
| . | ||
| ├── .github/ | ||
| │ └── workflows/ # CI/CD workflows | ||
| ├── tests/ # Test files | ||
| │ ├── conftest.py # Pytest fixtures | ||
| │ ├── test_molecule.py # Molecule class tests | ||
| │ └── test_kabsch.py # Kabsch algorithm tests | ||
| ├── molecule.py # Main molecule utilities module | ||
| ├── main.py # Sample script/entry point | ||
| └── README.md # Project documentation | ||
| ``` |
There was a problem hiding this comment.
The “Project Structure” tree omits the existing scripts/ directory and shows only one workflow file under .github/workflows/, which may give Copilot an inaccurate picture of the repo layout. Please update the tree to reflect the current directories/files.
Configures GitHub Copilot coding agent with repository-specific context and conventions.
Changes
.github/copilot-instructions.mdwith:tmp_path,pytest.approx(), mocksubprocess.runfor obabel)ObabelNotFoundError,ObabelError)ANGSTROM_TO_BOHR = 1.889725988579)Provides Copilot with context to generate code that follows existing patterns for molecular geometry utilities, unit conversions, and subprocess-based tool integration.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
gh.io/home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.