Changelog#

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Unreleased#

Added#

  • mesh_TriangularMesh() — meshes a magnet.TriangularMesh into conforming tetrahedral cells using TetGen. Quality and cell count are controlled via target_elems, minratio, and mindihedral. TetGen is an optional dependency: pip install magpylib-material-response[tetgen].

  • trimesh_from_model3d() helper in meshing_utils — builds a closed magnet.TriangularMesh from a magpylib model3d shape trace (cuboid, cylinder_segment, ellipsoid, prism, pyramid, tetrahedron).

  • mesh_all() now supports magnet.CylinderSegment and magnet.TriangularMesh in addition to magnet.Cuboid and magnet.Cylinder.

  • Optional dependency group tetgen (tetgen>=0.8.3). (#41).

0.4.0 - 2026-05-01#

Added#

  • Serialization API for magpylib objects: to_json, from_json. Supports magnet.Cuboid, magnet.Cylinder, magnet.CylinderSegment, current.Polyline, current.Circle, Sensor, and nested Collection. Uses namespaced type discriminators ("magnet.Cuboid", "current.Polyline", …) and is fully JSON round-trippable (#38).

  • Added serialization example to docs (#39).

Changed#

  • Breaking: logging is now silent by default. Call magpylib_material_response.configure_logging() (or loguru.logger.enable("magpylib_material_response")) to opt in to log output (#30).

  • Refactored logging to follow the loguru library recipe: the package no longer calls logger.remove() and never overrides sinks configured by the host application.

  • Replaced f-string log calls with structured logging (logger.info("msg {x}", x=...)).

  • Added MAGPYLIB_LOG_LEVEL, MAGPYLIB_LOG_COLORS, MAGPYLIB_LOG_TIME, MAGPYLIB_LOG_MIN_TIME environment variables.

  • Added a min_log_time argument to configure_logging() that sets the default duration threshold used by timelog (and by the demag functions when their own min_log_time argument is left at its default).

  • Added docs/logging.md.

Fixed#

  • timelog no longer raises TypeError on the failure path when the wrapped block raises an exception.

0.3.1 - 2025-10-30#

Fixed#

  • Fixed susceptibility tree traversal (#26, #28)

Changed#

  • Improved clarity and error handling in get_susceptibilities function

  • Enhanced logging configuration

  • Refactored demag.py for better organization

  • Improved documentation theme and layout (#29)

    • Switched from Furo to PyData Sphinx theme

    • Added custom CSS for full-width content and smaller sidebar

    • Enhanced navigation and branding with Magpylib logo

    • Reorganized examples section structure

Maintenance#

  • Updated pre-commit hooks to latest versions (#21)

  • Updated GitHub Actions dependencies (#24)

  • Removed test PyPI repository URL from publish step (#27)

  • Added VSCode settings for pytest configuration

0.3.0 - 2024-10-16#

Added#

  • Support for anisotropic susceptibilities

  • FE tests for anisotropic and negative susceptibility values

  • Comprehensive tests for interface and computation validation

  • Susceptibility input to parent collections

  • Support for both scalar (isotropic) and 3-vector (anisotropic) susceptibility inputs

Changed#

  • Improved interface for susceptibility (chi) input

  • Enhanced susceptibility input possibilities:

    • Scalar input now assumes isotropic susceptibility

    • 3-vector input enables anisotropic susceptibility

  • Improved internal architecture and code organization

Fixed#

  • Various computation fixes confirmed by isotropic and anisotropic tests

0.2.1a0#

Fixed#

  • Fixed null polarization for rotated objects (#7)

  • Fixed documentation build issues (#6)

0.2.0a0#

Changed#

  • Renamed xi parameter to susceptibility for better clarity (#5)

  • Updated to support magpylib v5 (#4)