readcon 0.17.2__cp315-cp315-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
readcon/__init__.py ADDED
@@ -0,0 +1,5 @@
1
+ from .readcon import *
2
+
3
+ __doc__ = readcon.__doc__
4
+ if hasattr(readcon, "__all__"):
5
+ __all__ = readcon.__all__
Binary file
@@ -0,0 +1,386 @@
1
+ Metadata-Version: 2.4
2
+ Name: readcon
3
+ Version: 0.17.2
4
+ Classifier: Development Status :: 4 - Beta
5
+ Classifier: Intended Audience :: Science/Research
6
+ Classifier: Topic :: Scientific/Engineering :: Chemistry
7
+ Classifier: Topic :: Scientific/Engineering :: Physics
8
+ Classifier: Programming Language :: Rust
9
+ Classifier: Programming Language :: Python :: Implementation :: CPython
10
+ Requires-Dist: readcon-chemfiles==0.17.2 ; extra == 'chemfiles'
11
+ Provides-Extra: chemfiles
12
+ License-File: LICENSE
13
+ Summary: Python bindings for readcon-core CON/convel file parser
14
+ Keywords: parser,comp-chem,file-format,con,eon
15
+ Home-Page: https://lode-org.github.io/readcon-core/
16
+ License-Expression: MIT
17
+ Requires-Python: >=3.10
18
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
19
+ Project-URL: Changelog, https://github.com/lode-org/readcon-core/blob/main/CHANGELOG.md
20
+ Project-URL: Documentation, https://lode-org.github.io/readcon-core/
21
+ Project-URL: Homepage, https://github.com/lode-org/readcon-core
22
+ Project-URL: Issues, https://github.com/lode-org/readcon-core/issues
23
+ Project-URL: Repository, https://github.com/lode-org/readcon-core
24
+
25
+
26
+ # Table of Contents
27
+
28
+ 1. [About](#org8a516dd)
29
+ 1. [Features](#orge280c29)
30
+ 2. [Migrate onto CON](#org9a4c2eb)
31
+ 3. [Install](#org34cb29e)
32
+ 4. [Tutorial](#org096ec3a)
33
+ 5. [Design Decisions](#org518562a)
34
+ 1. [FFI Layer](#orgd88ce4e)
35
+ 6. [Specification](#org82eb141)
36
+ 1. [CON format](#orgcefba1f)
37
+ 2. [convel format](#org521e4d3)
38
+ 7. [Capabilities](#org112ad98)
39
+ 8. [Citation](#org0dc7c45)
40
+ 2. [License](#org5fa1ad7)
41
+
42
+
43
+ <a id="org8a516dd"></a>
44
+
45
+ # About
46
+
47
+ `readcon-core` is the reference implementation of versioned `.con` / `.convel`.
48
+ Rare-event codes already checkpoint on CON. This library is the spec and
49
+ the hourglass API so the rest of the atomistic stack reads the same file
50
+ everywhere:
51
+ optimizers, potential drivers, analysis tools, and ML
52
+ hand-off.
53
+
54
+ One frame is complete: cell, type-grouped coordinates, per-direction
55
+ fixed masks, column-5 `atom_id`, optional per-atom sections (velocities,
56
+ forces, energies, charges, spins, magmoms, displacements, spreads), and JSON metadata (spec
57
+ v2-v3, [docs/orgmode/spec.org](docs/orgmode/spec.org)).
58
+ Saddle, dimer, and NEB codes already depend on that payload.
59
+
60
+ <table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
61
+
62
+
63
+ <colgroup>
64
+ <col class="org-left" />
65
+
66
+ <col class="org-left" />
67
+ </colgroup>
68
+ <tbody>
69
+ <tr>
70
+ <td class="org-left">Layer</td>
71
+ <td class="org-left">Role</td>
72
+ </tr>
73
+
74
+ <tr>
75
+ <td class="org-left">Spec + hot path</td>
76
+ <td class="org-left">Spec v3 parse/write, <code>validate</code>, units, <code>sections</code>, SoA, Cachegrind CI</td>
77
+ </tr>
78
+
79
+ <tr>
80
+ <td class="org-left">Hourglass ABI</td>
81
+ <td class="org-left">C / C++ / Python / Julia / Fortran (<code>rkr_*</code>): link CON into any language</td>
82
+ </tr>
83
+
84
+ <tr>
85
+ <td class="org-left">Device / ML hand-off</td>
86
+ <td class="org-left">DLPack (optional CUDA); optional metatensor <code>TensorBlock</code> without leaving CON authority</td>
87
+ </tr>
88
+
89
+ <tr>
90
+ <td class="org-left">Ingress</td>
91
+ <td class="org-left">Chemfiles import/selection: foreign structures <b>into</b> CON</td>
92
+ </tr>
93
+
94
+ <tr>
95
+ <td class="org-left">Corpora</td>
96
+ <td class="org-left"><code>index_proj</code> + <a href="https://github.com/lode-org/readcon-db">readcon-db</a> (<code>cargo add</code> / <code>pip install</code>; <a href="https://lode-org.github.io/readcon-db/docs/">docs</a>)</td>
97
+ </tr>
98
+ </tbody>
99
+ </table>
100
+
101
+ Already on that path: rare-event clients, rgpot, rgpycrumbs, ASE adapters,
102
+ amsel, and anything that takes DLPack or metatensor blocks.
103
+
104
+ Rust rewrite of [readCon](https://github.com/HaoZeke/readCon). Chemfiles owns
105
+ format diversity at the edge; this crate owns CON fidelity on the wire and in
106
+ memory.
107
+
108
+ Measurements: Cachegrind I-refs (`examples/cachegrind_harness.rs`);
109
+ Python ASV + spyglass on PRs (`benchmarks/`); CON peers via
110
+ `benches/compare_readers.py` (and other scripts under `benches/`).
111
+ See [docs/orgmode/benchmarks.org](docs/orgmode/benchmarks.org).
112
+
113
+
114
+ <a id="orge280c29"></a>
115
+
116
+ ## Features
117
+
118
+ - **CON and convel:** Coordinates; optional sections declared in `sections`
119
+ (velocities, forces, energies, charges, spins, magmoms, displacements, spreads). Velocities also
120
+ auto-detect on legacy `.convel` without a `sections` key.
121
+ - **Lazy iteration:** `ConFrameIterator`; `next_with_raw_span` keeps the on-disk blob for corpus ingest.
122
+ - **Hot path:** [fast-float2](https://github.com/aldanor/fast-float-rust), [memmap2](https://docs.rs/memmap2), Cachegrind-tracked scenarios.
123
+ - **Parallel frames:** Rayon behind the `parallel` Cargo feature.
124
+ - **Bindings:** Python (PyO3), Julia (ccall), C (shipped header), C++ (RAII header), Fortran (fpm); hourglass ABI patterned on [metatensor](https://github.com/metatensor/metatensor).
125
+ - **Metadata helpers:** Typed `energy`, `frame_index`, `time`, `timestep`, `neb_bead`, `neb_band` across bindings; raw JSON still available.
126
+ - **Validation:** `validate=true` enforces finiteness, reserved keys, geometry, labels, symbols, section presence, identity columns.
127
+ - **Fidelity:** `atom_id`, per-direction fixed masks, and declared optional sections round-trip through the core reader/writer.
128
+ - **Corpora:** Pair with [readcon-db](https://github.com/lode-org/readcon-db) (CON-text indexes, dedup, multi-reader; [docs](https://lode-org.github.io/readcon-db/docs/)).
129
+ - **RPC:** Cap'n Proto behind the `rpc` feature.
130
+
131
+
132
+ <a id="org9a4c2eb"></a>
133
+
134
+ ## Migrate onto CON
135
+
136
+ Why switch: use a real frame API and multi-language library instead of
137
+ hand-rolling XYZ and a private atoms object.
138
+
139
+ - **API:** parse/write, builders, metadata, validation, compression, lazy multi-frame iteration
140
+ - **Payload:** constraints, `atom_id`, optional sections, versioned JSON on one frame
141
+ - **Selection:** `select_atoms` / `rkr_frame_select` (`name H`, bonds/angles when topology is present)
142
+ - **Languages:** hourglass `rkr_*` in Fortran / C / C++ / Python / Julia / Rust (same semantics when you add a language)
143
+ - **Corpora:** [readcon-db](https://github.com/lode-org/readcon-db) on CON text (energy / formula / sections, dedup, multi-reader; [docs](https://lode-org.github.io/readcon-db/docs/))
144
+ - **Plotting:** [chemparseplot](https://chemparseplot.rgoswami.me) (+ [rgpycrumbs](https://rgpycrumbs.rgoswami.me)) on the same files
145
+ - **Measurements:** Cachegrind I-refs; PR ASV + spyglass; peer scripts in `benches/`. [benchmarks.org](docs/orgmode/benchmarks.org)
146
+
147
+ # foreign → CON (needs --features chemfiles)
148
+ cargo run --release --features chemfiles -- convert structure.xyz structure.con
149
+ # Python (readcon-chemfiles or maturin --features python,chemfiles)
150
+ # python -c "import readcon; readcon.convert_to_con('structure.xyz','structure.con')"
151
+
152
+ How-to: [docs/orgmode/migrate.org](docs/orgmode/migrate.org). Chemfiles path (CI-run):
153
+ [chemfiles-notebook](docs/orgmode/chemfiles-notebook.org). Corpora:
154
+ [readcon-db docs](https://lode-org.github.io/readcon-db/docs/). Plotting:
155
+ [chemparseplot](https://chemparseplot.rgoswami.me).
156
+
157
+
158
+ <a id="org34cb29e"></a>
159
+
160
+ ## Install
161
+
162
+ <table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
163
+
164
+
165
+ <colgroup>
166
+ <col class="org-left" />
167
+
168
+ <col class="org-left" />
169
+
170
+ <col class="org-left" />
171
+ </colgroup>
172
+ <thead>
173
+ <tr>
174
+ <th scope="col" class="org-left">Language</th>
175
+ <th scope="col" class="org-left">Install</th>
176
+ <th scope="col" class="org-left">Destination</th>
177
+ </tr>
178
+ </thead>
179
+ <tbody>
180
+ <tr>
181
+ <td class="org-left">Rust</td>
182
+ <td class="org-left"><code>cargo add readcon-core</code></td>
183
+ <td class="org-left"><a href="https://docs.rs/readcon-core">docs.rs</a></td>
184
+ </tr>
185
+
186
+ <tr>
187
+ <td class="org-left">Python</td>
188
+ <td class="org-left"><code>pip install readcon</code></td>
189
+ <td class="org-left"><a href="https://pypi.org/project/readcon/">PyPI</a></td>
190
+ </tr>
191
+
192
+ <tr>
193
+ <td class="org-left">Python + chemfiles</td>
194
+ <td class="org-left"><code>pip install readcon-chemfiles</code></td>
195
+ <td class="org-left"><a href="https://pypi.org/project/readcon-chemfiles/">PyPI</a></td>
196
+ </tr>
197
+
198
+ <tr>
199
+ <td class="org-left">readcon-db</td>
200
+ <td class="org-left"><code>cargo add readcon-db</code> / <code>pip install readcon-db</code></td>
201
+ <td class="org-left"><a href="https://lode-org.github.io/readcon-db/docs/">docs</a></td>
202
+ </tr>
203
+
204
+ <tr>
205
+ <td class="org-left">Julia</td>
206
+ <td class="org-left"><code>julia --project=julia/ReadCon -e 'using Pkg; Pkg.instantiate()'</code></td>
207
+ <td class="org-left"><a href="docs/orgmode/bindings.html">bindings</a></td>
208
+ </tr>
209
+
210
+ <tr>
211
+ <td class="org-left">C / C++ CMake</td>
212
+ <td class="org-left"><code>FetchContent</code> / <code>find_package(readcon-core)</code> (cxx tarball)</td>
213
+ <td class="org-left">headers + <code>libreadcon_core</code> + <code>readcon-core.pc</code></td>
214
+ </tr>
215
+
216
+ <tr>
217
+ <td class="org-left">C / C++ Meson</td>
218
+ <td class="org-left"><code>dependency('readcon-core')</code> (in-tree wrap-file)</td>
219
+ <td class="org-left">same</td>
220
+ </tr>
221
+
222
+ <tr>
223
+ <td class="org-left">C / C++ cargo-c</td>
224
+ <td class="org-left"><code>cargo cinstall --release --prefix /usr/local</code></td>
225
+ <td class="org-left">same</td>
226
+ </tr>
227
+ </tbody>
228
+ </table>
229
+
230
+ The C/C++ headers are **shipped** (`include/readcon-core.h`). cbindgen is a maintainer tool, not a consumer dependency. C99 (`readcon-core.h`) or C++17 (`readcon-core.hpp`) compiler. FetchContent URL: `readcon-core-cxx-$VERSION.tar.gz` on the GitHub Release.
231
+ Full matrix: [getting-started](docs/orgmode/getting-started.org).
232
+
233
+
234
+ <a id="org096ec3a"></a>
235
+
236
+ ## Tutorial
237
+
238
+ Install, read a multi-frame fixture, inspect `atom_id`, write a
239
+ round-trip, build a frame with energy. Full steps:
240
+ [docs/orgmode/tutorial.org](docs/orgmode/tutorial.org) (or the published HTML `tutorial` page).
241
+
242
+ Short Python path from the repository root:
243
+
244
+ import readcon
245
+
246
+ for frame in readcon.iter_con("resources/test/tiny_multi_cuh2.con"):
247
+ print(frame.cell, len(frame), frame.energy)
248
+
249
+ frames = readcon.read_con("resources/test/tiny_multi_cuh2.con")
250
+ readcon.write_con("out.con", frames)
251
+
252
+ atoms = [readcon.Atom("Cu", 0.0, 0.0, 0.0, atom_id=0, mass=63.546)]
253
+ frame = readcon.ConFrame(cell=[10.0, 10.0, 10.0], angles=[90.0, 90.0, 90.0], atoms=atoms)
254
+ frame.set_energy(-42.5)
255
+ frame.write_con("built.con")
256
+
257
+ Rust smoke (same fixture):
258
+
259
+ cargo run --example rust_usage -- resources/test/tiny_multi_cuh2.con
260
+
261
+ Other languages and task recipes: [docs/orgmode/howto.org](docs/orgmode/howto.org).
262
+ Conversion from XYZ/PDB/GRO: [chemfiles-tutorial](docs/orgmode/chemfiles-tutorial.org).
263
+
264
+
265
+ <a id="org518562a"></a>
266
+
267
+ ## Design Decisions
268
+
269
+ - **Lazy parsing:** `ConFrameIterator` parses one frame at a time for large trajectories.
270
+ - **Hourglass FFI:** shipped C header plus a hand-written C++ RAII wrapper, same pattern as [metatensor](https://github.com/metatensor/metatensor). CMake FetchContent, Meson wrap, and `readcon-core.pc` do not run cbindgen.
271
+
272
+
273
+ <a id="orgd88ce4e"></a>
274
+
275
+ ### FFI Layer
276
+
277
+ Two exposure modes:
278
+
279
+ 1. **Opaque handles** (`RKRConFrame*`): client calls Rust accessors
280
+ (`rkr_frame_get_header_line`, …). Hides layout; ABI can evolve behind the
281
+ handle.
282
+ 2. **Transparent `#[repr(C)]` extract** (`rkr_frame_to_c_frame` → `CFrame`):
283
+ client owns a flat atom table for hot loops and frees it with
284
+ `free_c_frame`.
285
+
286
+
287
+ <a id="org82eb141"></a>
288
+
289
+ ## Specification
290
+
291
+ See [docs/orgmode/spec.org](docs/orgmode/spec.org) (or the [published HTML build](https://lode-org.github.io/readcon-core/spec.html)) for the full specification. A summary follows.
292
+
293
+
294
+ <a id="orgcefba1f"></a>
295
+
296
+ ### CON format
297
+
298
+ - A 9-line header (comments, cell dimensions, cell angles, atom type/count/mass metadata)
299
+ - Line 2 is reserved for spec-v2 JSON metadata
300
+ - Per-type coordinate blocks (symbol, label, atom lines with x y z fixed atomID)
301
+ - Optional spec-v2 `sections` and `validate` metadata for declared per-atom sections and strict validation
302
+ - Multiple frames are concatenated directly with no separator
303
+
304
+
305
+ <a id="org521e4d3"></a>
306
+
307
+ ### convel format
308
+
309
+ Same as CON, with an additional velocity section after each frame's coordinates:
310
+
311
+ - A blank separator line
312
+ - Per-type velocity blocks (symbol, label, atom lines with vx vy vz fixed atomID)
313
+
314
+
315
+ <a id="org112ad98"></a>
316
+
317
+ ## Capabilities
318
+
319
+ <table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
320
+
321
+
322
+ <colgroup>
323
+ <col class="org-left" />
324
+
325
+ <col class="org-left" />
326
+ </colgroup>
327
+ <thead>
328
+ <tr>
329
+ <th scope="col" class="org-left">Area</th>
330
+ <th scope="col" class="org-left">Surface</th>
331
+ </tr>
332
+ </thead>
333
+ <tbody>
334
+ <tr>
335
+ <td class="org-left">Payload</td>
336
+ <td class="org-left">Constraints, <code>atom_id</code>; optional velocities / forces / energies / charges / spins / magmoms / displacements / spreads; versioned JSON</td>
337
+ </tr>
338
+
339
+ <tr>
340
+ <td class="org-left">Languages</td>
341
+ <td class="org-left">One <code>rkr_*</code> surface for Fortran / C / C++ / Python / Julia</td>
342
+ </tr>
343
+
344
+ <tr>
345
+ <td class="org-left">Spec</td>
346
+ <td class="org-left">v2-v3, <code>validate=true</code>, declared sections (including optional physics blocks above), units (v3)</td>
347
+ </tr>
348
+
349
+ <tr>
350
+ <td class="org-left">Tensors</td>
351
+ <td class="org-left">DLPack; optional metatensor <code>TensorBlock</code></td>
352
+ </tr>
353
+
354
+ <tr>
355
+ <td class="org-left">Corpora</td>
356
+ <td class="org-left"><code>index_proj</code> + <a href="https://github.com/lode-org/readcon-db">readcon-db</a> (<a href="https://lode-org.github.io/readcon-db/docs/">docs</a>)</td>
357
+ </tr>
358
+
359
+ <tr>
360
+ <td class="org-left">Import</td>
361
+ <td class="org-left">Optional chemfiles → CON</td>
362
+ </tr>
363
+
364
+ <tr>
365
+ <td class="org-left">Measurements</td>
366
+ <td class="org-left">Cachegrind I-refs; PR ASV + spyglass; <code>benches/compare_readers.py</code></td>
367
+ </tr>
368
+ </tbody>
369
+ </table>
370
+
371
+ Predecessor: [readCon](https://github.com/HaoZeke/readCon).
372
+
373
+
374
+ <a id="org0dc7c45"></a>
375
+
376
+ ## Citation
377
+
378
+ If you use `readcon-core` in academic work, please cite it via the metadata in [CITATION.cff](CITATION.cff). A Zenodo DOI is minted on a freeze tag and recorded in `CITATION.cff` identifiers; this tree does not invent one.
379
+
380
+
381
+ <a id="org5fa1ad7"></a>
382
+
383
+ # License
384
+
385
+ MIT.
386
+
@@ -0,0 +1,7 @@
1
+ readcon/__init__.py,sha256=7z3LWUozbHdddfkRnmHw1Hby_a6NDUw6evJGTO-pkp8,111
2
+ readcon/readcon.cp315-win_amd64.pyd,sha256=fmIuQij8HBkZM16B8ke22pdJywMO2fyvZEiZNi2W7mY,1851392
3
+ readcon-0.17.2.dist-info/METADATA,sha256=ofRKVZpcm7LPFGormbLNAoFwDOP6Cqa-EFm2Itu9Sq4,14375
4
+ readcon-0.17.2.dist-info/WHEEL,sha256=Q5QdGvjBfn8x6ihg-B4VQuuGKk7DT67L9DVrwEH_qj8,97
5
+ readcon-0.17.2.dist-info/licenses/LICENSE,sha256=KK4LtwMiGd7hP6dksyXdDN44MCr2QhM65fjnLDCxVC4,1142
6
+ readcon-0.17.2.dist-info/sboms/readcon-core.cyclonedx.json,sha256=zjLN6xOg-UZOQr4bwknfcK_tEPXMqzcpfCUnRFTDq7Y,52879
7
+ readcon-0.17.2.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: maturin (1.16.0)
3
+ Root-Is-Purelib: false
4
+ Tag: cp315-cp315-win_amd64
@@ -0,0 +1,19 @@
1
+ MIT License Copyright (c) 2025 Rohit Goswami <rgoswami[at]ieee.org>
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is furnished
8
+ to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice (including the next
11
+ paragraph) shall be included in all copies or substantial portions of the
12
+ Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
17
+ OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
19
+ OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.