Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/ansys/fluent/core/filereader/lispy.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def repl(prompt="lispy> ", in_port=InputPort(sys.stdin), out=sys.stdout):
if val is not None and out:
print(to_string(val), file=out)
except Exception as e:
print("%s: %s" % (type(e).__name__, e))
print(f"{type(e).__name__}: {e}")


################ Environment class
Expand All @@ -242,7 +242,7 @@ def __init__(self, params=(), args=(), outer=None):
else:
if len(args) != len(params):
raise TypeError(
"expected %s, given %s, " % (to_string(params), to_string(args))
f"expected {to_string(params)}, given {to_string(args)}"
)
self.update(zip(params, args))

Expand Down
4 changes: 2 additions & 2 deletions src/ansys/fluent/core/fluent_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def get_container(container_id_or_name: str) -> Union[bool, Container, None]:
except docker.errors.NotFound: # NotFound is a child from DockerException
return False
except docker.errors.DockerException as exc:
logger.info("%s: %s" % (type(exc).__name__, exc))
logger.info(f"{type(exc).__name__}: {exc}")
return None
return container

Expand Down Expand Up @@ -396,7 +396,7 @@ def force_exit_container(self):
try:
container.exec_run(["bash", cleanup_filename], detach=True)
except docker.errors.APIError as e:
logger.debug("%s: %s" % (type(e).__name__, e))
logger.info(f"{type(e).__name__}: {e}")
logger.debug(
"Caught Docker APIError, Docker container probably not running anymore."
)
Expand Down
19 changes: 4 additions & 15 deletions src/ansys/fluent/core/launcher/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,19 +207,11 @@ def _build_fluent_launch_args_string(**kwargs) -> str:
old_argval = argval
argval = default
logger.warning(
"Default value %s is chosen for %s as the passed "
"value %s is outside allowed values %s.",
argval,
k,
old_argval,
allowed_values,
f"Specified value '{old_argval}' for argument '{k}' is not an allowed value ({allowed_values}), default value '{argval}' is going to be used instead."
)
else:
logger.warning(
"%s = %s is discarded as it is outside " "allowed values %s.",
k,
argval,
allowed_values,
f"{k} = {argval} is discarded as it is not an allowed value. Allowed values: {allowed_values}"
)
continue
fluent_map = v.get("fluent_map")
Expand Down Expand Up @@ -364,10 +356,7 @@ def _await_fluent_launch(
raise RuntimeError("The launch process has been timed out.")
time.sleep(1)
start_timeout -= 1
logger.info(
"Waiting for Fluent to launch...%02d seconds remaining",
start_timeout,
)
logger.info(f"Waiting for Fluent to launch...{start_timeout} seconds remaining")


def _get_server_info(
Expand Down Expand Up @@ -676,7 +665,7 @@ def launch_fluent(
)

try:
logger.debug("Launching Fluent with cmd: %s", launch_string)
logger.debug(f"Launching Fluent with cmd: {launch_string}")
sifile_last_mtime = Path(server_info_filepath).stat().st_mtime
if env is None:
env = {}
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/fluent/core/launcher/watchdog.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,5 +320,5 @@ def check_fluent_processes():

except BaseException as exc:
with open("pyfluent_watchdog.err", "w") as file:
file.write("%s: %s" % (type(exc).__name__, exc))
file.write(f"{type(exc).__name__}: {exc}")
raise
7 changes: 2 additions & 5 deletions src/ansys/fluent/core/services/interceptors.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,12 @@ def _intercept_call(
request: Any,
):
network_logger.debug(
"GRPC_TRACE: rpc = %s, request = %s",
client_call_details.method,
MessageToDict(request),
f"GRPC_TRACE: rpc = {client_call_details.method}, request = {MessageToDict(request)}"
)
response = continuation(client_call_details, request)
if not response.exception():
network_logger.debug(
"GRPC_TRACE: response = %s",
MessageToDict(response.result()),
f"GRPC_TRACE: response = {MessageToDict(response.result())}"
)
return response

Expand Down
4 changes: 2 additions & 2 deletions tests/util/fixture_fluent.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def get_file_type(full_file_name):

def download_input_file(directory_name, full_file_name, data_file_name=None):
file_type = get_file_type(full_file_name)
file_name = "_%s_%s_filename" % (full_file_name.split(".")[0], file_type)
file_name = f'_{full_file_name.split(".")[0]}_{file_type}_filename'
globals()[file_name] = None
if not globals()[file_name]:
globals()[file_name] = download_file(
Expand All @@ -29,7 +29,7 @@ def download_input_file(directory_name, full_file_name, data_file_name=None):
file_name = globals()[file_name]
if data_file_name:
dat_file_type = get_file_type(data_file_name)
dat_name = "_%s_%s_filename" % (data_file_name.split(".")[0], dat_file_type)
dat_name = f'_{data_file_name.split(".")[0]}_{dat_file_type}_filename'
globals()[dat_name] = None
if not globals()[dat_name]:
globals()[dat_name] = download_file(
Expand Down