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

updated scripts to build, run, test all sample projects #247

Merged
merged 8 commits into from
Aug 28, 2024

Conversation

rheiland
Copy link
Collaborator

@rheiland rheiland commented Jun 5, 2024

  • this bash script compiles all (non-intracellular) sample projects and creates user_projects of each, preparing for the next step of running (brief) simulations of each.

@drbergman
Copy link
Collaborator

drbergman commented Jun 6, 2024

I'm trying this out to test the arg parser and noticing the template project produces a file called template (on non-Windows) and the mechano-sample produces a file called mechano-sample. Subsequent runs of the script (after addressing an issue, e.g.) then seem to confuse the make targets of template and mechano-sample for the newly created executables. this causes the make template command to not load up the config files for the template project because it's looking at the template executable.

Right now, I'm just appending an underscore to the executable name. bonus: that could be used to more easily delete at command line? Better is probably to prefix with an underscore so sorting puts them together.

affected projects:

  • template
  • mechano-sample
  • rules-sample
  • physimess-sample

@rheiland
Copy link
Collaborator Author

rheiland commented Jun 6, 2024

Thanks very much! Pushed a fix. May go with a prefix or suffix underscore in the future, but for now staying with more traditional naming scheme. The header of the script lists all execs' names too.

@elmbeech
Copy link
Contributor

I am still more familiar with python than bash.
Anyhow, along the same line, I thought it might be wise to write a Photon script that generates the Makefiles for all the sample and sample_inracellular projects. So I included this here into the discussion.

like this, it would be more or less easy to have a unified Makefile, or do changes to the unified Makefile structure.
because there are already many sample projects and I think there will become more.
if projects have specific needs for their make files, they could be included in the script in an "if project in {project_a, project_b, ...} block".

@rheiland
Copy link
Collaborator Author

I just pushed beta/test_run_samples.py to this PR which does what it says. It runs most sample projects after modifying each one's config file to only use 1 thread, brief max_time, and suffixed output dirs. The idea would be to run this on the previous release and the new [pre]release and compare results.

@drbergman
Copy link
Collaborator

drbergman commented Jun 11, 2024

Amazing! This will be so nice for testing!! Did you consider calling the bash script from the python script to make sure the user_projects are properly populated? It seems that would be useful, but would be interested in your thoughts. I'm sure I could add that with copilot really easily in the bash script if you think that's a good idea.

@rheiland
Copy link
Collaborator Author

I think I'd like to keep them as separate scripts for now. I guess I should add comments in each to make it clear.

import os
import time

# skip over the 3D cancer_immune_sample for now
Copy link
Collaborator

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?

Copy link
Collaborator

@drbergman drbergman Jun 11, 2024

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 :)

Copy link
Collaborator Author

@rheiland rheiland Jun 11, 2024

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 the make load ... (only until 1.14.0 is released, hopefully), thereby preventing it from compiling and running.

@rheiland
Copy link
Collaborator Author

Just added a 3rd and final(?) script for testing: beta/test_diffs_svg.py. So, the order to run test scripts are:

  • beta/test_build_samples.sh (copy it to the root dir; see instructions in its header. Generates dirs in /user_projects)
  • python beta/test_run_samples.py # compiles/runs all projects in /user_projects generated from previous; edits models' xml so max_time is short, omp_num_threads=1, output folder is unique
  • python beta/test_diffs_svg.py <dir1> <dir2> # checks for bitwise equality of .svg files from two different repos/models, generated by previous script

@rheiland rheiland changed the title updated script to build all sample projects updated scripts to build, run, test all sample projects Jun 30, 2024
@MathCancer
Copy link
Owner

There appear to be no conflicts.

@MathCancer MathCancer merged commit 9ad7264 into MathCancer:development Aug 28, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants