Skip to main content

magpylib-material-response

Actions Status Documentation Status

PyPI version PyPI platforms

Coverage

Warning This package is experimental and in development phase, breaking API changes may happen at any time.

Magpylib-Material-Response adds the response of magnetic materials to Magpylib: the demagnetization of hard magnets and the magnetization of soft-magnetic parts. It cuts the magnets into cells and solves for the polarization of every cell at once with the method of moments.

  • apply_demag solves a magpylib Collection for a scalar or anisotropic susceptibility per cell, driven by remanent polarizations, a uniform applied field and the current sources in the collection.
  • Meshing helpers cut cuboids, cylinders and, through TetGen, any closed triangular surface into cells.

Installation

pip install magpylib-material-response

Tetrahedral meshing of TriangularMesh magnets requires the optional TetGen dependency:

pip install magpylib-material-response[tetgen]

Minimal example

import magpylib as magpy
from magpylib_material_response.demag import apply_demag
from magpylib_material_response.meshing import mesh_Cuboid

# a magnet with finite susceptibility, SI units (m, T)
magnet = magpy.magnet.Cuboid(polarization=(0, 0, 1), dimension=(1e-3, 1e-3, 1e-3))
magnet.susceptibility = 0.3  # µr = 1.3

# mesh into cells and solve; the result is a field source like any other
mesh_demag = apply_demag(mesh_Cuboid(magnet, target_elems=125))
print(magpy.getB(mesh_demag, (0, 0, 1.5e-3)))

See the documentation for a quickstart, worked examples, and the method description.

Metadata

Release files for magpylib-material-response 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for magpylib-material-response 0.5.0
File Size Uploaded Provenance
magpylib_material_response-0.5.0.tar.gz 278.9 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for magpylib-material-response 0.5.0
File Interpreter ABI Platform
magpylib_material_response-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 447.1 kB

Release files / magpylib_material_response-0.5.0.tar.gz

Download URL magpylib_material_response-0.5.0.tar.gz
Size 278.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ce4a8f8f94ae122a9aa78f9e03fbef1bc5035361562e7ad418ff192b81157592
BLAKE2b-256 checksum
How to use checksums
69bbbf4a2cad060bd109da3a4631731a26edd69b22326ab561fa0158a504d120
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

Release files / magpylib_material_response-0.5.0-py3-none-any.whl

Download URL magpylib_material_response-0.5.0-py3-none-any.whl
Size 168.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6af07bc4bdc3cecdacd2dfc347e9b800fd1e779cd7411bb50df68f2a43574311
BLAKE2b-256 checksum
How to use checksums
359eeedd7626e7506825211ad86c97203ac30e2f244affb67c256644416309dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

Security for magpylib-material-response 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for magpylib_material_response-0.5.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page