Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust signature of magnetic_field method for magnetostatic classes #1575

Open
namurphy opened this issue May 26, 2022 · 2 comments · May be fixed by #1795
Open

Adjust signature of magnetic_field method for magnetostatic classes #1575

namurphy opened this issue May 26, 2022 · 2 comments · May be fixed by #1795
Labels
Plasma Lv2 | Intermediate Issues that require an intermediate knowledge of plasma physics Python Lv2 | Intermediate Issues that require a medium amount of knowledge of Python

Comments

@namurphy
Copy link
Member

Right now the MagneticDipole.magnetic_field method (from plasmapy.formulary.magnetostatics requires a position vector, p which makes it harder to do array operations. We could instead do something like having keyword-only parameters like x, y, & z...which would also let us have additional keyword-only parameters like r, z, and phi or r, theta, phi for cylindrical and circular coordinates, respectively.

@namurphy namurphy added Plasma Lv2 | Intermediate Issues that require an intermediate knowledge of plasma physics Python Lv2 | Intermediate Issues that require a medium amount of knowledge of Python labels May 30, 2022
@github-actions github-actions bot added the Stale Dormant issues & PRs which will be automatically closed if the label is not removed. label Jul 30, 2022
@bucket420
Copy link
Contributor

Hi I am currently working on this and have a couple of questions:

  1. Do you want to keep the position vector p as an optional argument?
  2. Is it better to use explicit keyword arguments or **kwargs?

@StanczakDominik
Copy link
Member

  1. Keeping p doesn't break backwards compatibility.
  2. Explicit keyword arguments are easier to work with as a user - you can't get your editor to give you tips on what **kwargs handle, but with explicit keyword arguments that's easy.

Note however that #1688 exists! Still won't hurt to get this in for now, probably.

@namurphy namurphy removed the Stale Dormant issues & PRs which will be automatically closed if the label is not removed. label May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Plasma Lv2 | Intermediate Issues that require an intermediate knowledge of plasma physics Python Lv2 | Intermediate Issues that require a medium amount of knowledge of Python
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants