Browse Source

add batch files

Gaspard Jankowiak 11 months ago
parent
commit
13a5bf0007
2 changed files with 98 additions and 0 deletions
  1. 50
    0
      metrics_nonuc_beta.jl
  2. 48
    0
      metrics_nonuc_width.jl

+ 50
- 0
metrics_nonuc_beta.jl View File

@@ -0,0 +1,50 @@
1
+push!(LOAD_PATH, "src")
2
+
3
+import CellSim
4
+import Dates
5
+
6
+# The configuration file from which parameters are taken
7
+base_config = "configs_metrics/no_nucleus/varia_width_param.yaml"
8
+
9
+# The output prefix, this overrides the one set in the configuration file
10
+output_prefix = "nonuc_beta"
11
+
12
+
13
+# Load configuration
14
+P, F, config = CellSim.read_config(base_config)
15
+
16
+# Override the output prefix and create it
17
+config["output_prefix"] = output_prefix
18
+mkpath(output_prefix)
19
+
20
+# Set batch mode (only closes Figures at the end to avoid clutter)
21
+config["batch"] = true
22
+
23
+# Log file, used to list parameter value so we don't have to
24
+# compute them by hand. We cannot use the YAML files as Julia can
25
+# only read YAML files, not write to them.
26
+
27
+# Log file name
28
+parameter_log_file = string(output_prefix, "/parameter_log.txt")
29
+
30
+# Open the log file and write the date on top
31
+param_log = open(parameter_log_file, "a")
32
+date = string(Dates.now())
33
+write(param_log, string("\n", date, "\n\n"))
34
+
35
+# The range in which the varying parameter is taken
36
+betas = collect(range(0.0, 0.3; length=21))[2:end]
37
+
38
+# Loop
39
+for beta in betas
40
+    # Set the parameter value
41
+    P.f_β = beta
42
+
43
+    # Write the current value to the log file
44
+    write(param_log, beta)
45
+
46
+    # Run the simulation
47
+    CellSim.launch(P, F, config)
48
+end
49
+
50
+close(param_log)

+ 48
- 0
metrics_nonuc_width.jl View File

@@ -0,0 +1,48 @@
1
+push!(LOAD_PATH, "src")
2
+
3
+import CellSim
4
+import Dates
5
+
6
+# The configuration file from which parameters are taken
7
+base_config = "configs_metrics/no_nucleus/varia_width_param.yaml"
8
+
9
+# The output prefix, this overrides the one set in the configuration file
10
+output_prefix = "nonuc_width"
11
+
12
+# Load configuration
13
+P, F, config = CellSim.read_config(base_config)
14
+
15
+# Override the output prefix and create it
16
+config["output_prefix"] = output_prefix
17
+mkpath(output_prefix)
18
+
19
+# Set batch mode (only closes Figures at the end to avoid clutter)
20
+config["batch"] = true
21
+
22
+# Log file, used to list parameter value so we don't have to
23
+# compute them by hand. We cannot use the YAML files as Julia can
24
+# only read YAML files, not write to them.
25
+
26
+# Log file name
27
+parameter_log_file = string(output_prefix, "/parameter_log.txt")
28
+
29
+# Open the log file and write the date on top
30
+# If it already exists, we do not delete it, but write at the end
31
+param_log = open(parameter_log_file, "a")
32
+date = string(Dates.now())
33
+write(param_log, string("\n", date, "\n\n"))
34
+
35
+# The range in which the varying parameter is taken
36
+ws = range(0.3, 0.8; length=20)
37
+
38
+# Loop
39
+for w in ws
40
+    # Set the parameter value
41
+    P.f_width = w
42
+
43
+    # Write the current value to the log file
44
+    write(param_log, w)
45
+
46
+    # Run the simulation
47
+    CellSim.launch(P, F, config)
48
+end

Loading…
Cancel
Save