-
Notifications
You must be signed in to change notification settings - Fork 24
Added a function to add backslash before a space #541
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -1864,3 +1864,16 @@ def calculate_arrhenius_rate_coefficient(A: Union[int, float, Sequence[float], n | |||||||||||||||||||||||||||||||||||||||||||||||||
raise ValueError("All temperature values must be positive") | ||||||||||||||||||||||||||||||||||||||||||||||||||
exp_arg = -Ea_arr / (R * T_arr) | ||||||||||||||||||||||||||||||||||||||||||||||||||
return A_arr * np.power(T_arr, n_arr) * np.exp(exp_arg) | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
def fill_in_the_blanks(folder_name: str): | ||||||||||||||||||||||||||||||||||||||||||||||||||
""" | ||||||||||||||||||||||||||||||||||||||||||||||||||
Adding backslashes before spaces in the folder name. | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
Args: | ||||||||||||||||||||||||||||||||||||||||||||||||||
folder_name (str): The string directory we want to modify. | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
Returns: | ||||||||||||||||||||||||||||||||||||||||||||||||||
str: Modified folder name. | ||||||||||||||||||||||||||||||||||||||||||||||||||
""" | ||||||||||||||||||||||||||||||||||||||||||||||||||
return folder_name.replace(" ", "\ ") | ||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+1869
to
+1879
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nitpick] The docstring should clarify that this function is for shell compatibility and mention that it works on any path, not just folder names. Also, the parameter description could be more precise: 'The file or directory path to escape'.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The backslash escaping is incorrect. In Python string literals, you need to escape the backslash itself. This should be
folder_name.replace(' ', '\\ ')
or use a raw stringfolder_name.replace(' ', r'\ ')
.Copilot uses AI. Check for mistakes.