Crystal-shape / coarse-grained morphology analysis library
Project description
cg-pytools
A small library for analysing crystal morphology from CrystoGen (formerly CrystalGrower) - crystal growth simulations: shape characterisation (Zingg ratios, aspect ratios, surface area / volume), Wulff and surface processing, energy-network parsing, and plotting utilities. It also ships example SGE / SLURM job scripts for running CrystoGen + OCC workflows (solvent screens, growth rates, growth modifiers, …) on HPC clusters.
For a full, GUI-driven workflow, see
CGAspects — CrystoGen's official
(PySide6) data-analysis tool for CrystoGen output. cg-pytools is
a stripped-down, lightweight alternative: a scriptable library and command-line
utilities for the same kind of analysis, without the GUI. It is currently
limited in scope, and may in future grow to contain the core of CGAspects.
Installation
pip install cg-pytools
Or, for local development:
git clone https://github.com/CrystoGenLtd/cg-pytools.git
cd cg-pytools
pip install -e .
Usage
from cgpytools import CrystalShape, ShapeAnalyser
crystal = CrystalShape.from_file("crystal.xyz")
analyser = ShapeAnalyser(zingg_method="svd")
analyser.analyse_crystal(crystal)
metrics = analyser.get_all_frame_metrics()
Modules
| Module | Purpose |
|---|---|
crystal_io |
Read crystal shapes / frames (CrystalShape) |
shape_analysis |
Morphology metrics, Zingg classification (ShapeAnalyser) |
surfaces |
Wulff construction and surface/size-file processing |
cg_net |
Interaction-energy network parsing (CGNet) |
plot |
Shared plotting theme and styling helpers |
log |
Logging configuration |
Scripts
Command-line tools live in scripts/python/:
| Script | Depends on | Description |
|---|---|---|
screen.py |
cgpytools |
Main crystal-shape analysis tool (general / solvent / size / movie / CDA modes). See scripts/python/README.md. |
growth_kinetics.py |
numpy, pandas, matplotlib, scipy | Standalone: time-evolution plots of size data from simulation subfolders. |
growth_rates.py |
numpy, pandas, matplotlib | Standalone: growth-rate-vs-supersaturation summaries from size.csv files. |
screen.py imports cgpytools, so install the package first. The two growth_*
scripts are single-file and have no dependency on cgpytools — they can be copied
and run on their own.
HPC job scripts
Example SGE and SLURM job scripts for the CrystoGen + OCC workflows live
under scripts/HPC/ organised by use case (solvent screens,
growth rates, etc.). Each folder has a README.txt describing the inputs
it needs.
Copy the scripts to a folder containing a CIF or other inputs, depending on which job type is to be submitted.
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cg_pytools-0.1.0.tar.gz.
File metadata
- Download URL: cg_pytools-0.1.0.tar.gz
- Upload date:
- Size: 19.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d468905e069656f2c37f564f53e1b385951c21f0e45621a51f977226ad036c0
|
|
| MD5 |
f36a7ca85f48adefbca18c2eac211533
|
|
| BLAKE2b-256 |
d20dc33eabf9e8571622df927f1768888b330744941892eba680a9443a4db34b
|
Provenance
The following attestation bundles were made for cg_pytools-0.1.0.tar.gz:
Publisher:
package.yml on CrystoGenLtd/cg-pytools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cg_pytools-0.1.0.tar.gz -
Subject digest:
5d468905e069656f2c37f564f53e1b385951c21f0e45621a51f977226ad036c0 - Sigstore transparency entry: 1954251926
- Sigstore integration time:
-
Permalink:
CrystoGenLtd/cg-pytools@1707be417dfb329a211e0e7e84f80284756fce6a -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/CrystoGenLtd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
package.yml@1707be417dfb329a211e0e7e84f80284756fce6a -
Trigger Event:
push
-
Statement type:
File details
Details for the file cg_pytools-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cg_pytools-0.1.0-py3-none-any.whl
- Upload date:
- Size: 22.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b666a873727f2d8888d7b773d87729495cb05aab40554daed5da65dcc3b11e4d
|
|
| MD5 |
ebd56c752072022f03cad9485fbfc399
|
|
| BLAKE2b-256 |
4ef845e206f9b5084f38f376acb9582e2bded5d1e4790f3d5209a2c7e0c3c29d
|
Provenance
The following attestation bundles were made for cg_pytools-0.1.0-py3-none-any.whl:
Publisher:
package.yml on CrystoGenLtd/cg-pytools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cg_pytools-0.1.0-py3-none-any.whl -
Subject digest:
b666a873727f2d8888d7b773d87729495cb05aab40554daed5da65dcc3b11e4d - Sigstore transparency entry: 1954252184
- Sigstore integration time:
-
Permalink:
CrystoGenLtd/cg-pytools@1707be417dfb329a211e0e7e84f80284756fce6a -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/CrystoGenLtd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
package.yml@1707be417dfb329a211e0e7e84f80284756fce6a -
Trigger Event:
push
-
Statement type: