Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename swap_observed() to replace_observed() #232

Open
Tracked by #212
alyst opened this issue Jan 5, 2025 · 1 comment
Open
Tracked by #212

Rename swap_observed() to replace_observed() #232

alyst opened this issue Jan 5, 2025 · 1 comment

Comments

@alyst
Copy link
Contributor

alyst commented Jan 5, 2025

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, ...).

@Maximilian-Stefan-Ernst
Copy link
Collaborator

I agree - I add this to the todo for v0.3.0.

22 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants