Skip to content

Conversation

@f-brinkmann
Copy link
Member

@f-brinkmann f-brinkmann commented Dec 16, 2025

Changes proposed in this pull request:

  • Add class method SphericalHarmonics.from_definition
  • Add testing thereof

Note: Allready uses docstring suggested in #246, which will be implemented through the same pull request also here.
Requires #246

@f-brinkmann f-brinkmann added this to the v1.0.0 milestone Dec 16, 2025
@f-brinkmann f-brinkmann moved this from Backlog to Require review in Weekly Planning Dec 16, 2025
@f-brinkmann f-brinkmann force-pushed the feature/sh_instance_from_definition branch from 73cb668 to eaa6f78 Compare December 16, 2025 17:07
Copy link
Member

@mberz mberz left a comment

Choose a reason for hiding this comment

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

I'd suggest to change the order of arguments (for semantic and consistency reasons), see below)
Otherwise good to go

self.inverse_method = inverse_method

@classmethod
def from_definition(cls, coordinates, definition, inverse_method="auto"):
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
def from_definition(cls, coordinates, definition, inverse_method="auto"):
def from_definition(cls, definition, coordinates, inverse_method="auto"):

I'd suggest to change the order to keep things consistent when thinking about other cases (like audio classes etc., they all will require the definition + other things)

@f-brinkmann f-brinkmann requested a review from mberz December 16, 2025 17:21
Copy link

@tluebeck tluebeck left a comment

Choose a reason for hiding this comment

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

Looks good to me. I'm just wondering if we should align the names with the init method from #247 to make clear that both have the same input. Otherwise approved

@f-brinkmann
Copy link
Member Author

I was discussing the same with @mberz yesterday and we thought having shorter names in both cases would be fine ( if I remember correctly). Specifically in this case SphericalHarmonics.from_spherical_harmonic_definition would be a litte redundant and very long.

@mberz mberz changed the title [spharpy] Initialize spherical harmonics from definition [ENH] Initialize spherical harmonics from definition Dec 17, 2025
@github-project-automation github-project-automation bot moved this from Require review to Reviewer Approved in Weekly Planning Dec 17, 2025
@mberz
Copy link
Member

mberz commented Dec 17, 2025

I additionally fixed a conflict with the current develop branch.

@mberz mberz merged commit f523063 into develop Dec 17, 2025
10 of 11 checks passed
@github-project-automation github-project-automation bot moved this from Reviewer Approved to Done in Weekly Planning Dec 17, 2025
@mberz mberz deleted the feature/sh_instance_from_definition branch December 17, 2025 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants