NullModelDatabase#

class pharmpy.workflows.NullModelDatabase(**kwargs)[source]#

Bases: NonTransactionalModelDatabase

Dummy model database implementation

No operation does anything. This database can be used if no storing of files is desirable.

Methods Summary

retrieve_file(model_name, filename)

Retrieve one file related to a model

retrieve_local_files(name, destination_path)

Retrieve all files related to a model

retrieve_model(name)

Read a model from the database

retrieve_model_entry(name)

Read model entry from the database

retrieve_modelfit_results(name)

Read modelfit results from the database

store_local_file(model, path[, new_filename])

Store a file from the local machine

store_metadata(model, metadata)

Store metadata

store_model(model)

Store a model object

store_model_entry(model_entry)

Store model entry of the model entry bound to this transaction

store_modelfit_results(model)

Store modelfit results

Methods Documentation

retrieve_file(model_name, filename)[source]#

Retrieve one file related to a model

Note that if the database is implemented in the local filesystem it is allowed to return a path directly to the file in the database.

Parameters:
  • model_name (str) – Name of the model

  • filename (str) – Name of file

Returns:

Path – Path to local file

retrieve_local_files(name, destination_path)[source]#

Retrieve all files related to a model

Parameters:
  • model_name (str) – Name of the model

  • destination_path (Path) – Local destination path

retrieve_model(name)[source]#

Read a model from the database

Parameters:

model_name (str) – Name of the model

Returns:

Model – Retrieved model object

retrieve_model_entry(name)[source]#

Read model entry from the database

Parameters:

model_name (str) – Name of the model

Returns:

ModelEntry – Retrieved model entry object

retrieve_modelfit_results(name)[source]#

Read modelfit results from the database

Parameters:

model_name (str) – Name of the model

Returns:

Results – Retrieved model results object

store_local_file(model, path, new_filename=None)[source]#

Store a file from the local machine

Parameters:
  • model (Model) – Pharmpy model object

  • path (Path) – Path to file

  • new_filename (str|None) – Filename to give to the file. Optional, defaults to original filename given by path.

store_metadata(model, metadata)[source]#

Store metadata

Parameters:
  • model (Model) – Pharmpy model object

  • metadata (Dict) – A dictionary with metadata

store_model(model)[source]#

Store a model object

Parameters:

model (Model) – Pharmpy model object

store_model_entry(model_entry)[source]#

Store model entry of the model entry bound to this transaction

Parameters:

model_entry (ModelEntry) – Pharmpy ModelEntry object

store_modelfit_results(model)[source]#

Store modelfit results

Parameters:

model (Model) – Pharmpy model object