Skip to content

Commit

Permalink
Merge pull request #68 from glotzerlab/fix/random-walk
Browse files Browse the repository at this point in the history
Fix and streamline random walk example to use for demos
  • Loading branch information
b-butler authored Nov 20, 2023
2 parents 119029e + 0699c8c commit 785a56f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions projects/flow.2D-random-walk/src/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
logger.setLevel(logging.ERROR)

# The standard deviations to use for generating random walk moves
STANDARD_DEVIATIONS = np.linspace(start=0.1, stop=1, num=20)
STANDARD_DEVIATIONS = np.linspace(start=0.1, stop=1, num=5)
NUMBER_REPLICAS = 100
RUN_STEPS = 5_000
RUN_STEPS = 10_000
MAX_SEED = 2**32 - 1


Expand Down
3 changes: 2 additions & 1 deletion projects/flow.2D-random-walk/src/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ def plot_mean_squared_displacement(job):

@agg_analyze_and_plot
@RandomWalkProject.pre(all_simulated)
@RandomWalkProject.post.true("msd_analyzed")
@RandomWalkProject.pre(lambda *jobs: "squared_displacement" in jobs[0].data)
@RandomWalkProject.post(lambda *jobs: jobs[0].doc.get("msd_analyzed"))
@RandomWalkProject.operation(aggregator=std_aggregator)
def compute_mean_squared_displacement(*jobs):
"""Compute and store the mean squared displacement for all std."""
Expand Down
2 changes: 1 addition & 1 deletion projects/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ for PROJECT in `ls -d */`; do
cat ${REQUIREMENTS_FILE}
mamba install --yes --file ${REQUIREMENTS_FILE} --quiet
fi
python flow-test.py ${PROJECT} -vv --timeout=600 $@
python flow-test.py ${PROJECT} -v --timeout=600 $@
if [[ "$CI" ]]; then
echo "::endgroup::"
fi
Expand Down

0 comments on commit 785a56f

Please sign in to comment.