crystal-scene

Generate deterministic, renderer-neutral crystal scenes with pymatgen


Keywords
crystallography, materials-science, pymatgen, visualization
License
MIT
Install
pip install crystal-scene==0.1.1

Documentation

MatDomain

matdomain is a neutral uv workspace for small scientific domain distributions and projections built from them. The repository root is not a Python distribution and does not provide an installable matdomain package.

The current workspace contains exactly two distributions:

  • matdomain-structure owns the source-neutral structure value and its canonical operations.
  • crystal-scene derives the existing renderer-facing CrystalScene contract from that structure value.

Each distribution keeps its own public interface, dependencies, version, and release lifecycle. New scientific domains belong in separate distributions only after a concrete contract and consumer justify them.

Development

Python 3.12 or newer is required. Synchronize the complete workspace from the repository root:

uv sync --all-packages --locked

Run each distribution's checks through its own project configuration:

uv run --directory packages/matdomain-structure pytest -q
uv run --directory packages/matdomain-structure ruff check .
uv run --directory packages/matdomain-structure ruff format --check .
uv run --directory packages/matdomain-structure basedpyright

uv run --directory packages/crystal-scene pytest -q tests
uv run --directory packages/crystal-scene ruff check src tests
uv run --directory packages/crystal-scene ruff format --check src tests
uv run --directory packages/crystal-scene basedpyright

uv build --all-packages --no-sources
uv run --with twine twine check dist/*

Local source integration

Consumers using uv can add both checkout paths explicitly:

uv add --editable /path/to/matdomain/packages/matdomain-structure
uv add --editable /path/to/matdomain/packages/crystal-scene

Or install both into an active environment:

python -m pip install -e /path/to/matdomain/packages/matdomain-structure -e /path/to/matdomain/packages/crystal-scene

Release

The distributions version independently and use package-prefixed tags:

  • matdomain-structure-vX.Y.Z
  • crystal-scene-vX.Y.Z

For the first workspace release, publish matdomain-structure-v0.1.0 and wait for it to become available on PyPI before publishing crystal-scene-v0.1.1. The release workflow checks and builds the complete workspace but uploads only the distribution named by the tag.

Configure Trusted Publishing for both PyPI projects with owner tiannianzhu, repository matdomain, workflow publish.yml, and GitHub environment pypi.

The repository is distributed under the terms of the MIT License. See LICENSE.