Skip to content

Commit

Permalink
Merge branch 'development' of https://github.com/MathCancer/PhysiCell
Browse files Browse the repository at this point in the history
…into development
  • Loading branch information
MathCancer committed Jan 20, 2025
2 parents 89c09ee + 060c9b6 commit a3bdeea
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 6 deletions.
43 changes: 43 additions & 0 deletions beta/get_studio.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Python script to download the latest release of PhysiCell Studio. It will create a /studio directory
# from wherever this script is run. Sample commands to run the Studio will be printed.

import requests
import os
import zipfile
import shutil

response = requests.get("https://api.github.com/repos/PhysiCell-Tools/PhysiCell-Studio/releases/latest")
release_name_str = response.json()["name"]
print(release_name_str)
print(release_name_str.split())
vnum = release_name_str.split()[0]
print("vnum=",vnum) # e.g., vnum= v2.26.7


try:
os.system('rm -rf studio')
except:
pass

# PhysiCell-Studio-2.26.7
remote_url = 'https://github.com/PhysiCell-Tools/PhysiCell-Studio/archive/refs/tags/' + vnum + '.zip'
print("remote_url=",remote_url)
local_file = 'Studio.zip'
data = requests.get(remote_url)
with open(local_file, 'wb')as file:
file.write(data.content)
print("downloaded version ",vnum," to ",local_file)

print("unzip-ing ",local_file)
with zipfile.ZipFile(local_file, 'r') as zip_ref:
zip_ref.extractall(".")

latest_studio_dir = "PhysiCell-Studio-" + vnum[1:] # need to drop the 'v' as first character
shutil.move(latest_studio_dir,"studio")
print(f"renamed '{latest_studio_dir}' to 'studio'")

print("\n-- Sample commands to run the Studio:")
print("python studio/bin/studio.py # attempts to load config/PhysiCell_settings.xml")
print("python studio/bin/studio.py -c <config_file.xml> -e <executable_program>")
print("python studio/bin/studio.py --help")
print()
4 changes: 2 additions & 2 deletions sample_projects/asymmetric_division/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ int main( int argc, char* argv[] )
while( PhysiCell_globals.current_time < PhysiCell_settings.max_time + 0.1*diffusion_dt )
{
// save data if it's time.
if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_full_save_time ) < 0.01 * diffusion_dt )
if( PhysiCell_globals.current_time > PhysiCell_globals.next_full_save_time - 0.5 * diffusion_dt )
{
display_simulation_status( std::cout );
if( PhysiCell_settings.enable_legacy_saves == true )
Expand All @@ -201,7 +201,7 @@ int main( int argc, char* argv[] )
}

// save SVG plot if it's time
if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_SVG_save_time ) < 0.01 * diffusion_dt )
if( PhysiCell_globals.current_time > PhysiCell_globals.next_SVG_save_time - 0.5 * diffusion_dt )
{
if( PhysiCell_settings.enable_SVG_saves == true )
{
Expand Down
8 changes: 4 additions & 4 deletions sample_projects/template/config/PhysiCell_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@
<phenotype>
<cycle code="6" name="Flow cytometry model (separated)">
<phase_durations units="min">
<duration index="0" fixed_duration="false">300.030003</duration>
<duration index="1" fixed_duration="true">480.076812</duration>
<duration index="2" fixed_duration="true">239.980802</duration>
<duration index="3" fixed_duration="true">59.998800</duration>
<duration index="0" fixed_duration="false">300.0</duration>
<duration index="1" fixed_duration="true">480.0</duration>
<duration index="2" fixed_duration="true">240.0</duration>
<duration index="3" fixed_duration="true">60.0</duration>
</phase_durations>
</cycle>
<death>
Expand Down

0 comments on commit a3bdeea

Please sign in to comment.