Dylan-Pugh / TACT

Extensible framework and GUI for processing data files
3 stars 0 forks source link

Add file tact/config/parserConfig.JSON #5

Open lukenoaa opened 1 day ago

lukenoaa commented 1 day ago

Getting this error:

Exception: Failed to get settings for parser: 500
Traceback:
File "/Users/luke.thompson/miniconda3/envs/tact/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/exec_code.py", line 88, in exec_func_with_error_handling
    result = func()
             ^^^^^^
File "/Users/luke.thompson/miniconda3/envs/tact/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 579, in code_to_exec
    exec(code, module.__dict__)
File "/Users/luke.thompson/git/TACT/tact/UI/streamlit/TACT.py", line 52, in <module>
    file_path_from_settings = api_handle.get_config(config_type="parser", field="inputPath")
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/luke.thompson/git/TACT/tact/UI/streamlit/utils/api_handler.py", line 22, in get_config
    raise Exception(

Dylan believes it’s because the API is looking for a config file at “tact/config/parserConfig.JSON” and not finding it. Indeed, adding that file to the directory listed fixes the issue.

Dylan-Pugh commented 1 day ago

Jotting some quick notes here:

The proper behavior in this instance would be to create a 'skeleton' config file when none is found, instead of failing.

The creation logic can live in controller.py here:

https://github.com/Dylan-Pugh/TACT/blob/c802aeaaea2112fb64b670f6328fb957f720e466/tact/control/controller.py#L31