Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix and streamline random walk example to use for demos #68

Merged
merged 4 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading