changed default data directory path
This commit is contained in:
@@ -454,12 +454,12 @@ def sim_dirs(path_trees: List[PathTree]) -> Generator[Path, None, None]:
|
|||||||
yield p[0].parent
|
yield p[0].parent
|
||||||
|
|
||||||
|
|
||||||
def get_sim_dir(task_id: int, name_if_new: str = "data") -> Path:
|
def get_sim_dir(task_id: int, path_if_new: Path = None) -> Path:
|
||||||
if name_if_new == "":
|
if path_if_new is None:
|
||||||
name_if_new = "data"
|
path_if_new = Path("scgenerator data")
|
||||||
tmp = env.data_folder(task_id)
|
tmp = env.data_folder(task_id)
|
||||||
if tmp is None:
|
if tmp is None:
|
||||||
tmp = ensure_folder(Path("scgenerator" + PARAM_SEPARATOR + name_if_new))
|
tmp = ensure_folder(path_if_new)
|
||||||
os.environ[TMP_FOLDER_KEY_BASE + str(task_id)] = str(tmp)
|
os.environ[TMP_FOLDER_KEY_BASE + str(task_id)] = str(tmp)
|
||||||
tmp = Path(tmp).resolve()
|
tmp = Path(tmp).resolve()
|
||||||
if not tmp.exists():
|
if not tmp.exists():
|
||||||
|
|||||||
@@ -739,7 +739,7 @@ def find_lobe_limits(x_axis, values, debug="", already_sorted=True):
|
|||||||
)
|
)
|
||||||
ax.legend()
|
ax.legend()
|
||||||
fig.savefig(out_path, bbox_inches="tight")
|
fig.savefig(out_path, bbox_inches="tight")
|
||||||
plt.close(fig)
|
plt.close()
|
||||||
|
|
||||||
else:
|
else:
|
||||||
good_roots, left_lim, right_lim = _select_roots(d_spline, d_roots, dd_roots, fwhm_pos)
|
good_roots, left_lim, right_lim = _select_roots(d_spline, d_roots, dd_roots, fwhm_pos)
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ from typing import Dict, List, Tuple, Type, Union
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
from .. import env, initialize, io, utils
|
from .. import env, initialize, io, utils
|
||||||
|
from ..const import PARAM_SEPARATOR
|
||||||
from ..errors import IncompleteDataFolderError
|
from ..errors import IncompleteDataFolderError
|
||||||
from ..logger import get_logger
|
from ..logger import get_logger
|
||||||
from . import pulse
|
from . import pulse
|
||||||
@@ -438,7 +439,9 @@ class Simulations:
|
|||||||
self.update(param_seq)
|
self.update(param_seq)
|
||||||
|
|
||||||
self.name = self.param_seq.name
|
self.name = self.param_seq.name
|
||||||
self.sim_dir = io.get_sim_dir(self.id, name_if_new=self.name)
|
self.sim_dir = io.get_sim_dir(
|
||||||
|
self.id, path_if_new=Path(self.name + PARAM_SEPARATOR + "tmp")
|
||||||
|
)
|
||||||
io.save_parameters(self.param_seq.config, self.sim_dir, file_name="initial_config.toml")
|
io.save_parameters(self.param_seq.config, self.sim_dir, file_name="initial_config.toml")
|
||||||
|
|
||||||
self.sim_jobs_per_node = 1
|
self.sim_jobs_per_node = 1
|
||||||
@@ -690,7 +693,7 @@ def run_simulation_sequence(
|
|||||||
|
|
||||||
final_name = env.get(env.OUTPUT_PATH)
|
final_name = env.get(env.OUTPUT_PATH)
|
||||||
if final_name is None:
|
if final_name is None:
|
||||||
final_name = path_trees[0][-1][0].parent.name + " merged"
|
final_name = config.name
|
||||||
|
|
||||||
io.merge(final_name, path_trees)
|
io.merge(final_name, path_trees)
|
||||||
|
|
||||||
|
|||||||
@@ -251,6 +251,7 @@ class VariableParameter:
|
|||||||
valid_variable = {
|
valid_variable = {
|
||||||
"dispersion_file",
|
"dispersion_file",
|
||||||
"field_file",
|
"field_file",
|
||||||
|
"loss_file",
|
||||||
"beta",
|
"beta",
|
||||||
"gamma",
|
"gamma",
|
||||||
"pitch",
|
"pitch",
|
||||||
|
|||||||
Reference in New Issue
Block a user