Accelergy-Project / timeloop-accelergy-exercises

Exercises for exploring the Fibertree, Timeloop and Accelergy tools
MIT License
85 stars 29 forks source link

load_yaml() got an unexpected keyword argument 'data' #35

Closed xpww closed 9 months ago

xpww commented 9 months ago

when i run "python3 run_example.py 00" in "timeloop-accelergy-exercises/workspace/exercises/01_accelergy_timeloop_2020_ispass/timeloop" ,this error happened: File "/home/mrpp/software/anaconda3/lib/python3.11/site-packages/timeloopfe/common/nodes.py", line 1348, in from_yaml_files loaded = yaml.load_yaml(f, data=jinja_parse_data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: load_yaml() got an unexpected keyword argument 'data'

then i found load_yaml function: def load_yaml( path: str = None, string: str = None ) -> Union[Dict[str, Any], None]: """ Load YAML content from a file or string :param path: string that specifies the path of the YAML file to be loaded :param string: string that contains the YAML content to be loaded :return: parsed YAML content """ assert (string is None) != ( path is None ), "Must specify either path or string, but not both."

Recursively parse through x, replacing any <<< with a recursive merge

# print(f'Calling recursive merge check on {x}')
return merge_check(yaml.load(load_file_and_includes(path, string)))

How can I fix it?

tanner-andrulis commented 9 months ago

Are you running the most recent versions of TimeloopFE & Accelergy?

git clone --recurse-submodules https://github.com/Accelergy-Project/accelergy-timeloop-infrastructure.git
cd accelergy-timeloop-infrastructure

# Install Accelergy
make install_accelergy

# Install the Timeloop Python Front-End
pip3 install ./src/timeloopfe
xpww commented 9 months ago

Are you running the most recent versions of TimeloopFE & Accelergy?

git clone --recurse-submodules https://github.com/Accelergy-Project/accelergy-timeloop-infrastructure.git
cd accelergy-timeloop-infrastructure

# Install Accelergy
make install_accelergy

# Install the Timeloop Python Front-End
pip3 install ./src/timeloopfe

Hello!I found that the official documentation has been updated. I used conda to create a virtual environment and installed it again according to the process. Now the problem has been solved.

tanner-andrulis commented 9 months ago

Glad it's fixed for you!