Add matscipy as an ASE v4 neighbour-list plugin - #317
Closed
jameskermode wants to merge 2 commits into
Closed
Conversation
CubicCrystalDislocation.view_cyl (via _plot_DXA_disloc_line) builds a
colour key and segment name with fractions.Fraction(elem) over the DXA
Burgers vector components. Newer OVITO returns segment.true_burgers_vector
as float32, and Fraction() rejects numpy.float32 (it is not a subclass of
Python float, unlike numpy.float64) with:
TypeError: argument should be a string or a Rational instance
This broke the documentation build (docs/applications/cylinder_configurations.ipynb).
Convert each component to a native Python float before passing to Fraction.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Expose matscipy's compiled neighbour list under the `ase.plugins` entry
point group as a NeighborListPlugin named "matscipy", so ASE v4 callers can
select it explicitly via ase.neighborlist.get_neighbor_list("matscipy") (or,
in due course, a calculator's neighbor_list= option). Import is lazy and
selection is never automatic.
- matscipy/_ase_plugin.py: adapter matching ASE's NeighborListFunction
contract (rejects self_interaction=True, which matscipy does not support)
plus a guarded __ase_plugins__ that registers nothing on an ASE without the
v4 plugin API, so plugin discovery never breaks.
- pyproject.toml: ase.plugins entry point.
- matscipy/meson.build: install the new module.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jameskermode
force-pushed
the
add-ase-neighbour-list-plugin
branch
from
June 18, 2026 17:41
4c4df2e to
a4e4f71
Compare
Member
Author
|
Closing without merging. We're integrating the neighbour-list backend via the standalone matscipy-neighbours package instead of adding the ASE plugin to full matscipy — see libAtoms/matscipy-neighbours#2, which adds pip packaging (scikit-build-core) plus the same Rationale: matscipy-neighbours is a slim, separately-installable extraction of |
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.
Summary
Exposes matscipy's compiled neighbour list as a user-selectable neighbour-list backend for ASE 4 (
ase._4), via the singlease.pluginsentry-point group. When matscipy is installed, ASE callers can opt in explicitly:Selection is explicit and never automatic — this only makes the backend available under the name
"matscipy"; ASE still defaults to its built-in"ase"backend.What's here
matscipy/_ase_plugin.py— a thin adapter matching ASE'sNeighborListFunctioncontract (fn(quantities, atoms, cutoff, *, self_interaction=False)). matscipy'sneighbour_listalready returns the same(i, j, d, D, S)flat arrays and quantity letters; the adapter only adds theself_interactionkeyword, rejectingself_interaction=True(which matscipy does not support) rather than silently differing. The heavymatscipy.neighboursimport is lazy (only on call), and the__ase_plugins__registration is guarded so installing matscipy alongside an ASE that predates the v4 plugin API registers nothing instead of breaking plugin discovery.pyproject.toml— declares thease.pluginsentry point (matscipy_neighbours = "matscipy._ase_plugin").matscipy/meson.build— installs the new module.Notes / dependencies
ase.pluginsentry-point group +NeighborListPlugintype). On current released ASE the guard makes this a no-op, so it is safe to merge ahead of that landing.NeighborListPlugin: matscipy's edge sets are byte-identical to ASE's reference backend across fcc, hcp, and mixed-pbc slab systems (cutoffs 3 and 5 Å), theD = pos[j] - pos[i] + S @ cellidentity holds, and matscipy works through ASE's backend-agnostic Verlet skin-reuse wrapper.🤖 Generated with Claude Code