Skip to content

Ase structures - #284

Merged
srmnitc merged 9 commits into
mainfrom
ase-structures
Sep 29, 2026
Merged

srmnitc merged 9 commits into
mainfrom
ase-structures

Conversation

@srmnitc

@srmnitc srmnitc commented Sep 29, 2026

Copy link
Copy Markdown
Member

No description provided.

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.
@srmnitc
srmnitc merged commit 66c176e into main Sep 29, 2026
6 checks passed
@srmnitc
srmnitc deleted the ase-structures branch October 6, 2026 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant