Skip to content
Snippets Groups Projects
Commit 6f8bf46a authored by Amaury Bilocq's avatar Amaury Bilocq
Browse files

add private function in solver

parent 72e869bb
No related branches found
No related tags found
No related merge requests found
Pipeline #52491 passed
......@@ -22,7 +22,7 @@ def solve(user_params)->dict:
"""
# Validate the input parameters
params = validate_params(user_params)
params = _validate_params(user_params)
# Read the params dictionary
nbModes = params["nbModes"]
......@@ -99,7 +99,7 @@ def solve(user_params)->dict:
}
# Write the log file
write_log_file(params, results)
_write_log_file(params, results)
# Dictionary containing the results of the simulation
data = {
......@@ -116,7 +116,7 @@ def solve(user_params)->dict:
return data
def validate_params(params) -> dict:
def _validate_params(params) -> dict:
"""
Validate the input parameters dictionary, set default values where needed, enforce allowed values, and check numeric ranges.
......@@ -229,7 +229,7 @@ def validate_params(params) -> dict:
return validated_params
def get_metadata()->dict:
def _get_metadata()->dict:
metadata = {
"code_name": "~~~ pyTurbulence: Synthetic Turbulence Generator ~~~",
"author": "Amaury Bilocq",
......@@ -237,7 +237,7 @@ def get_metadata()->dict:
}
return metadata
def write_log_file(params, results):
def _write_log_file(params, results):
"""
Write the log file with metadata, parameters, and results.
......@@ -251,7 +251,7 @@ def write_log_file(params, results):
Dictionary containing the results of the simulation.
"""
log_file = os.path.join(params["output_dir"], "log.txt")
metadata = get_metadata()
metadata = _get_metadata()
with open(log_file, "w") as f:
# Display metadata
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment