Skip to content

Support vectorized stopping-power source selection #236

Open

Description

@witNie

Problem

mass_stopping_power and stopping_power do not accept a sequence of
stopping-power sources. This prevents source selection from participating in
elementwise or Cartesian-product evaluation.

For example:

result = pyamtrack.stopping.mass_stopping_power(
    particle=[
        pyamtrack.particles.proton,
        pyamtrack.particles.alpha,
    ],
    energy_MeV=[10.0, 100.0],
    material=[
        pyamtrack.materials.water_liquid,
        pyamtrack.materials.aluminum_oxide,
    ],
    source=[
        pyamtrack.stopping.StoppingPowerSource.BETHE,
        pyamtrack.stopping.StoppingPowerSource.ICRU,
    ],
    allow_bethe_fallback=True,
    full_output=True,
    cartesian_product=True,
)


Currently, this raises an error because source is required to be scalar.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions