Skip to content

Commit

Permalink
create_output_directory in load xml fn
Browse files Browse the repository at this point in the history
this avoids having it in every main.cpp
also, merged recent dev changes
allow beta/test_run_samples.py to set a different output directory if provided
edit tests.yml to use this^ feature
set a boolean to decide which ones will check svg output
  • Loading branch information
drbergman committed Oct 1, 2024
2 parents 1e3dec4 + 80016c1 commit cfe30a3
Show file tree
Hide file tree
Showing 364 changed files with 55,184 additions and 96,832 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/build_binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,15 @@ jobs:
- uses: actions/checkout@v4

- name: Install dependencies
run : brew install gcc@11
run : brew install gcc@13

- name: Build ${{ matrix.projects.name }} project
run: |
export MACOSX_DEPLOYMENT_TARGET=12
make ${{ matrix.projects.project }}
make clean
${{ matrix.projects.extra_run }}
make PHYSICELL_CPP=g++-11 static
make PHYSICELL_CPP=g++-13 static
cp ${{ matrix.projects.binary }} ${{ matrix.projects.binary }}_macos12
- name: Caching produced project binary
Expand Down Expand Up @@ -173,19 +173,16 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Downgrade XCODE to 14.3.1
run: sudo xcode-select -switch /Applications/Xcode_14.3.1.app

- name: Install dependencies
run : brew install gcc@11
run : brew install gcc@13

- name: Build ${{ matrix.projects.name }} project
run: |
export MACOSX_DEPLOYMENT_TARGET=12
make ${{ matrix.projects.project }}
make clean
${{ matrix.projects.extra_run }}
make PHYSICELL_CPP=g++-11 static
make PHYSICELL_CPP=g++-13 static
cp ${{ matrix.projects.binary }} ${{ matrix.projects.binary }}_macosm1
- name: Caching produced project binary
Expand Down
33 changes: 19 additions & 14 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:

tests:
strategy:
fail-fast: false
matrix:
os: [
{name: "Ubuntu", os: "ubuntu-latest", shell: "bash", compiler: "g++"},
Expand All @@ -17,18 +18,21 @@ jobs:
{name: "Windows", os: "windows-latest", shell: "msys2", compiler: "g++"},
]
projects: [
{project: "template", name: "PhysiCell Template", binary: "project", max_time: 120, config: "config/PhysiCell_settings.xml", output_folder: "output"},
{project: "heterogeneity-sample", name: "PhysiCell Heterogeneity", binary: "heterogeneity", max_time: 99, config: "config/PhysiCell_settings.xml", output_folder: "output"},
{project: "template_BM", name: "PhysiBoSS Template", binary: "project", max_time: 120, config: "config/PhysiCell_settings.xml", output_folder: "output"},
{project: "physiboss-cell-lines-sample", name: "PhysiBoSS Cell Lines", binary: "PhysiBoSS_Cell_Lines", max_time: 120, config: "config/PhysiCell_settings.xml", output_folder: "output"},
{project: "physimess-sample", name: "PhysiMeSS Sample", binary: "project", config: "config/Fibre_Degradation/mymodel_matrix_degradation.xml", max_time: 120, output_folder: "output"},
{project: "interaction-sample", name: "PhysiCell Interactions", binary: "interaction_demo", config: "config/PhysiCell_settings.xml", max_time: 99, output_folder: "output"},
{project: "physiboss-tutorial", name: "PhysiBoSS Tutorial", binary: "project", config: "config/cell_cycle/PhysiCell_settings.xml", max_time: 600, output_folder: "output"},
{project: "worm-sample", name: "PhysiCell worm", binary: "worm", config: "config/PhysiCell_settings.xml", max_time: 120, output_folder: "output"},
{project: "virus-macrophage-sample", name: "Virus Macrophage", binary: "virus-sample", config: "config/PhysiCell_settings.xml", max_time: 120, output_folder: "output"},
{project: "mechano-sample", name: "PhysiCell Mechano", binary: "project", config: "config/PhysiCell_settings.xml", max_time: 120, output_folder: "output"},
{project: "rules-sample", name: "PhysiCell Rules", binary: "project", config: "config/PhysiCell_settings.xml", max_time: 120, output_folder: "output"},
{project: "physiboss-tutorial-invasion", name: "PhysiBoSS Cancer Invasion", binary: "invasion_model", config: "config/PhysiCell_settings_2D.xml", max_time: 120, output_folder: "output"},
{project: "template", name: "PhysiCell Template", binary: "project", max_time: 120, config: "config/PhysiCell_settings.xml", compare_svgs: true, output_folder: "output"},
{project: "template_BM", name: "PhysiBoSS Template", binary: "project", max_time: 120, config: "config/PhysiCell_settings.xml", compare_svgs: true, output_folder: "output"},
{project: "physiboss-cell-lines-sample", name: "PhysiBoSS Cell Lines", binary: "PhysiBoSS_Cell_Lines", max_time: 120, config: "config/PhysiCell_settings.xml", compare_svgs: true, output_folder: "output"},
{project: "physimess-sample", name: "PhysiMeSS Sample", binary: "project", config: "config/Fibre_Degradation/mymodel_matrix_degradation.xml", max_time: 120, compare_svgs: false, output_folder: "output"},
{project: "physiboss-tutorial", name: "PhysiBoSS Tutorial", binary: "project", config: "config/cell_cycle/PhysiCell_settings.xml", max_time: 300, compare_svgs: true, output_folder: "output"},
{project: "worm-sample", name: "PhysiCell worm", binary: "worm", config: "config/PhysiCell_settings.xml", max_time: 120, compare_svgs: true, output_folder: "output"},
{project: "virus-macrophage-sample", name: "Virus Macrophage", binary: "virus-sample", config: "config/PhysiCell_settings.xml", max_time: 120, compare_svgs: true, output_folder: "output"},
{project: "mechano-sample", name: "PhysiCell Mechano", binary: "project", config: "config/PhysiCell_settings.xml", max_time: 120, compare_svgs: true, output_folder: "output"},
{project: "cancer-biorobots-sample", name: "PhysiCell Cancer Biorobots", binary: "cancer_biorobots", config: "config/PhysiCell_settings.xml", max_time: 120, compare_svgs: false, output_folder: "output"},
{project: "biorobots-sample", name: "PhysiCell Biorobots", binary: "biorobots", config: "config/PhysiCell_settings.xml", max_time: 120, compare_svgs: false, output_folder: "output"},
{project: "celltypes3-sample", name: "PhysiCell Celltypes3", binary: "celltypes3", config: "config/PhysiCell_settings.xml", max_time: 120, compare_svgs: false, output_folder: "output"},
{project: "custom-division-sample", name: "PhysiCell custom division", binary: "project", config: "config/PhysiCell_settings.xml", max_time: 120, compare_svgs: false, output_folder: "output"},
{project: "interaction-sample", name: "PhysiCell interactions", binary: "interaction_demo", config: "config/PhysiCell_settings.xml", max_time: 120, compare_svgs: false, output_folder: "output"},
{project: "pred-prey-farmer", name: "PhysiCell prey predator", binary: "pred_prey", config: "config/PhysiCell_settings.xml", max_time: 120, compare_svgs: false, output_folder: "output"},
{project: "template", name: "PhysiCell Template - make output folder", binary: "project", max_time: 120, config: "config/PhysiCell_settings.xml", compare_svgs: false, "output_folder": "test/create/output/folder"}
]

name: Testing ${{ matrix.projects.name }} on ${{ matrix.os.name }}
Expand All @@ -54,8 +58,9 @@ jobs:
- name: Run ${{ matrix.projects.name }} project
run: |
python beta/test_run_sample.py ${{ matrix.projects.binary }} ${{ matrix.projects.config }} ${{ matrix.projects.max_time }}
python beta/test_run_sample.py ${{ matrix.projects.binary }} ${{ matrix.projects.config }} ${{ matrix.projects.max_time }} ${{ matrix.projects.output_folder }}
- name: Check ${{ matrix.projects.name }} project simulation results
if: matrix.projects.compare_svgs
run: |
python beta/test_diff_svg.py ${{ matrix.projects.output_folder }} tests/cases/output_${{ matrix.projects.project }}
python beta/test_diff_svg.py output tests/cases/output_${{ matrix.projects.project }}
39 changes: 15 additions & 24 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,30 +1,21 @@
*.o
*.exe
*.asv
._.DS_Store
.DS_Store
Makefile-backup
config/PhysiCell_settings-backup.xml
documentation/.DS_Store
unit_tests/.DS_Store
sample_projects/.DS_Store
sample_projects/biorobots/.DS_Store
sample_projects/cancer_biorobots/.DS_Store
sample_projects/cancer_immune/.DS_Store
sample_projects/celltypes3/.DS_Store
sample_projects/heterogeneity/.DS_Store
sample_projects/template/.DS_Store
pmb_debug.log
heterogeneity
**/.DS_Store
**/._.DS_Store
cancer_immune_3D
biorobots
project
initial.svg
initial.svg
interaction_demo
*.exe
*.o
addons/libRoadrunner/roadrunner/
addons/libRoadrunner/roadrunner-win64-vs14-cp35m.zip
addons/PhysiBoSS/MaBoSS/
addons/PhysiBoSS/libMaBoSS-*.tar.gz
biorobots
cancer_immune_3D
config/PhysiCell_settings-backup.xml
heterogeneity
initial.svg
interaction_demo
Makefile-backup
pmb_debug.log
project
studio_debug.log
user_projects/*
!user_projects/empty.txt
!user_projects/empty.txt
33 changes: 0 additions & 33 deletions .travis.yml

This file was deleted.

10 changes: 8 additions & 2 deletions BioFVM/BioFVM_MultiCellDS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,15 +515,21 @@ void set_save_biofvm_cell_data_as_custom_matlab( bool newvalue )

/* writing parts of BioFVM to a MultiCellDS file */

static bool BioFVM_substrates_initialized_in_dom = false;

void reset_BioFVM_substrates_initialized_in_dom( void )
{
BioFVM_substrates_initialized_in_dom = false;
}


void add_BioFVM_substrates_to_open_xml_pugi( pugi::xml_document& xml_dom , std::string filename_base, Microenvironment& M )
{
add_MultiCellDS_main_structure_to_open_xml_pugi( xml_dom );

pugi::xml_node root = biofvm_doc.child( "MultiCellDS" );
pugi::xml_node node = root.child( "microenvironment" );

static bool BioFVM_substrates_initialized_in_dom = false;

// if the TME has not yet been initialized in the DOM, create all the
// right data elements, and populate the meshes.
if( !BioFVM_substrates_initialized_in_dom )
Expand Down
1 change: 1 addition & 0 deletions BioFVM/BioFVM_MultiCellDS.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ void set_save_biofvm_cell_data_as_custom_matlab( bool newvalue ); // default: tr

/* writing parts of BioFVM to a MultiCellDS file */

void reset_BioFVM_substrates_initialized_in_dom( void );
void add_BioFVM_substrates_to_open_xml_pugi( pugi::xml_document& xml_dom , std::string filename_base , Microenvironment& M );
void add_BioFVM_basic_agent_to_open_xml_pugi( pugi::xml_document& xml_dom, Basic_Agent& BA ); // not implemented -- future edition
void add_BioFVM_agents_to_open_xml_pugi( pugi::xml_document& xml_dom, std::string filename_base, Microenvironment& M );
Expand Down
10 changes: 8 additions & 2 deletions BioFVM/BioFVM_basic_agent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,16 @@ namespace BioFVM{

std::vector<Basic_Agent*> all_basic_agents(0);

static int max_basic_agent_ID = 0;

void reset_max_basic_agent_ID( void )
{
max_basic_agent_ID = 0;
}

Basic_Agent::Basic_Agent()
{
//give the agent a unique ID
static int max_basic_agent_ID = 0;
ID = max_basic_agent_ID; //
max_basic_agent_ID++;
// initialize position and velocity
Expand Down Expand Up @@ -341,4 +347,4 @@ void Basic_Agent::simulate_secretion_and_uptake( Microenvironment* pS, double dt
return;
}

};
};
4 changes: 3 additions & 1 deletion BioFVM/BioFVM_basic_agent.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@
#include "BioFVM_vector.h"

namespace BioFVM{


void reset_max_basic_agent_ID( void );

class Basic_Agent
{
private:
Expand Down
12 changes: 9 additions & 3 deletions CITATION.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
If you use PhysiCell in your project, please cite PhysiCell and the version
number, such as below:

We implemented and solved the model using PhysiCell (Version 1.13.1) [1].
We implemented and solved the model using PhysiCell (Version 1.14.0) [1].

[1] A Ghaffarizadeh, R Heiland, SH Friedman, SM Mumenthaler, and P Macklin,
PhysiCell: an Open Source Physics-Based Cell Simulator for Multicellu-
Expand All @@ -11,7 +11,7 @@ We implemented and solved the model using PhysiCell (Version 1.13.1) [1].
Because PhysiCell extensively uses BioFVM, we suggest you also cite BioFVM
as below:

We implemented and solved the model using PhysiCell (Version 1.13.1) [1],
We implemented and solved the model using PhysiCell (Version 1.14.0) [1],
with BioFVM [2] to solve the transport equations.

[1] A Ghaffarizadeh, R Heiland, SH Friedman, SM Mumenthaler, and P Macklin,
Expand All @@ -25,7 +25,7 @@ with BioFVM [2] to solve the transport equations.

If you use PhysiBoSS, please cite as below:

We implemented and solved the model using PhysiCell (Version 1.11.0) [1],
We implemented and solved the model using PhysiCell (Version 1.14.0) [1],
with PhysiBoSS[2,3] to simulate the intracellular mechanisms.

[1] A Ghaffarizadeh, R Heiland, SH Friedman, SM Mumenthaler, and P Macklin,
Expand All @@ -50,3 +50,9 @@ If you use libRoadrunner, please cite:
König, J. Kyle Medley, Maciej H. Swat, Herbert M. Sauro, libRoadRunner:
a high performance SBML simulation and analysis library,
Bioinformatics 31(20): 3315–21, 2015: DOI: 10.1093/bioinformatics/btv363

If you use PhysiMeSS, please cite:

V. Noël, M. Ruscone, R. Shuttle-worth, and C.K. Macnamara. PhysiMeSS--
A New PhysiCell Addon for Extracellular Matrix Modelling, bioRxiv [preprint]
2023.10.27.564365, 2023. DOI: 10.1101/2023.10.27.564365.
27 changes: 18 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,20 +73,19 @@ name:
list-projects:
@echo "Sample projects: template biorobots-sample cancer-biorobots-sample cancer-immune-sample"
@echo " celltypes3-sample heterogeneity-sample pred-prey-farmer virus-macrophage-sample"
@echo " worm-sample interaction-sample mechano-sample rules-sample physimess-sample"
@echo " worm-sample interaction-sample mechano-sample rules-sample physimess-sample custom-division-sample"
@echo ""
@echo "Sample intracellular projects: template_BM ode-energy-sample physiboss-cell-lines-sample"
@echo " cancer-metabolism-sample physiboss-tutorial physiboss-tutorial-invasion"
@echo ""

template:
cp ./sample_projects/template/custom_modules/* ./custom_modules/
cp -r ./sample_projects/template/custom_modules/* ./custom_modules/
touch main.cpp && cp main.cpp main-backup.cpp
cp ./sample_projects/template/main.cpp ./main.cpp
cp Makefile Makefile-backup
cp ./sample_projects/template/Makefile .
cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml
cp ./sample_projects/template/config/* ./config/
cp -r ./sample_projects/template/config/* ./config

# sample projects

Expand Down Expand Up @@ -198,6 +197,16 @@ physimess-sample:
cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml
cp -r ./sample_projects/physimess/config/* ./config/


custom-division-sample:
cp ./sample_projects/custom_division/custom_modules/* ./custom_modules/
touch main.cpp && cp main.cpp main-backup.cpp
cp ./sample_projects/custom_division/main.cpp ./main.cpp
cp Makefile Makefile-backup
cp ./sample_projects/custom_division/Makefile .
cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml
cp ./sample_projects/custom_division/config/* ./config/

# ---- intracellular projects
ode-energy-sample:
cp ./sample_projects_intracellular/ode/ode_energy/custom_modules/* ./custom_modules/
Expand Down Expand Up @@ -389,7 +398,7 @@ PhysiCell_geometry.o: ./modules/PhysiCell_geometry.cpp
reset:
rm -f *.cpp PhysiCell_cell.o
cp ./sample_projects/Makefile-default Makefile
rm -f ./custom_modules/*
rm -rf ./custom_modules/*
touch ./custom_modules/empty.txt
touch ALL_CITATIONS.txt
touch ./core/PhysiCell_cell.cpp
Expand Down Expand Up @@ -493,15 +502,15 @@ save:
cp main.cpp ./user_projects/$(PROJ)
cp Makefile ./user_projects/$(PROJ)
cp VERSION.txt ./user_projects/$(PROJ)
cp ./config/* ./user_projects/$(PROJ)/config
cp ./custom_modules/* ./user_projects/$(PROJ)/custom_modules
cp -r ./config/* ./user_projects/$(PROJ)/config
cp -r ./custom_modules/* ./user_projects/$(PROJ)/custom_modules

load:
echo "Loading project from $(PROJ) ... "
cp ./user_projects/$(PROJ)/main.cpp .
cp ./user_projects/$(PROJ)/Makefile .
cp ./user_projects/$(PROJ)/config/* ./config/
cp ./user_projects/$(PROJ)/custom_modules/* ./custom_modules/
cp -r ./user_projects/$(PROJ)/config/* ./config/
cp -r ./user_projects/$(PROJ)/custom_modules/* ./custom_modules/

pack:
@echo " "
Expand Down
Loading

0 comments on commit cfe30a3

Please sign in to comment.