Repository navigation
Ase structures - #284
Merged
Merged
Ase structures#284
Conversation
pyscal 4 drops the System class in favour of ASE Atoms and top-level descriptor functions. - helpers: find_solid_fraction reads the dump through Trajectory and calls pyscal3.find_neighbors / find_solids; get_structures uses to_atoms() and keeps returning a list - input: built-in lattices come from pyscal3.structures.make_crystal, which returns ASE Atoms; the per-element structure table is the (private) pyscal3.structures.creator._elements - composition_transformation: pyscal was only a container here; keep the ASE Atoms and a per-atom type list instead - integrators: drop an unused import - require pyscal3>=4.0.0; the conda env files install it via pip until conda-forge has 4.0.0, and list ase explicitly Outputs are identical to pyscal 3.3.2 for solid fractions (Cu01 solid, liquid and a 49-frame melting run, within one atom), generated lattices and composition-transformed data files.
make_lattice builds fcc, bcc, hcp, diamond and simple_cubic (alias sc) single-element crystals in orthogonal cells with ase.build.bulk; hcp uses the 4-atom orthorhombic cell and takes an optional c/a (ideal sqrt(8/3) by default). default_lattice gives an element's ground-state lattice and lattice constant from ase.data.reference_states. Checked against pyscal's make_crystal: same cell and atom positions for all five lattices over several lattice constants and repeats (atom order differs), and the same element defaults for 60 of pyscal's 61 elements (He has no crystal reference state in ASE). ASE additionally covers C, K, V, W and Y.
…pyscal The two lattice branches (no lattice given / a built-in lattice name) become one, with unchanged semantics: an element's ground-state lattice and lattice constant (repeat 5x5x5) when no lattice is given, the element's lattice constant when a built-in lattice is given with lattice_constant 0. calphy.structures also gains a15 (single-element A15, beta-W), built with ase.spacegroup.crystal on Wyckoff sites 2a and 6d so that it matches pyscal's setting. Differences from the pyscal version: - the data file has the same cell and atom positions, in a different atom order; ideal hcp uses c/a = sqrt(8/3) instead of pyscal's 1.633 (c differs by 4 ppm) - sc is accepted for simple_cubic, which the docs already promised - W, V, K, Y, C and Po now have default lattices (Po used to fail on pyscal's 'sc' entry); He no longer does - dhcp, l12 and b2 are no longer offered: none of them could be built for a single element (dhcp has no conventional cell, l12/b2 need two species) - an unknown lattice name reports the built-in names instead of "File ... could not be found"
pyscal's hcp was always built with the ideal c/a, so built-in hcp Zn, Mg or Ti started from the wrong cell. c_over_a (> 0, optional) sets c/a for hcp, both for lattice: hcp and for an element whose default lattice is hcp; left out it stays the ideal sqrt(8/3). Setting it for any other lattice, a structure file or a materials project id is an error.
List the built-in lattice names that actually work (sc was documented but never accepted before), describe the cells, the element defaults used when lattice is left out, and the new c_over_a input. The dependency list names ase for structures and pyscal3 >= 4 for solid detection.
calphy imports ase for structure creation and I/O; it used to arrive only through pyscal3.
…ntries lattice, reference_phase and lattice_constant were documented as accepting lists, which the input model rejects, and the reference_phase example used a 'state' key that does not exist. Describe where the default lattice constant comes from, that it overrides lattice_constant when lattice is left out, and what repeat does for built-in lattices and Materials Project structures.
pandas 3 stores text columns with a string dtype that turns None into NaN, so error_code of a successful run came back as NaN instead of None (test_damaged_sweep_file_does_not_abort_the_gather failed in CI, which resolved pandas 3.0.6). Build text columns as object, which is what pandas 2 did.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.