Fixed instrument_dir estimation to be bottom up, ie, based on path to file. Otherwise, it does not work when dima used as submodule
This commit is contained in:
@ -17,12 +17,11 @@ def read_txt_files_as_dict(filename: str, instruments_dir: str = None, work_with
|
|||||||
# If instruments_dir is not provided, use the default path relative to the module directory
|
# If instruments_dir is not provided, use the default path relative to the module directory
|
||||||
if not instruments_dir:
|
if not instruments_dir:
|
||||||
# Assuming the instruments folder is one level up from the source module directory
|
# Assuming the instruments folder is one level up from the source module directory
|
||||||
#module_dir = os.path.dirname(__file__)
|
module_dir = os.path.dirname(__file__)
|
||||||
#instruments_dir = os.path.join(module_dir, '..', 'instruments')
|
instruments_dir = os.path.join(module_dir, '..')
|
||||||
instruments_dir = os.path.join(root_dir,'instruments')
|
|
||||||
|
|
||||||
# Normalize the path (resolves any '..' in the path)
|
# Normalize the path (resolves any '..' in the path)
|
||||||
instrument_configs_path = os.path.abspath(os.path.join(instruments_dir,'readers/config_text_reader.yaml'))
|
instrument_configs_path = os.path.abspath(os.path.join(instruments_dir,'readers','config_text_reader.yaml'))
|
||||||
|
|
||||||
with open(instrument_configs_path,'r') as stream:
|
with open(instrument_configs_path,'r') as stream:
|
||||||
try:
|
try:
|
||||||
|
Reference in New Issue
Block a user