diff --git a/src/mlfmu/api.py b/src/mlfmu/api.py index 2939bfd..d85c798 100644 --- a/src/mlfmu/api.py +++ b/src/mlfmu/api.py @@ -26,6 +26,7 @@ def from_string(command_string: str): return None return matches[0] + # run for mlfmu def run( command: MlFmuCommand, @@ -138,7 +139,6 @@ def __del__(self): logger.debug("MlFmuBuilder: destructor called, removing temporary build directory.") # The destructor should automatically delete the temporary directory (goes out of scope). - def build(self): """ Build an FMU from ml_model_file and interface_file and saves it to fmu_output_folder. @@ -267,7 +267,6 @@ def compile(self): print(ex) logger.debug("MLFmuBuilder: Done with compile") - def default_interface_file(self): """Return the path to a interface json file inside self.root_directory if it can be inferred.""" return MlFmuBuilder._find_default_file(self.root_directory, "json", "interface") @@ -413,7 +412,7 @@ def __init__( ml_model_file=ml_model_file, source_folder=source_folder, fmu_output_folder=fmu_output_folder, - build_folder=build_folder + build_folder=build_folder, ) def run(self): diff --git a/src/mlfmu/cli/mlfmu.py b/src/mlfmu/cli/mlfmu.py index 01f27e5..f3f1af1 100644 --- a/src/mlfmu/cli/mlfmu.py +++ b/src/mlfmu/cli/mlfmu.py @@ -11,6 +11,7 @@ logger = logging.getLogger(__name__) + def _argparser() -> argparse.ArgumentParser: parser = argparse.ArgumentParser( prog="mlfmu", @@ -73,7 +74,9 @@ def _argparser() -> argparse.ArgumentParser: ) # Add options for build command - _ = build_parser.add_argument("-i", "--interface-file", type=str, help="JSON file describing the FMU following schema") + _ = build_parser.add_argument( + "-i", "--interface-file", type=str, help="JSON file describing the FMU following schema" + ) _ = build_parser.add_argument("-m", "--model-file", type=str, help="ONNX file containing the ML Model") _ = build_parser.add_argument("-f", "--fmu-path", type=str, help="Path to where the built FMU should be saved") @@ -90,7 +93,9 @@ def _argparser() -> argparse.ArgumentParser: _ = code_generation_parser.add_argument( "--interface-file", type=str, help="json file describing the FMU following schema (e.g. interface.json)." ) - _ = code_generation_parser.add_argument("--model-file", type=str, help="onnx file containing the ML Model (e.g. example.onnx).") + _ = code_generation_parser.add_argument( + "--model-file", type=str, help="onnx file containing the ML Model (e.g. example.onnx)." + ) _ = code_generation_parser.add_argument( "--fmu-source-path", help="Path to where the generated FMU source code should be saved. Given path/to/folder the files can be found in path/to/folder/[FmuName]", diff --git a/src/mlfmu/utils/builder.py b/src/mlfmu/utils/builder.py index 284fcb3..daf7458 100644 --- a/src/mlfmu/utils/builder.py +++ b/src/mlfmu/utils/builder.py @@ -20,6 +20,7 @@ logger = logging.getLogger(__name__) + # Replacing all the template strings with their corresponding values and saving to new file def format_template_file(template_path: Path, save_path: Path, data: dict[str, str]): # TODO: Need to check that these calls are safe from a cybersecurity point of view