Metadata-Version: 2.4
Name: topo-metrics
Version: 0.1.7
Summary: Topological analysis tools for network materials.
Author-email: Thomas Nicholas <tcnicholas@me.com>
License: MIT License
        
        Copyright (c) 2025 Thomas Nicholas
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: Homepage, https://github.com/tcnicholas/topo-metrics
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: setuptools
Requires-Dist: wheel
Requires-Dist: pymatgen>=2025.3.10
Requires-Dist: pytest>=8.3.5
Requires-Dist: juliacall>=0.9.24
Requires-Dist: vesin>=0.3.2
Requires-Dist: ase>=3.24.0
Provides-Extra: numba
Requires-Dist: numba>=0.63.1; extra == "numba"
Provides-Extra: tests
Requires-Dist: pytest; extra == "tests"
Requires-Dist: pytest-cov; extra == "tests"
Provides-Extra: docs
Requires-Dist: sphinx; extra == "docs"
Requires-Dist: pip; extra == "docs"
Requires-Dist: furo; extra == "docs"
Requires-Dist: nbsphinx; extra == "docs"
Requires-Dist: ipython; extra == "docs"
Requires-Dist: pyzmq; extra == "docs"
Requires-Dist: sphinx-autoapi; extra == "docs"
Requires-Dist: sphinx-autobuild; extra == "docs"
Requires-Dist: pydata_sphinx_theme; extra == "docs"
Requires-Dist: sphinxext-opengraph; extra == "docs"
Requires-Dist: sphinx-copybutton; extra == "docs"
Requires-Dist: sphinx-design; extra == "docs"
Requires-Dist: jupyter_sphinx; extra == "docs"
Requires-Dist: sphinx-togglebutton; extra == "docs"
Requires-Dist: sphinx_favicon; extra == "docs"
Requires-Dist: sphinx_sitemap; extra == "docs"
Provides-Extra: dev
Requires-Dist: bumpver; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Provides-Extra: publish
Requires-Dist: build; extra == "publish"
Requires-Dist: twine; extra == "publish"
Dynamic: license-file

# topo-metrics

<div align="center">

![PyPI - Version](https://img.shields.io/pypi/v/topo-metrics)
[![GitHub License](https://img.shields.io/github/license/tcnicholas/topo-metrics)](LICENSE.md)
[![](https://github.com/tcnicholas/topo-metrics/actions/workflows/tests.yaml/badge.svg?branch=main)](https://github.com/tcnicholas/topo-metrics/actions/workflows/tests.yaml)
[![codecov](https://codecov.io/gh/tcnicholas/topo-metrics/graph/badge.svg?token=S3K9PSK7NA)](https://codecov.io/gh/tcnicholas/topo-metrics)
</div>


## Install

```bash
# install Julia (if you haven't already)...
curl -fsSL https://install.julialang.org | sh

# install `topo-metrics` package using UV.
uv venv topo-throwaway --python 3.10
source topo-throwaway/bin/activate
uv pip install topo-metrics
```

## Quickstart

```pycon
>>> from ase.io import read
>>> import topo_metrics as tm
>>>
>>> atoms = read("zeolite-sodalite.cif")
>>> graph = tm.Topology.from_ase(ase_atoms=atoms, cutoff=1.7, remove_types={"O"})
>>> ring_stats = graph.get_clusters()
>>> ring_stats

RingsResults(
  depth=12,
  strong_rings=False,
  ring_size_count=RingSizeCounts(n_rings=46, min=4, max=12),
  VertexSymbol=[4.4.6.6.6.6],
  CARVS={4(2).6(4).12(32)}
)
```

## Documentation

Checkout the [documentation](https://tcnicholas.github.io/topo-metrics/) for 
some more detailed examples of the available functionality.

(This is in working progress...)

## Citation

If you find `topo-metrics` helpful for your research, please cite the preprint 
in which we introduced the `CARVS` notation:

```bibtex
@misc{nicholas2025amof,
  title         = {The structure and topology of an amorphous metal-organic framework},
  author        = {Nicholas, Thomas C. and Thomas du Toit, Daniel F. and Rosset, Louise A. M. and Proserpio, Davide M. and Goodwin, Andrew L. and Deringer, Volker L.},
  year          = {2025},
  month         = mar,
  eprint        = {2503.24367},
  archivePrefix = {arXiv},
  primaryClass  = {cond-mat.mtrl-sci},
  doi           = {10.48550/arXiv.2503.24367},
  url           = {https://arxiv.org/abs/2503.24367}
}
```

`topo-metrics` relies on 
[`PeriodicGraphs.jl`](https://github.com/Liozou/PeriodicGraphs.jl) and the 
topology-identification routines provided by 
[`CrystalNets.jl`](https://github.com/coudertlab/CrystalNets.jl). If you use 
`topo-metrics` in published work, please also cite the `CrystalNets.jl` 
companion article:

```bibtex
@article{zoubritzky2022crystalnets,
  title   = {CrystalNets.jl: Identification of Crystal Topologies},
  author  = {Zoubritzky, Lionel and Coudert, Fran{\c{c}}ois-Xavier},
  journal = {SciPost Chem.},
  volume  = {1},
  number  = {2},
  pages   = {005},
  year    = {2022},
  doi     = {10.21468/SciPostChem.1.2.005},
  url     = {https://scipost.org/SciPostChem.1.2.005}
}
```
