Reference — Chemfiles conversion and selection¶
Note
Diátaxis reference. Learning path: Convert other formats into CON.
Executable Org: Executable Chemfiles notebook (scripts/run-chemfiles-notebook.sh).
Convert other formats into CON; for tasks see How-to — Chemfiles conversion and selection; for rationale see
Explanation — Chemfiles ingress and CON topology. Binding-wide matrices live in Language bindings; on-disk bonds
key in The CON File Format Specification.
Feature and install matrix¶
Build |
Cargo |
PyPI |
|
|---|---|---|---|
Lean |
default features |
|
false (stubs) |
Full |
|
|
true |
Full editable |
|
n/a |
true |
Optional extra on lean package: readcon[chemfiles] → depends on
readcon-chemfiles==X.Y.Z (same version; avoid installing both modules).
Rust modules¶
Module |
Role |
|---|---|
|
Foreign format → |
|
Selection grammar on |
Import (full feature)
Function |
Purpose |
|---|---|
|
Single chemfiles frame |
|
First step of a file |
|
All steps |
|
Buffer + format name ( |
|
Topology → |
|
|
Import (stubs without feature): path/memory helpers return
ChemfilesImportError::FeatureDisabled. con_frame_from_chemfiles is only
available with the feature (needs chemfiles::Frame in the signature).
Selection (always available; stubs error without feature)
Item |
Purpose |
|---|---|
|
Match payload |
|
Full result |
|
Atom context → sorted unique indices |
|
Context size only |
Constants: CHEMFILES_EXTRA_PREFIX, CHEMFILES_ATOM_PROPS_KEY,
CHEMFILES_ATOM_NAMES_KEY, CHEMFILES_ATOM_TYPES_KEY.
Error: ChemfilesImportError (Chemfiles / InvalidFrame / Io /
FeatureDisabled; Chemfiles variant only in full builds).
Python (import readcon)¶
API |
Lean wheel |
|
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
error |
dict |
|
error |
|
|
yes |
yes |
|
yes |
yes |
select / select_on_frame dict keys: selection, context_size, matches
(list[list[int]]), primary_indices. format for memory import is a
chemfiles name ("XYZ", "PDB", "GRO", …).
C / C++¶
Symbol |
Notes |
|---|---|
|
0 or 1 |
|
Fills |
|
Always declared |
|
C++ RAII; throws if support is 0 |
|
C++ |
CON metadata keys (topology / sidecars)¶
Key |
Meaning |
|---|---|
|
Array of |
|
Display names, chemfiles/=atom_id= order |
|
Atomic types, parallel to names |
|
Per-atom property bags |
|
Unmapped frame properties |
See The CON File Format Specification § frame topology for normative wording.
Selection grammar (implemented on CON frames)¶
Pattern |
Needs |
Context size |
|---|---|---|
|
no |
1 |
|
yes for topology filters |
2 |
|
yes (derived) |
3 |
|
yes (derived) |
4 |
|
yes |
2 / 3 / 4 |
These patterns are what CON selection implements (tests under
chemfiles_selection_cpp_regression for topology cases). Format limits
(resname, properties, impropers, geometry thresholds) are CON limits—see
chemfiles-explain.org (What selection cannot see on CON). The optional
conversion stack may reuse a third-party grammar engine; that is an
implementation detail, not a second public API surface.
CI / release artifacts¶
Workflow |
Produces |
|---|---|
|
PyPI |
|
PyPI |
|
crates.io |
Pending/active trusted publishers must use exact PyPI names readcon and
readcon-chemfiles.