Skip to content
Merged
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
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ jobs:
- name: Install dependencies
run: |
conda install --quiet --yes -c conda-forge openbabel pip ruamel.yaml
pip install -r requirements.txt
pip install -e .[tests]
pip install -e .[strict,tests]

- name: Test
run: pytest
run: pytest -n auto tests

- name: Build packages
run: |
python setup.py sdist bdist_wheel
pip install --upgrade build
python -m build

- name: Publish
uses: pypa/gh-action-pypi-publish@master
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,11 @@ jobs:
shell: bash -l {0}
run: |
conda install --quiet --yes -c conda-forge openbabel pip ruamel.yaml
python${{ matrix.python-version }} -m pip install -r requirements.txt
python${{ matrix.python-version }} -m pip install -e .[tests,cli]
python${{ matrix.python-version }} -m pip install -e .[strict,tests,cli]

- name: Test
shell: bash -l {0}
run: python${{ matrix.python-version }} -m pytest --cov=robocrys --cov-report=xml --cov-config=.coveragerc tests/
run: python${{ matrix.python-version }} -m pytest -n auto --cov=robocrys --cov-report=xml --cov-config=.coveragerc tests/

docs:
runs-on: ubuntu-latest
Expand All @@ -44,8 +43,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -e .[docs,cli]
pip install -e .[strict,docs,cli]

- name: Build
run: sphinx-build docs/src docs_build
3 changes: 0 additions & 3 deletions .mypy.ini

This file was deleted.

101 changes: 101 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@

[build-system]
requires = ["setuptools>=80.0.0","setuptools-scm>=8"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
root = "."
relative_to = "__file__"

[tool.setuptools]
include-package-data = true

[tool.setuptools.packages.find]
where = ["."]
exclude = ["tests", "docs", "dev_scripts"]
include = ["robocrys"]

[tool.setuptools.package-data]
"robocrys.condense" = ["*.json.gz"]

[project]
name = "robocrys"
dynamic = ["version"]
requires-python = ">=3.10"
description="Automatic generation of crystal structure descriptions"
license = {text = "Modified BSD"}
authors = [
{name = "Alex Ganose", email="aganose@lbl.gov"},
]
dependencies = [
"spglib>=2.5.0",
"numpy",
"scipy",
"pymatgen>=2024.1.26",
"inflect",
"networkx",
"matminer>=0.9.2",
"monty",
"pubchempy",
"pybtex",
]
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
"Intended Audience :: Information Technology",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Chemistry",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Scientific/Engineering",
"Topic :: Other/Nonlisted Topic",
"Operating System :: OS Independent",
]
keywords=["crystal-structure", "crystallography", "materials-science"]

[project.urls]
Homepage = "https://github.com/hackingmaterials/robocrystallographer"
Documentation = "https://hackingmaterials.lbl.gov/robocrystallographer/"

[project.optional-dependencies]
docs = [
"sphinx>=5.3.0",
"sphinx-argparse==0.5.2",
"sphinx_rtd_theme==3.0.2",
"sphinx-autodoc-typehints==3.0.1",
]
dev = ["tqdm", "pybel", "pebble", "maggma"]
tests = ["pytest", "pytest-cov", "pytest-xdist"]
cli = ["mp_api"]
lint = [
"coverage==7.11.0",
"codacy-coverage==1.3.11",
"pycodestyle==2.14.0",
"mypy==1.18.2",
"pydocstyle==6.1.1",
"flake8==7.3.0",
"pylint==4.0.2",
"black==25.9.0",
]
strict = [
"spglib==2.6.0",
"numpy==2.2.6,",
"scipy==1.15.3",
"pymatgen==2025.10.7",
"inflect==7.5.0",
"networkx==3.4.2",
"matminer==0.9.3",
"monty==2025.3.3",
"pubchempy==1.0.5",
"pybtex==0.25.1",
]

[project.scripts]
robocrys = "robocrys.cli:main"

[tool.mypy]
ignore_missing_imports = true
10 changes: 0 additions & 10 deletions requirements.txt

This file was deleted.

9 changes: 8 additions & 1 deletion robocrys/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,16 @@

from __future__ import annotations

from robocrys._version import __version__
from importlib.metadata import PackageNotFoundError, version

from robocrys.condense.condenser import StructureCondenser
from robocrys.describe.describer import StructureDescriber
from robocrys.util import common_formulas

__all__ = ["__version__", "StructureDescriber", "StructureCondenser", "common_formulas"]

try:
__version__ = version("robocrys")
except PackageNotFoundError:
# package is not installed
pass
6 changes: 0 additions & 6 deletions robocrys/_version.py

This file was deleted.

Binary file modified robocrys/condense/mineral_db.json.gz
Binary file not shown.
13 changes: 11 additions & 2 deletions robocrys/describe/describer.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,18 @@ def get_mineral_description(self) -> str:
spg_symbol = htmlify_spacegroup(self._da.spg_symbol)
formula = htmlify(formula)

mineral_name = get_mineral_name(self._da.mineral)
if mineral_name := get_mineral_name(self._da.mineral):
# replace latex-like characters with unicode
latex_reps = {
"$\\mu$": "\u03BC",
"\\'{c}": "\u0107",
}
if self.fmt in {"html", "unicode"} and any(
k in mineral_name for k in latex_reps
):
for k, v in latex_reps.items():
mineral_name = mineral_name.replace(k, v)

if mineral_name:
desc = f"{formula} is {mineral_name} structured and"
else:
desc = f"{formula}"
Expand Down
90 changes: 0 additions & 90 deletions setup.py

This file was deleted.

Loading