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

create accessors for all distributions #186

Open
bentheiii opened this issue Feb 27, 2023 · 3 comments · May be fixed by #316
Open

create accessors for all distributions #186

bentheiii opened this issue Feb 27, 2023 · 3 comments · May be fixed by #316

Comments

@bentheiii
Copy link

Some distributions have this (like Exp), but others (like LogNormal) don't.

for example:

impl LogNormal {
  pub fn location(&self)->f64 { self.location }
  pub fn scale(&self)->f64 { self.scale }
}

this will make it far easier to interoperate these distributions in a variety of ways.

@YeungOnion
Copy link
Contributor

Those without parameter getters

  • Dirac
  • DiscreteUniform
  • LogNormal
  • Triangular
  • Uniform

@Qazalbash
Copy link

I'd like to contribute by adding this feature. Any important guidelines or considerations before I start?

@YeungOnion
Copy link
Contributor

Hi, thanks for finding a place to contribute!

Some considerations; I believe they are relevant mostly to the multivariate distributions (we may not have consistency on these yet):

  • it is Rust idiom to not include the word get for these kinds of functions
  • non-Copy fields should not clone for immutable accessor, clones should be opt-in by caller

@Qazalbash Qazalbash linked a pull request Jan 15, 2025 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants