Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cg_pytools-0.1.0.tar.gz (19.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cg_pytools-0.1.0-py3-none-any.whl (22.1 kB view details)

Uploaded Python 3

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

Hashes for cg_pytools-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5d468905e069656f2c37f564f53e1b385951c21f0e45621a51f977226ad036c0
MD5 f36a7ca85f48adefbca18c2eac211533
BLAKE2b-256 d20dc33eabf9e8571622df927f1768888b330744941892eba680a9443a4db34b

See more details on using hashes here.

Provenance

The following attestation bundles were made for cg_pytools-0.1.0.tar.gz:

Publisher: package.yml on CrystoGenLtd/cg-pytools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for cg_pytools-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b666a873727f2d8888d7b773d87729495cb05aab40554daed5da65dcc3b11e4d
MD5 ebd56c752072022f03cad9485fbfc399
BLAKE2b-256 4ef845e206f9b5084f38f376acb9582e2bded5d1e4790f3d5209a2c7e0c3c29d

See more details on using hashes here.

Provenance

The following attestation bundles were made for cg_pytools-0.1.0-py3-none-any.whl:

Publisher: package.yml on CrystoGenLtd/cg-pytools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page