Skip to content

Commit

Permalink
fix: random perturbation treebuild procedure will run reproducibly
Browse files Browse the repository at this point in the history
  • Loading branch information
mikegrudic committed Aug 26, 2024
1 parent 0f26a17 commit 00226a9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/pytreegrav/octree.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ def __init__(
ComputeMoments(self, self.NumParticles, children)

def BuildTree(self, points, masses, softening):
# initialize random seed in case of non-unique positions
np.random.seed(42)

self.Initialize(len(points), self.NumNodes)

# set the properties of the root node
Expand Down

0 comments on commit 00226a9

Please sign in to comment.