Skip to content

Rename swap_observed() to replace_observed() #232

@alyst

Description

@alyst

swap_observed(model, data) call builds a new model, which is equivalent to the old model, but the existing observed object is replaced with data.
My concern is that swap usually implies that there are two objects that exchange some of their properties, so they are both modified (see e.g. c++ std), whereas in this case the change is unidirectional.
I suggest to call this function replace_observed(model, data).

In principle, for single SEM models it will be enough just to have a Sem(model, data) constructor -- I think from the user perspective it is quite logical what it should do.
But for ensemble models it would probably be less clear, whereas replace_observed can have oberloads like replace_observed(model, id, data), or replace_observed(model, id => data),
or even replace_observed(model, id1 => data1, id2 => data2, ...).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions