Module pyprotolinc.main
Main module. Configures the logger and provides the entry points of the command line runner.
- pyprotolinc.main.create_model(model_class: type[pyprotolinc.models.Model], state_model_name: str, assumptions_file: Optional[str], assumption_wrapper_opt: Optional[AssumptionSetWrapper]) Model
Create a valuation model.
- Parameters
model_class – The class of the model.
state_model_name (str) – The name of the state model.
assumptions_file – Path to the assumptions config file to be used.
assumption_wrapper – Object of type AssumptionSetWrapper that is used directly.
- Returns
The valuation model.
- Return type
Instance of model_class
- pyprotolinc.main.main() None
Entry point of the CLI client. Declares the following subtasks:
run to run start a run from the command line
profile to run start a run with profile information from the command line
download_dav_tables to download soem DAV tables from the R package mortality tables
- pyprotolinc.main.print_version() None
Print the version of the program.
- pyprotolinc.main.profile(config_file: str = 'config.yml', multi_processing_overwrite: Optional[bool] = None) None
Run and and export a CSV file with runtime statistics.
- Parameters
config_file (str) – Path ot the config file
multi_processing_overwrite – Optional boolen parameters that allows overwriting the multiprocessing setting in the config file.
- Returns
None
- pyprotolinc.main.project_cashflows(run_config: RunConfig, df_portfolio_overwrite: Optional[DataFrame] = None, assumption_wrapper: Optional[AssumptionSetWrapper] = None, export_to_file: bool = True) dict[str, numpy.ndarray[Any, numpy.dtype[numpy.float64]]]
The main calculation rountine, can also be called as library function. If a dataframe is passed it will be used to build the portfolio object, otherwise the portfolio will be obtained from th run-config.
- Parameters
run_config – The run configuration object.
df_portfolio_overwrite – An optional dataframe that will be used instead of the configured portfolio if provided
assumption_wrapper – Optionally an assumption set can be injected here directly instead of getting it via the configured paths
export_to_file – Boolean flag to indicate if the results should be written to a file (as specified in the config object)
- Returns
Dictionary containing the result vectors.
- Return type
dict[str, npt.NDArray[np.float64]]
- pyprotolinc.main.project_cashflows_cli(config_file_or_object: Union[str, RunConfig] = 'config.yml', multi_processing_overwrite: Optional[bool] = None) dict[str, numpy.ndarray[Any, numpy.dtype[numpy.float64]]]
Start a projection run.
- Parameters
config_file_or_object (str) – Path to the config file or a RunConfig
multi_processing_overwrite – Optional boolen parameter that allows overwriting the multiprocessing setting in the config file.
- Returns
None
- pyprotolinc.main.show_docs_in_browser() None
Show the readthedocs help pages in the system browser :return: None