fenn.core¶
- class fenn.core.Fenn[source]¶
Bases:
objectBase class for a PyFenn application.
Wires together argument parsing, logging, secret storage, and result export into a single entry point. Subclass this or instantiate it directly, register your main logic with
entrypoint(), then callrun().Example
>>> app = Fenn() >>> @app.entrypoint ... def main(args): ... print(args) >>> app.run()
- property config_file: str¶
Path to the active YAML configuration file.
- disable_disclaimer()[source]¶
Suppress the startup banner printed before each run.
- Return type:
None
- entrypoint(entrypoint_fn)[source]¶
Register the application’s main function.
Use as a decorator. The decorated function receives the parsed configuration dict as its only argument and may return any value, which
run()will forward to the caller.- Parameters:
entrypoint_fn (Callable) – The callable to register as the application entry point. Must accept a single
argsdict argument.- Returns:
The original callable, unchanged (decorator passthrough).
- Return type:
Callable
- property export_dir: Path¶
Output directory for run artefacts (logs, models, exports).
- property parameters: map¶
- run()[source]¶
Execute the application.
Loads configuration from the YAML file, initialises logging and export directories, then calls the registered entrypoint function. Logging is always stopped cleanly, even if the entrypoint raises.
- Returns:
The value returned by the entrypoint function.
- Raises:
RuntimeError – If no entrypoint has been registered via
entrypoint().- Return type:
Any