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

More consistent output from link functions #762

Merged
merged 4 commits into from
Feb 21, 2024
Merged

Conversation

lbittarello
Copy link
Member

No description provided.

@lbittarello
Copy link
Member Author

I removed the __new__ method of TweedieLink, because it's quite odd to instantiate a different class for a certain parametrisation and the benefits don't warrant it to my mind. Let me know if I should revert it.

We could also remove the calls to _asanyarray and have the link functions preserve the input type, which is consistent in a different way.

@lbittarello
Copy link
Member Author

In a similar vein, should we turn PoissonDistribution, GammaDistribution and NormalDistribution into fully fledged classes instead of inheriting from TweedieDistribution? The current setup makes it awkward for downstream packages to inherit from them: for example, if I want to modify both PoissonDistribution and TweedieDistribution, I either need to live with diamond inheritance (PoissonDistribution inherits from glum.PoissonDistribution, which inherits from glum.TweedieDistribution, and from my TweedieDistribution, which also inherits from glum.TweedieDistribution) or to following a different pattern from Glum and not have my PoissonDistribution inherit from my own TweedieDistribution.

@jtilly
Copy link
Member

jtilly commented Feb 14, 2024

In a similar vein, should we turn PoissonDistribution, GammaDistribution and NormalDistribution into fully fledged classes instead of inheriting from TweedieDistribution?

No objections.

@lbittarello
Copy link
Member Author

I'll leave it to a separate PR. :)

@lbittarello
Copy link
Member Author

@jtilly, @MarcAntoineSchmidtQC, any objections to this PR?

@lbittarello lbittarello merged commit 1284375 into main Feb 21, 2024
21 checks passed
@lbittarello lbittarello deleted the consistent-link-output branch February 21, 2024 08:36
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.

None yet

2 participants