Releases: bjmorgan/hofmann
v0.15.0
What's new
-
Interactive viewer: frame indicator (
f), go-to-frame (g),
set-step (s), and step-aware frame navigation. -
New
StructureScene.render_animation()method for exporting
trajectories as GIF or MP4 animations. -
atom_datais now a validatedAtomDatacontainer that checks
array shapes on assignment. It also accepts 2-D arrays of shape
(n_frames, n_atoms)so that colourmap-based colouring can vary
per frame in animations and the interactive viewer.
v0.14.2
v0.14.1
v0.14.0
What's new
-
Breaking:
Framenow carries alatticefield (shape(3, 3)orNone). Thelatticefield onStructureScenehas been replaced by a read-only property that delegates toframes[0].lattice. Code that constructed aStructureScenewithlattice=...should move the lattice onto eachFrameinstead. This correctly supports NPT (variable-cell) trajectories where the unit cell changes between frames. Rendering functions now resolve the lattice from the current frame, so cell edges, periodic bonds, and axes widgets update per frame. -
New
from_ase()constructor andStructureScene.from_ase()classmethod for building scenes directly from ASEAtomsobjects, without requiring pymatgen. Supports both periodic and non-periodic systems, single structures and trajectories (list[Atoms]orase.io.Trajectory), and the same style, bond, polyhedra, and view options asfrom_pymatgen. ASE is available as an optional dependency:pip install "hofmann[ase]".from_ase()stores the lattice per frame, correctly supporting NPT trajectories where the cell changes between frames.
Install
pip install hofmann==0.14.0v0.13.1
Documentation figures are now generated at Sphinx build time via a builder-inited hook, rather than being pre-generated and committed to the repository. This ensures figures always reflect the current rendering code.
pymatgenis now included in thedocsoptional extra- Set
SKIP_IMAGE_GEN=1to skip figure generation during rapid local iteration
v0.13.0
Breaking: LegendItem subclass hierarchy
LegendItem is now an abstract base class. Use the concrete subclasses:
AtomLegendItem— circle markersPolygonLegendItem— regular-polygon markers (sides,rotation)PolyhedronLegendItem— miniature 3D icons (shape,rotation)
Migration
LegendItem(key=..., colour=...)→AtomLegendItem(key=..., colour=...)LegendItem(key=..., colour=..., sides=6)→PolygonLegendItem(key=..., colour=..., sides=6)LegendItem(key=..., colour=..., polyhedron="octahedron")→PolyhedronLegendItem(key=..., colour=..., shape="octahedron")LegendItem.from_polyhedron_spec(...)→PolyhedronLegendItem.from_polyhedron_spec(...)
Serialisation: to_dict() now includes a "type" discriminator. Saved style files from 0.12.x containing polygon or polyhedron legend items must be re-saved.
New features
PolyhedronLegendItemgains arotationparameter accepting a(3, 3)rotation matrix or an(Rx, Ry)tuple of angles in degrees.
Bug fixes
- Fix legend edge width scaling: legend marker outlines were incorrectly multiplied by the widget display-space scaling factor.
v0.12.0
Add 3D polyhedron icons to the legend system, complementing existing flat circle and polygon markers.
Highlights:
- New
polyhedronfield onLegendItem— supported shapes are "octahedron", "tetrahedron", and "cuboctahedron" - Per-item
edge_colourandedge_widthwith fallback to scene-level outline settings from_polyhedron_spec()factory classmethod for convenient construction from existing specspolyhedra_shadingparameter controls Lambertian shading strength (0 = flat, 1 = full)- Fix bounding box computation in
render_legend()to account for edge linewidth
See changelog for details.
v0.11.1
v0.11.0
Introduce LegendItem and custom legend entries, allowing fully custom legends for colour_by data or polyhedra indicators.
Highlights:
- New LegendItem class with polygon markers (sides, rotation), per-entry spacing (gap_after), and marker face opacity (alpha)
- LegendStyle.items parameter for user-provided legend entries
- Standalone legend crop now includes polygon markers
See changelog for details.