Skip to content

Commit

Permalink
fix docstring for fractions
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherMayes committed Nov 20, 2024
1 parent 4834750 commit cbbf531
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pmd_beamphysics/particles.py
Original file line number Diff line number Diff line change
Expand Up @@ -1145,7 +1145,7 @@ def fractional_split(self, fractions: Union[float, int, list], key: str):
Parameters
----------
fractions : float, int, or list of float/int
fractions : float or list of float
A fraction or a list of fractions used for splitting the particles. All values must be between 0 and 1 (exclusive).
key : str
Expand Down Expand Up @@ -1174,8 +1174,8 @@ def fractional_split(self, fractions: Union[float, int, list], key: str):
raise ValueError("All fraction values must be between 0 and 1 (exclusive)")

# Sort particles by the specified key
ixs = np.argsort(particles[key])
sorted_particles = particles[ixs]
ixs = np.argsort(self[key])
sorted_particles = self[ixs]

# Sorted weights
ws = sorted_particles.weight
Expand Down

0 comments on commit cbbf531

Please sign in to comment.