Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in template generation: When processing a list of multiple libraries a nested list is created #24

Open
pfannkuch3n opened this issue Mar 11, 2025 · 0 comments

Comments

@pfannkuch3n
Copy link

Description

If one tries to use the template_generation script with:

 libraries_to_load = [aixlib_library, custom_models_library]
 template_generation.main(custom_library=libraries_to_load, 
                        custom_models = "data/template_components.json", #Look hint above
                        workspace = store_path,
                        rigorous = False) #rigorous = True will overwrite existing templates

Following error occurs:

  abs_path = os.path.abspath(path).replace("\\", "/")
              ~~~~~~~~~~~~~~~^^^^^^
 File "<frozen ntpath>", line 576, in abspath
TypeError: _path_normpath: path should be string, bytes or os.PathLike, not list

Problem background

In template_generation.py of uesgraphs custom_library will be treated as such:
if custom_library: libs_to_load = [custom_library]
As result libs_to_load is a nested list

Possible solution

Change libs_to_load to:

libs_to_load = custom_library if isinstance(custom_library, list) else [custom_library]
so single libraries as well as multiple libraries packed to list will get processed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant