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

Correction in list comprehension to allow the second term to be consider #63

Merged
merged 1 commit into from
Jan 19, 2024

Conversation

ANaaim
Copy link
Contributor

@ANaaim ANaaim commented Jan 18, 2024

No description provided.

@ANaaim
Copy link
Contributor Author

ANaaim commented Jan 18, 2024

Hi,

I think i found a small error in a list comprehension in your code :

    calib_dir = [os.path.join(project_dir, c) for c in os.listdir(project_dir) if ('Calib' or 'calib') in c][0]

Should be

    calib_dir = [os.path.join(project_dir, c) for c in os.listdir(project_dir) if ('Calib' in c or 'calib' in c)][0]

Elsewhere the second term is not taken into account :

I tested with the following code to be sure :

alpha = ['toto','tata','titi','tutu']
[c for c in alpha if ('tyty' or 'titi') in c]
Out[8]: []
[c for c in alpha if ('titi' or 'tyty') in c]
Out[9]: ['titi']
[c for c in alpha if ('titi' in c or 'tyty' in c)]
Out[10]: ['titi']
[c for c in alpha if ('tyty' in c or 'titi' in c)]
Out[11]: ['titi']

I hope it is correct.

Best regards,

@davidpagnon
Copy link
Collaborator

davidpagnon commented Jan 19, 2024

We will choose the second of your options, thanks!

@davidpagnon
Copy link
Collaborator

davidpagnon commented Jan 19, 2024

Oops wrong pull request.
I'll take care of this one as soon as the other one is done :)

@davidpagnon davidpagnon reopened this Jan 19, 2024
@davidpagnon davidpagnon merged commit c29abcc into perfanalytics:main Jan 19, 2024
30 checks passed
@davidpagnon
Copy link
Collaborator

Interesting, thanks!

@ANaaim ANaaim deleted the Correction_calibration branch January 31, 2024 12:22
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

Successfully merging this pull request may close these issues.

2 participants