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

Make quartile_int a class #570

Merged
merged 4 commits into from
Oct 28, 2024
Merged

Conversation

rohanbabbar04
Copy link
Contributor

Description

Closes #547

  • Make QuartileInt class

Checklist

  • Code style is correct (follows pylint and black guidelines)
  • Includes new or updated tests to cover the new feature
  • New features are properly documented (with an example if appropriate)
  • Includes a sample plot to visually illustrate the changes (only for plot-related functions)
  • Widget states have been properly saved (only for notebooks with widgets) see for details.

@aloctavodia
Copy link
Contributor

Hi, it seems to need to rebase as there are unrelated commits in this PR.

@rohanbabbar04
Copy link
Contributor Author

Hi, it seems to need to rebase as there are unrelated commits in this PR.

Fixed that, now should include commits for this PR

@aloctavodia
Copy link
Contributor

Have you tried the function yourself?

@@ -373,6 +373,7 @@ def fit_to_sample(selected_distributions, sample, x_min, x_max):

def fit_to_quartile(dist_names, q1, q2, q3, extra_pros):
error = np.inf
fitted_dist = None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in case we are not able to fit a thing (for instance a domain error)

preliz/internal/predictive_helper.py Outdated Show resolved Hide resolved
self._q1 = q1
self._q2 = q2
self._q3 = q3
self.dist = None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to store the distribution that we fit, this is the main reason for this refactor

self.dist = fitted_dist

def _setup_observers(self):
def _match_distribution_(_):
Copy link
Contributor

@aloctavodia aloctavodia Oct 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to do this so we can call the function each time parameters change

@aloctavodia aloctavodia merged commit d17ee9f into arviz-devs:main Oct 28, 2024
4 checks passed
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.

Refactor quartile_int into a class
2 participants