Spin off thermal_gyroradius
from gyroradius
?
#2540
Labels
breaking change
For breaking changes, excluding deprecations and planned removals
plasmapy.formulary
Related to the plasmapy.formulary subpackage
proposal
Proposals that need to be decided upon before implementation
status: needs discussion
Issues & PRs that need to be discussed at a community meeting or by the Coordinating Committee
Milestone
Our
gyroradius
function is quite long and complex. The complex control flow can often lead to missed situations in tests. When a function is too long and complex, it's usually an indication that the function is doing too much, and that the function should be split up into multiple short functions that do exactly one thing.The calculation of the gyroradius needs the perpendicular velocity, which can currently be given by providing the velocity itself, the Lorentz factor, or the temperature. A lot of the complexity arises because of validating inputs (like making sure that only one of the above is provided).
One way to reduce this complexity would be to create a separate function only for the
thermal_gyroradius
. I'm thinking that spelling out "thermal gyroradius" will make resulting code less ambiguous.We could perhaps also add a keyword argument to
thermal_gyroradius
to specify whether it should be the "most probable", "rms", or other thermal velocity.Before we implement this, it'd be helpful to get some feedback from a few people. Is this a worthwhile idea?
The text was updated successfully, but these errors were encountered: