-
Notifications
You must be signed in to change notification settings - Fork 98
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
updated scripts to build, run, test all sample projects #247
Merged
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
5eab7d5
updated script to build all samples
rheiland f2f62aa
prettify a tiny bit
rheiland 798f92e
fix a suffix
rheiland aca4e0f
fix renaming execs with a dash bug
rheiland b37a6d7
update
rheiland eca546c
cleanup
rheiland fee8716
update
rheiland a72777a
init
rheiland File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
# Copy this file to the root dir and run it from a Unix bash shell: sh test_build_samples.sh | ||
# | ||
# WARNING: this is primarily intended to be used by core developers when testing a new release. | ||
# It will create new directories in /user_projects | ||
# | ||
# Based on the following: | ||
# | ||
# $ make list-projects | ||
# Sample projects: template biorobots-sample cancer-biorobots-sample cancer-immune-sample | ||
# celltypes3-sample heterogeneity-sample pred-prey-farmer virus-macrophage-sample | ||
# worm-sample interaction-sample mechano-sample rules-sample physimess-sample | ||
# | ||
# Note that it does not currently test building the intracellular projects: | ||
# Sample intracellular projects: template_BM ode-energy-sample physiboss-cell-lines-sample | ||
# cancer-metabolism-sample physiboss-tutorial physiboss-tutorial-invasion | ||
# | ||
# | ||
# After running the script, you can : | ||
# 1) confirm all executables were created | ||
# $ ls -l template_sample biorobots cancer_biorobots cancer_immune_3D celltypes3 heterogeneity pred_prey virus_sample worm interaction_demo mechano_sample rules_sample physimess_sample | ||
# and then: | ||
# 2) confirm the user_projects were created; delete them | ||
# $ cd user_projects | ||
# $ ls | ||
# $ rm -rf template biorobots cancer_biorobots cancer_immune celltypes3 hetero pred_prey virus_mac worm interaction mechano rules physimess | ||
|
||
make reset | ||
make template | ||
make | ||
mv project template_sample | ||
make save PROJ=template | ||
# | ||
echo "\n-----------------------------------------" | ||
make reset | ||
make biorobots-sample | ||
make | ||
make save PROJ=biorobots | ||
# | ||
echo "\n-----------------------------------------" | ||
make reset | ||
make cancer-biorobots-sample | ||
make | ||
make save PROJ=cancer_biorobots | ||
# | ||
echo "\n-----------------------------------------" | ||
make reset | ||
make cancer-immune-sample | ||
make | ||
make save PROJ=cancer_immune | ||
# | ||
echo "\n-----------------------------------------" | ||
make reset | ||
make celltypes3-sample | ||
make | ||
make save PROJ=celltypes3 | ||
# | ||
echo "\n-----------------------------------------" | ||
make reset | ||
make heterogeneity-sample | ||
make | ||
make save PROJ=hetero | ||
# | ||
echo "\n-----------------------------------------" | ||
make reset | ||
make pred-prey-farmer | ||
make | ||
make save PROJ=pred_prey | ||
# | ||
echo "\n-----------------------------------------" | ||
make reset | ||
make virus-macrophage-sample | ||
make | ||
make save PROJ=virus_mac | ||
# | ||
echo "\n-----------------------------------------" | ||
make reset | ||
make worm-sample | ||
make | ||
make save PROJ=worm | ||
# | ||
echo "\n-----------------------------------------" | ||
make reset | ||
make interaction-sample | ||
make | ||
make save PROJ=interaction | ||
# | ||
echo "\n-----------------------------------------" | ||
make reset | ||
make mechano-sample | ||
make | ||
mv project mechano_sample | ||
make save PROJ=mechano | ||
# | ||
echo "\n-----------------------------------------" | ||
make reset | ||
make rules-sample | ||
make | ||
mv project rules_sample | ||
make save PROJ=rules | ||
# | ||
echo "\n-----------------------------------------" | ||
make reset | ||
make physimess-sample | ||
make | ||
mv project physimess_sample | ||
make save PROJ=physimess |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Copy this Python script to the root dir and run it to: | ||
# - load each sample project (from user_projects) | ||
# - compile it | ||
# - modify each project's .xml: max_time, # threads, output folder | ||
# - run it | ||
# | ||
# WARNING: this is primarily intended to be used by core developers when testing a new release. | ||
# It will create new output directories ("output_<proj>") | ||
# | ||
# Reminder: | ||
# $ ls user_projects/ | ||
# biorobots/ hetero/ pred_prey/ worm/ | ||
# cancer_biorobots/ interaction/ rules/ | ||
# cancer_immune/ mechano/ template/ | ||
# celltypes3/ physimess/ virus_mac/ | ||
|
||
# Sample projects: template biorobots-sample cancer-biorobots-sample cancer-immune-sample | ||
# celltypes3-sample heterogeneity-sample pred-prey-farmer virus-macrophage-sample | ||
# worm-sample interaction-sample mechano-sample rules-sample physimess-sample | ||
# | ||
# It does not currently test running the intracellular projects: | ||
# Sample intracellular projects: template_BM ode-energy-sample physiboss-cell-lines-sample | ||
# cancer-metabolism-sample physiboss-tutorial physiboss-tutorial-invasion | ||
# | ||
# | ||
# If you want to cleanup the created execs: | ||
# $ rm -rf template biorobots cancer_biorobots cancer_immune celltypes3 hetero pred_prey virus_mac worm interaction mechano rules physimess | ||
|
||
import subprocess | ||
import xml.etree.ElementTree as ET | ||
import os | ||
import time | ||
|
||
# skip over the 3D cancer_immune_sample for now | ||
user_proj = ["template", "biorobots", "cancer_biorobots", "celltypes3", "hetero", "pred_prey", "virus_mac", "worm", "interaction", "mechano", "rules", "physimess"] # | ||
model_execs = ["project", "biorobots", "cancer_biorobots", "celltypes3", "heterogeneity", "pred_prey", "virus-sample", "worm", "interaction_demo", "project", "project", "project"] | ||
|
||
# using dummy values of 99; users can change | ||
max_times = [120, 10, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99] | ||
|
||
for (uproj, myexec, max_time) in zip(user_proj, model_execs, max_times): | ||
print("\n\n------------ ",uproj,myexec, " ----------------------------------") | ||
subprocess.run(["make","reset"]) | ||
# make load PROJ=template | ||
s= "PROJ=" + uproj | ||
print("\n ---- doing: make load ",s) | ||
subprocess.run(["make","load",s]) | ||
subprocess.run(["make"]) | ||
|
||
# update max_time and omp_num_threads (=1) | ||
tree = ET.parse('config/PhysiCell_settings.xml') | ||
root = tree.getroot() | ||
root.find(".//max_time").text = str(max_time) | ||
root.find(".//omp_num_threads").text = "1" | ||
new_output_dir = "output_" + uproj | ||
root.find(".//save//folder").text = new_output_dir | ||
tree.write('config/PhysiCell_settings.xml') | ||
try: | ||
os.makedirs(new_output_dir) | ||
except: | ||
pass | ||
time.sleep(1) | ||
|
||
subprocess.run([myexec]) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add context so we know when to include that project in testing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since you said you should add comments to it, I would also appreciate clarity on this one :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've pushed edits which includes running that 3D cancer_immune project now. Also note that the physimess project will have an error due to not having a
cp -r
in themake load ...
(only until 1.14.0 is released, hopefully), thereby preventing it from compiling and running.