Skip to content

Add getter for observed variables #3558

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hersle
Copy link
Contributor

@hersle hersle commented Apr 13, 2025

Suggestion based on discussion in #3555 to "prevent" stuff like map(eq -> eq.lhs, observed(sys)) for a little nicer API.

My idea was to introduce a convenient observeds getter named symmetrically to unknowns.
But working through it, I realize that this leads to an "asymmetry" in the naming of equations and observed(s).

If you think this is a helpful addition, what is the best name?

  • observeds(sys)?
  • observed_variables(sys)?
  • unknowns(sys; observed = true)?
  • something else?

Checklist

  • Appropriate tests were added
  • Any code changes were done in a way that does not break public API
  • All documentation related to code changes were updated
  • The new code follows the
    contributor guidelines, in particular the SciML Style Guide and
    COLPRAC.
  • Any new documentation only uses public API

@hersle hersle force-pushed the observed_variables branch from 9bdcf45 to c0578f8 Compare April 13, 2025 14:35
@TorkelE
Copy link
Member

TorkelE commented Apr 18, 2025

I think observeds soudns quite weird, also, it doesn't directly distinguish from observed. observed_variables sounds better, but something shorter would be nice. Maybe either observed_vars, observed_syms would be good?

Alternatively, observables might work?

@ChrisRackauckas
Copy link
Member

I like observables

@ChrisRackauckas
Copy link
Member

It captures that these are lazily computed on-demand only if asked for, which is a use in computer science and matches this quite well. But then it also is a physical observable, can be measured from the system. It's a good fit.

@hersle
Copy link
Contributor Author

hersle commented Apr 19, 2025

Thanks, I think observables sounds great! Will change it when I get back.

@hersle hersle force-pushed the observed_variables branch from c0578f8 to efea3d7 Compare April 22, 2025 18:06
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

Successfully merging this pull request may close these issues.

3 participants