Skip to content

Releases: bjmorgan/hofmann

v0.15.0

03 Apr 21:16
363d493

Choose a tag to compare

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_data is now a validated AtomData container 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

01 Apr 09:02
a29aa71

Choose a tag to compare

  • Fixed bond completion missing padding image atoms near cell boundaries. Padding atoms now get their full coordination shell, matching physical atoms.

v0.14.1

30 Mar 09:27
139e4f7

Choose a tag to compare

Bug fix

  • Fixed cell edge lines being clipped at atoms that are not drawn. Atoms hidden by PolyhedronSpec.hide_centre, AtomStyle.visible=False, hide_vertices, or slab clipping no longer produce spurious gaps in cell outline edges. (#41)

v0.14.0

11 Mar 12:07
85df279

Choose a tag to compare

What's new

  • Breaking: Frame now carries a lattice field (shape (3, 3) or None). The lattice field on StructureScene has been replaced by a read-only property that delegates to frames[0].lattice. Code that constructed a StructureScene with lattice=... should move the lattice onto each Frame instead. 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 and StructureScene.from_ase() classmethod for building scenes directly from ASE Atoms objects, without requiring pymatgen. Supports both periodic and non-periodic systems, single structures and trajectories (list[Atoms] or ase.io.Trajectory), and the same style, bond, polyhedra, and view options as from_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.0

v0.13.1

26 Feb 13:07
1c30289

Choose a tag to compare

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.

  • pymatgen is now included in the docs optional extra
  • Set SKIP_IMAGE_GEN=1 to skip figure generation during rapid local iteration

v0.13.0

26 Feb 12:49
4a6cd87

Choose a tag to compare

Breaking: LegendItem subclass hierarchy

LegendItem is now an abstract base class. Use the concrete subclasses:

  • AtomLegendItem — circle markers
  • PolygonLegendItem — 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

  • PolyhedronLegendItem gains a rotation parameter 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

25 Feb 20:33
2db38e8

Choose a tag to compare

Add 3D polyhedron icons to the legend system, complementing existing flat circle and polygon markers.

Highlights:

  • New polyhedron field on LegendItem — supported shapes are "octahedron", "tetrahedron", and "cuboctahedron"
  • Per-item edge_colour and edge_width with fallback to scene-level outline settings
  • from_polyhedron_spec() factory classmethod for convenient construction from existing specs
  • polyhedra_shading parameter 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

25 Feb 09:28
90d3e88

Choose a tag to compare

Internal refactor: extract legend rendering from painter.py into a dedicated legend.py module, and move the shared widget scaling constant into _widget_scale.py.

No behaviour change. Preparatory work for #29.

v0.11.0

24 Feb 21:43
bb3982f

Choose a tag to compare

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.

v0.10.2

22 Feb 14:50
a3fa8b7

Choose a tag to compare

Replace four parallel per-polyhedron lists in the rendering pipeline with a single frozen dataclass, making the coupling between visual properties explicit.

See changelog for details.