Add default anatric path to pyzebra app cli
This commit is contained in:
parent
90387174e5
commit
09d22e7674
@ -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,
|
||||
|
@ -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(
|
||||
|
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user