Skip to content

Releases: bjmorgan/hofmann

v0.9.0

Choose a tag to compare

@bjmorgan bjmorgan released this 21 Feb 11:19
80bdc70

Render-time periodic boundary pipeline with explicit image tracking.

See changelog for details.

v0.8.0

Choose a tag to compare

@bjmorgan bjmorgan released this 20 Feb 12:03
c2f8372

Restructure codebase into model/, construction/, rendering/ packages.

See changelog for details.

v0.7.1

Choose a tag to compare

@bjmorgan bjmorgan released this 20 Feb 08:47
9fc5704

What's new

  • Performance — Fix quadratic array growth in _merge_expansions during periodic boundary expansion, matching the O(1) deduplication pattern already used by _expand_neighbour_shells.

  • Construction-time validationBondSpec, AtomStyle, PolyhedronSpec, and ViewState now validate their numeric fields at construction time, raising ValueError for out-of-range values (e.g. negative radii, min_length > max_length, alpha outside [0, 1], non-positive zoom or view_distance). StructureScene validates that every frame has the same number of atoms as the species list.

  • Descriptive index errorsrender_mpl, render_mpl_interactive, centre_on, and from_pymatgen now raise ValueError with the parameter name and valid range for out-of-range index arguments, instead of leaking bare IndexError exceptions.

  • API improvementsViewState.look_along returns self for chaining. Passing None for a style kwarg in render_mpl now resets that field to the RenderStyle class default instead of being silently ignored.

See the changelog for full details.

v0.7.0

Choose a tag to compare

@bjmorgan bjmorgan released this 18 Feb 17:37
175d9b7

What's new

  • Construction-time style kwargsfrom_pymatgen now accepts atom_styles, title, view, and atom_data keyword arguments, allowing styles to be configured at construction time rather than requiring post-hoc mutation.

  • JSON style persistence — All style classes gain to_dict() / from_dict() methods for serialisation. Module-level save_styles() / load_styles() functions write and read style files containing any combination of atom_styles, bond_specs, polyhedra, and render_style sections. StructureScene.save_styles() and load_styles() provide convenience methods on the scene itself.

  • StyleSet — New dataclass returned by load_styles() with optional fields for each section.

See the changelog for full details.

v0.6.0

Choose a tag to compare

@bjmorgan bjmorgan released this 18 Feb 15:00
ef25444

What's new

  • BondSpec defaultsBondSpec now only requires species and max_length. min_length defaults to 0.0; radius and colour default to class-level values (BondSpec.default_radius and BondSpec.default_colour) which can be changed to set project-wide defaults. The repr distinguishes unset values (radius=<default 0.1>) from explicit ones (radius=0.15).

See the changelog for full details.

v0.5.0

Choose a tag to compare

@bjmorgan bjmorgan released this 18 Feb 13:48
1326b5b
  • render_mpl() and StructureScene.render_mpl() now accept an ax parameter to render into an existing matplotlib axes, enabling multi-panel figures and composition with other plots.
  • Scene titles are rendered inside the viewport with a white stroke halo, replacing ax.set_title().
  • The viewport expands symmetrically when the axes orientation widget is enabled, preventing overlap with corner atoms.
  • Widget font and line width scale relative to per-axes width rather than full figure width, giving correct proportions in subplots.
  • Default AxesStyle.arrow_length increased from 0.08 to 0.12 for better visibility.

v0.4.0

Choose a tag to compare

@bjmorgan bjmorgan released this 18 Feb 09:27
14601dc

Default bond detection now uses VESTA bond length cutoffs (bundled as JSON, sourced from pymatgen) instead of the covalent-radii-sum heuristic. Self-bonds (e.g. C-C, Si-Si) are included automatically when present in the VESTA data.

Breaking changes:

  • The tolerance and self_bonds parameters on default_bond_specs() have been removed.

v0.3.0

Choose a tag to compare

@bjmorgan bjmorgan released this 18 Feb 07:37
951e648

Bond completion and recursive search across periodic boundaries, atom visibility control, and simplified polyhedra vertex ordering.

Bond completion across boundaries

BondSpec gains a complete parameter for single-pass bond completion across periodic boundaries. Pass a species name to add missing neighbours around visible atoms of that species, or "*" for both directions:

BondSpec(species=("S", "Zr"), min_length=0.0, max_length=2.9,
         radius=0.1, colour=0.5, complete="Zr")

Recursive bond search

BondSpec.recursive iteratively searches for bonded atoms across boundaries, following chains until convergence or max_recursive_depth is reached. Handles molecules that span periodic boundaries (e.g. N2H6):

BondSpec(species=("N", "N"), min_length=0.0, max_length=1.9,
         radius=0.1, colour=0.5, recursive=True)

When both complete and recursive are set on the same spec, complete is skipped to avoid an extra expansion shell.

Atom visibility

AtomStyle.visible (default True) hides atoms of a species and suppresses their bonds without removing them from the scene data:

scene.atom_styles["H"].visible = False

Breaking changes

  • Removed PolyhedraVertexMode enum and polyhedra_vertex_mode field on RenderStyle. Vertex atoms are now always drawn in front of their connected polyhedral faces (the previous default behaviour).

Documentation: https://hofmann.readthedocs.io

v0.2.2

Choose a tag to compare

@bjmorgan bjmorgan released this 17 Feb 13:16
6c81363

Add inferno-coloured dodecahedron logo rendered with hofmann.

hofmann 0.2.1

Choose a tag to compare

@bjmorgan bjmorgan released this 17 Feb 12:00
cfb36ca

Per-axis viewport cropping and helix hero image for the colouring documentation.

Per-axis viewport extents

The static renderer now computes separate x and y extents centred on the data midpoint, producing tightly cropped output for non-square scenes. Previously all renders used a square bounding box sized to the largest axis, wasting space for elongated structures.

The axes orientation widget has been updated to position correctly within asymmetric viewports. The interactive viewer is unaffected — it continues to use a fixed square viewport for stable rotation.

Documentation

New hero image on the colouring page: a helix of corner-sharing tetrahedra coloured by position along the helix using viridis.

Documentation: https://hofmann.readthedocs.io