Skip to content

Commit

Permalink
Remove f-string without placeholders.
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxJPRey committed Dec 26, 2024
1 parent a744bb7 commit 2db6875
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
13 changes: 6 additions & 7 deletions src/ansys/mechanical/core/mechanical.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,14 +444,14 @@ def __init__(
self._disable_logging = False

if self._local:
self.log_info(f"Mechanical connection is treated as local.")
self.log_info("Mechanical connection is treated as local.")
else:
self.log_info(f"Mechanical connection is treated as remote.")
self.log_info("Mechanical connection is treated as remote.")

# connect and validate to the channel
self._multi_connect(timeout=timeout)

self.log_info("Mechanical is ready to accept grpc calls")
self.log_info("Mechanical is ready to accept grpc calls.")

def __del__(self): # pragma: no cover
"""Clean up on exit."""
Expand Down Expand Up @@ -1397,7 +1397,7 @@ def download(

if chunk_size > 4 * 1024 * 1024: # 4MB
raise ValueError(
f"Chunk sizes bigger than 4 MB can generate unstable behaviour in PyMechanical. "
"Chunk sizes bigger than 4 MB can generate unstable behaviour in PyMechanical. "
"Decrease the ``chunk_size`` value."
)

Expand Down Expand Up @@ -1516,8 +1516,8 @@ def save_chunks_to_file(self, responses, filename, progress_bar=False, target_na
if progress_bar:
if not _HAS_TQDM: # pragma: no cover
raise ModuleNotFoundError(
f"To use the keyword argument 'progress_bar', you need to have installed "
f"the 'tqdm' package.To avoid this message you can set 'progress_bar=False'."
"To use the keyword argument 'progress_bar', you need to have installed "
"the 'tqdm' package.To avoid this message you can set 'progress_bar=False'."
)

file_size = 0
Expand Down Expand Up @@ -1570,7 +1570,6 @@ def download_project(self, extensions=None, target_dir=None, progress_bar=False)
Download all the files in the project.
>>> local_file_path_list = mechanical.download_project()
"""
destination_directory = target_dir.rstrip("\\/")

Expand Down
6 changes: 3 additions & 3 deletions src/ansys/mechanical/core/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,8 @@ def map(
if progress_bar:
if not _HAS_TQDM: # pragma: no cover
raise ModuleNotFoundError(
f"To use the keyword argument 'progress_bar', you must have installed "
f"the 'tqdm' package. To avoid this message, you can set 'progress_bar=False'."
"To use the keyword argument 'progress_bar', you must have installed "
"the 'tqdm' package. To avoid this message, you can set 'progress_bar=False'."
)

pbar = tqdm(total=jobs_count, desc="Mechanical Running")
Expand Down Expand Up @@ -386,7 +386,7 @@ def run(name_local=""):
else:
run_thread.join()
if not complete[0]: # pragma: no cover
LOG.error(f"Stopped instance because running failed.")
LOG.error("Stopped instance because running failed.")
try:
obj.exit()
except Exception as e:
Expand Down

0 comments on commit 2db6875

Please sign in to comment.