diff --git a/pyzebra/anatric.py b/pyzebra/anatric.py index 799b396..e50ef4b 100644 --- a/pyzebra/anatric.py +++ b/pyzebra/anatric.py @@ -7,6 +7,7 @@ DATA_FACTORY_IMPLEMENTATION = [ "morph", "d10", ] + REFLECTION_PRINTER_FORMATS = [ "rafin", "rafinf", @@ -20,10 +21,11 @@ REFLECTION_PRINTER_FORMATS = [ "oksana", ] +ANATRIC_PATH = "/afs/psi.ch/project/sinq/rhel7/bin/anatric" ALGORITHMS = ["adaptivemaxcog", "adaptivedynamic"] -def anatric(config_file, anatric_path="/afs/psi.ch/project/sinq/rhel7/bin/anatric", cwd=None): +def anatric(config_file, anatric_path=ANATRIC_PATH, cwd=None): comp_proc = subprocess.run( [anatric_path, config_file], stdout=subprocess.PIPE, diff --git a/pyzebra/app/cli.py b/pyzebra/app/cli.py index 79ed80e..49654f1 100644 --- a/pyzebra/app/cli.py +++ b/pyzebra/app/cli.py @@ -6,6 +6,7 @@ from bokeh.application.application import Application from bokeh.application.handlers import ScriptHandler from bokeh.server.server import Server +from pyzebra.anatric import ANATRIC_PATH from pyzebra.app.handler import PyzebraHandler logging.basicConfig(format="%(asctime)s %(message)s", level=logging.INFO) @@ -38,7 +39,7 @@ def main(): ) parser.add_argument( - "--anatric-path", type=str, default=None, help="path to anatric executable", + "--anatric-path", type=str, default=ANATRIC_PATH, help="path to anatric executable", ) parser.add_argument( diff --git a/pyzebra/app/panel_hdf_anatric.py b/pyzebra/app/panel_hdf_anatric.py index 439eb87..6fac642 100644 --- a/pyzebra/app/panel_hdf_anatric.py +++ b/pyzebra/app/panel_hdf_anatric.py @@ -347,10 +347,7 @@ def create(): with tempfile.TemporaryDirectory() as temp_dir: temp_file = temp_dir + "/config.xml" config.save_as(temp_file) - if doc.anatric_path: - pyzebra.anatric(temp_file, anatric_path=doc.anatric_path, cwd=temp_dir) - else: - pyzebra.anatric(temp_file, cwd=temp_dir) + pyzebra.anatric(temp_file, anatric_path=doc.anatric_path, cwd=temp_dir) with open(os.path.join(temp_dir, config.logfile)) as f_log: output_log.value = f_log.read()