-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
99 lines (85 loc) · 2.91 KB
/
run.py
File metadata and controls
99 lines (85 loc) · 2.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
"""
pipeline control
usage: CMD python run.py data/7cell0303/
force stop docker with CTRL <
@author: micsla
"""
import logging
import multiprocessing
import platform
import sys
from datetime import datetime
import datasets
from datasets import Datasets
from esimclasses.anomalies import Protrusion, ContractileRing
L = [
# *Datasets.zygo01,
# *Datasets.zygo02,
# *Datasets.zygo03,
# *Datasets.zygo01b, # ruffles
# *Datasets.zygo06, # ruffles
# *Datasets.zygo07, # ruffles
# *Datasets.old2to4,
*Datasets.old7cellseries,
*Datasets.wt02,
*Datasets.wt07,
*Datasets.wt08,
*Datasets.wt08b,
*Datasets.crm,
*Datasets.crmb,
]
name_option = None
# name_option = "crm0440"
if len(sys.argv) == 2:
name_option = sys.argv[1]
if name_option is not None:
L = [line for line in L if name_option in line[0]]
# L = [["wt/02/wt0204", "wild", 2.8]]
# L = [["7cellseries/7cell0106", "wild", 8.5]]
# L = [["synthetic/syn4loosehullb", "syn", 4, []]]
# L = [["synthetic/syn7realb", "syn", 7.8]]
def run(order): # check mesh_utils for rotation
if len(order) == 4:
ds, series, stage, ano = order # embryo set, wild type, cell stage, anomalies
else:
ds, series, stage = order # use default anomalies for this stage
ano = datasets.default_anomalies(stage)
folder = f'data/{ds}/'
print(f"Run processing {folder}")
try:
if "Linux" in platform.system():
# from esim import pics # pics import seems to break optimize
# pics.process(folder)
# pics.is_done(folder)
# from esim import solve_shape
# solve_shape.optimize(folder, ano)
pass
else:
# from xu import xu_measure, xu_solve, tangent_solve
# xu_measure.main(folder, stage)
# xu_solve.main(folder, series, stage)
# tangent_solve.main(folder, series, stage)
# from gastru import tissue_solve
# tissue_solve.main(folder, series, stage)
# from esim import plot_optimization
# plot_optimization.plot_opt(folder)
pass
except Exception as e:
logging.exception(e) # prints stacktrace
return ds
return 0
if __name__ == '__main__':
# res = multiprocessing.Pool(10).map(run, L) # multithreaded
res = [run(line) for line in L] # singlethreaded
success = sum([r == 0 for r in res])
problems = [r for r in res if r != 0]
# from aggregate import aggregate
# aggregate.datacoverage(L) # plot embryos and frames
# df, df_p, df_r = aggregate.summarize(L) # make dataframes
# from tests import compare_xu_sim
# compare_xu_sim.compare(L)
from gastru import gastru_xu
gastru_xu.visualize(L)
print(f"\n--- Run Done - {datetime.utcnow().hour + 2}:{datetime.utcnow().minute} - Processed {success} ---")
if len(problems) > 0:
print(f"Something went wrong in {problems}")