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

SyntaxError: f-string expression part cannot include a backslash #122

Open
00izquierdoguillem opened this issue Nov 13, 2024 · 2 comments
Open

Comments

@00izquierdoguillem
Copy link

When trying to run dadi-cli BestFit after installation I came across the following error:

SyntaxError: f-string expression part cannot include a backslash

The error referred to line 81 of the Stats.py file:

f.write(f"Description\t{'\t'.join(param_names[1:])}\n")

I solved this error by changing this code to:

f.write(f"Description\t{join(param_names[1:])}\n") before running pip install .

It appears that this might not be an issue for users with python version > python3.12, but I suggest changing the code of Stats.py to my suggestion above in order to help users with an older python version.

@tjstruck
Copy link
Collaborator

Hi @00izquierdoguillem, thanks for letting us know! I've done some testing, and I can't recreate the error. What OS and version of Python (python --version) are you running, and what is the full command you are running that caused the error?

@00izquierdoguillem
Copy link
Author

Hi @tjstruck! I encountered problems when using dadi-cli while running a simple command:

dadi-cli BestFit --input-prefix My_dataset.InferDM

This is a command I've been using recurrently over the last few months using dadi-cli v0.9.2 and never experienced any problems. However, once I installed the newest version of dadi-cli (by downlading the Github repository) it generated the above error. I didn't try any other commands, but I'm guessing I might have encountered the same error when trying to access Stats.py.

I encountered problems when using Python 3.9.13 and Python 3.11.0 (couldn't manage to install Python 3.12). When I modified the code as explained above I stopped experiencing such issues under both Python versions.

Thanks for your help!

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

2 participants