Skip to content

sund.load_model

sund.load_model(model)

Imports the class of a model and returns an instance of that class.

Equivalent to running:

Model_Class = sund.import_model("model")
model = Model_Class()

Parameters:

Name Type Description Default
model str

description

required

Returns:

Type Description
object

sund.Model object: A model object of the loaded model

Source code in src/sund/__init__.py
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
def load_model(model:str) -> object:
    """Imports the class of a model and returns an instance of that class.

    Equivalent to running:

    ```
    Model_Class = sund.import_model("model")
    model = Model_Class()
    ```

    Args:
        model (str): _description_

    Returns:
        sund.Model object: A model object of the loaded model
    """
    Model = import_model(model)
    return Model()