ase-extxyz
ASE I/O plugin that wires the extxyz
C parser into ASE's read / write machinery.
Install
pip install ase-extxyz
This pulls in extxyz (the parser, with native binary wheels) and ase.
Use
import ase.io
from ase.build import bulk
atoms = bulk('Cu') * 2
ase.io.write('out.xyz', atoms, format='cextxyz')
back = ase.io.read('out.xyz', format='cextxyz')
The plugin registers a format named cextxyz (not extxyz — that name is
already taken by ASE's built-in regex-based reader). Pass format='cextxyz'
explicitly; auto-detection by extension is intentionally disabled to avoid
clashing with the built-in.
Streaming output during optimization / MD
For long runs you don't want to reopen the file on every step. Use
ExtXYZTrajectoryWriter — it opens the libc FILE* once and writes
each frame through the C writer directly:
from ase.optimize import LBFGS
from ase_extxyz.io import ExtXYZTrajectoryWriter
with ExtXYZTrajectoryWriter('opt.xyz', atoms=atoms) as traj:
opt = LBFGS(atoms)
opt.attach(traj, interval=1) # opt calls traj() per step
opt.run(fmax=1e-3)
opt.attach(traj) works because the writer is callable; traj() is
equivalent to traj.write(atoms) using the atoms captured at construction.
What this is not
ase-extxyz is a thin translation layer between extxyz.Frame (a
plain-Python dict + numpy dataclass) and ase.Atoms. The fast C parser
lives in the extxyz package; install that alone if you don't need ASE.
License
MIT — same as extxyz.
Metadata
Release files for ase-extxyz 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ase_extxyz-0.1.2.tar.gz | 7.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ase_extxyz-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.5 kB
Release files / ase_extxyz-0.1.2.tar.gz
| Download URL | ase_extxyz-0.1.2.tar.gz |
|---|---|
| Size | 7.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f9c76cbedc1d32237928132eb5437f1a4f3d3cace8b1c1504314c2a6d9d48fa4
|
|
BLAKE2b-256 checksum How to use checksums |
b1c1f6fb446b8dd6ef5f609c0a6ce63a7ffa983b1a90b7f363b95cef8c2647cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / ase_extxyz-0.1.2-py3-none-any.whl
| Download URL | ase_extxyz-0.1.2-py3-none-any.whl |
|---|---|
| Size | 8.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
00c7569d24eff4183659877a20334504eeae4483be8bf1ac478426684fe7cea5
|
|
BLAKE2b-256 checksum How to use checksums |
4cc3b20fea103b9a0e0bdf108dd2babd5fe3a39549a18ac15c4af906fb4c51a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|