Skip to content

Conversation

@Alexboiboi
Copy link
Member

@Alexboiboi Alexboiboi requested a review from Copilot October 29, 2025 15:29
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the get_susceptibilities function in the demagnetization module by extracting complex conversion logic into separate helper functions. The changes aim to improve code maintainability and testability while adding comprehensive test coverage for various susceptibility input formats and edge cases.

  • Refactored get_susceptibilities to use helper functions _convert_to_array and _get_susceptibility_from_hierarchy
  • Added extensive parametrized tests covering basic functionality, hierarchical inheritance, error cases, and edge cases
  • Added VS Code settings file for pytest configuration

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/magpylib_material_response/demag.py Refactored get_susceptibilities function to extract conversion logic into _convert_to_array and _get_susceptibility_from_hierarchy helper functions
tests/test_basic.py Replaced old susceptibility test with comprehensive parametrized tests for integration, basic functionality, hierarchy, errors, and edge cases
.vscode/settings.json Added VS Code pytest configuration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Alexboiboi Alexboiboi merged commit 90df454 into main Oct 30, 2025
15 checks passed
@Alexboiboi Alexboiboi deleted the fix/xi branch October 30, 2025 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression: Susceptibility parent tree traversal is broken

2 participants