Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13", "3.14"]
python-version: ["3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4
Expand All @@ -23,8 +23,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest jsonschema
pip install -e .
pip install -e ".[tests]"

- name: Test with pytest
run: make test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ coverage.xml
*.cover
.hypothesis/
.pytest_cache/
.ruff_cache/

# Translations
*.mo
Expand Down
4 changes: 2 additions & 2 deletions docs/source/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Water MP2 Energy
.. code:: python

{
"schema_name": "qc_schema_output",
"schema_name": "qcschema_output",
"schema_version": 1,
"molecule": {
"geometry": [
Expand Down Expand Up @@ -64,7 +64,7 @@ Water HF Gradient
.. code:: python

{
"schema_name": "qc_schema_output",
"schema_name": "qcschema_output",
"schema_version": 1,
"molecule": {
"geometry": [
Expand Down
29 changes: 15 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "qcschema"
version = "1"
description = "A schema for quantum chemistry"
readme = "README.md"
requires-python = ">3.11"
requires-python = ">=3.11"
dependencies = [
"jsonschema",
"pathlib2; python_version < '3.5'",
Expand All @@ -22,26 +22,19 @@ docs = [
]
tests = [
"pytest",
"qcelemental",
"qcmanybody",
]

[project.urls]
Homepage = "https://github.com/MolSSI/QCSchema"

[tool.setuptools]
packages = [
"qcschema",
"qcschema.data",
"qcschema.data.v1",
"qcschema.data.v2",
"qcschema.dev",
"qcschema.dev.properties",
"qcschema.dev.wavefunction",
]
packages = ["qcschema"]
zip-safe = true

[tool.setuptools.package-data]
"qcschema.data.v1" = ["*.schema"]
"qcschema.data.v2" = ["*.schema"]
"qcschema" = ["**/*.schema"]

[tool.ruff]
line-length = 120
Expand All @@ -62,5 +55,13 @@ lint.ignore = [
[tool.ruff.lint.isort]
known-first-party = ["qcschema"]

[tool.ruff.format]
line-length = 120
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = "-v --tb=short"
# Note: If you encounter "ModuleNotFoundError: No module named 'qcelemental.models._v1v2'"
# from a pytest plugin, it means an external package has a pytest11 entry point that fails.
# Run with: PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 PYTHONPATH=. pytest tests/
# See tests/conftest.py for more information.
85 changes: 85 additions & 0 deletions qcschema/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# QCSchema — Quantum Chemistry Schema

The core qcschema package.

## Directory structure

### `data/` — Generated JSON Schema documents
Contains the generated JSON Schema files for all schema versions.

- **`v1/`** — v1 JSON Schema documents (draft-04, frozen)
- Generated by `qcschema/v1/generate.py`
- `qcschema_input.schema` — Input specification
- `qcschema_molecule.schema` — Molecule structure
- `qcschema_output.schema` — Output specification

- **`v2/`** — v1.5 enhanced JSON Schema documents (draft-04, frozen)
- Generated by `qcschema/v1_5/generate.py`
- Same three schema files as v1, with wavefunction support
- Version number: 2 (v1.5 is the v2 JSON Schema version)

- **`qcelemental_v1/` and `qcelemental_v2/`** — Companion schema directories (dev-only)
- Will contain JSON Schema representations of qcelemental's pydantic models
- Generated by scripts in their respective directories (not shipped)

### `v1/` — v1 schema generator
Modular generator for v1 JSON Schema documents.

- **`generate.py`** — Main entry point: `python -m qcschema.v1.generate`
- **`generator/`** — Schema component modules (source of truth)
- `molecule.py` — Molecule schema definition
- `definitions.py` — Shared definitions (provenance, error, basis, etc.)
- `basis.py` — Basis set specifications
- `properties/` — Output property definitions

### `v1_5/` — v1.5 schema generator
Modular generator for v1.5 (v2) JSON Schema documents. Inherits from v1 and adds wavefunction.

- **`generate.py`** — Main entry point: `python -m qcschema.v1_5.generate`
- Imports and extends `qcschema.v1.generate.build_v1_schemas()`
- Adds wavefunction support to output schema
- Updates version number to 2
- **`generator/`** — v1.5-specific additions
- `wavefunction/` — Wavefunction schema definitions

### `qcelemental_v1/` and `qcelemental_v2/` (future)
Placeholders for qcelemental companion schema generation scripts.

## Version naming

- **v1**: Original QCSchema (version: 1)
- Frozen, JSON Schema draft-04
- **v1.5 / v2**: Enhanced QCSchema (version: 2)
- Adds wavefunction support
- Frozen, JSON Schema draft-04
- Called "v1.5" in directory names, "v2" in version numbers
- **Pydantic v2 API** (future): Separate Python object layer
- Will be built on pydantic v2
- Uses JSON Schema 2020-12

## How schemas are generated

Schemas are not hand-edited. To regenerate:

```bash
# Generate v1 schemas to qcschema/data/v1/
python -m qcschema.v1.generate

# Generate v1.5 schemas to qcschema/data/v2/
python -m qcschema.v1_5.generate
```

The generators use modular component files in their respective `generator/` subdirectories. v1.5 inherits from v1 and extends it with wavefunction support.
Comment thread
jaclark5 marked this conversation as resolved.
v1.5 is the longstanding state of the QCSchema repo from 2020-2026.

## Public API

See `validate.py` and `versions.py` for the main entry points:
- `qcschema.get_schema(schema_type, version)` — Load a schema
- `qcschema.validate(data, schema_type, version)` — Validate an instance

## Notes

- v1 and v1.5 schemas are frozen and protected (GOAL.md)
- Schema files are minified JSON (single-line format)
- Companion qcelemental schema generation is dev-only (not shipped)
6 changes: 3 additions & 3 deletions qcschema/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
The main init functions of the QC Schema project
"""

from . import dev
from .validate import validate
from .versions import get_schema, list_versions
from .validate import validate as validate
from .versions import get_schema as get_schema
from .versions import list_versions as list_versions
5 changes: 0 additions & 5 deletions qcschema/data/__init__.py

This file was deleted.

1 change: 0 additions & 1 deletion qcschema/data/v1/qc_schema_input.schema

This file was deleted.

1 change: 0 additions & 1 deletion qcschema/data/v1/qc_schema_molecule.schema

This file was deleted.

Loading
Loading