Skip to content

Families/ adding base version of exponential family#67

Open
domosedy wants to merge 10 commits intoPySATL:mainfrom
domosedy:exponential-family
Open

Families/ adding base version of exponential family#67
domosedy wants to merge 10 commits intoPySATL:mainfrom
domosedy:exponential-family

Conversation

@domosedy
Copy link
Copy Markdown

@domosedy domosedy commented Feb 3, 2026

No description provided.

Comment thread src/pysatl_core/families/exponential_family.py
Comment thread src/pysatl_core/families/exponential_family.py Outdated
Comment thread src/pysatl_core/families/exponential_family.py Outdated
Comment thread src/pysatl_core/families/exponential_family.py Outdated
Comment thread src/pysatl_core/families/exponential_family.py Outdated
Comment thread src/pysatl_core/families/exponential_family.py Outdated
Comment thread src/pysatl_core/families/exponential_family.py Outdated
@Desiment Desiment self-requested a review February 20, 2026 19:02
Comment thread src/pysatl_core/families/exponential_family.py Outdated
Comment thread src/pysatl_core/families/exponential_family.py Outdated
Comment thread src/pysatl_core/families/exponential_family.py Outdated
Comment thread src/pysatl_core/families/exponential_family.py Outdated
Comment thread src/pysatl_core/families/exponential_family.py Outdated
Comment thread src/pysatl_core/families/exponential_family.py Outdated
Comment thread src/pysatl_core/families/exponential_family.py Outdated
Comment thread src/pysatl_core/families/exponential_family.py Outdated
Comment thread src/pysatl_core/families/exponential_family.py Outdated
Comment thread src/pysatl_core/families/exponential_family.py
@domosedy domosedy force-pushed the exponential-family branch 2 times, most recently from 779438f to 12516ff Compare March 29, 2026 18:56
@LeonidElkin LeonidElkin added core.families Enhancement New feature or request labels May 1, 2026
@LeonidElkin LeonidElkin added this to the Prototype alpha-version milestone May 1, 2026
Comment thread src/pysatl_core/types.py
Comment on lines +244 to +259
@dataclass(frozen=True, slots=True)
class IntervalND:
intervals: list[Interval1D]

def contains(self, x: Number | NumericArray) -> bool | BoolArray:
if not hasattr(x, "__iter__"):
x = np.array([x])

return all(
x_coordinate in interval
for interval, x_coordinate in zip(self.intervals, x, strict=True)
)

def __contains__(self, x: object) -> bool:
"""Check if a single point is in the interval."""
return bool(self.contains(cast(Number, x)))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Strange implementation of the contains method. If we check whether a point is contained in an N-dimensional interval, then at least we must accept an array of N elements, if we want to check M Points at once, then we must accept an array of M x N. You definitely don't need to implement the magic method __contains__ here

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I think the case when we check M points at once isn't really needed.
__contains__ method is mandatory for in operator

Comment thread src/pysatl_core/distributions/support.py Outdated
Comment thread src/pysatl_core/distributions/support.py Outdated
Comment thread src/pysatl_core/families/__init__.py Outdated
Comment on lines +30 to +32
type ParametrizedFunction = Callable[[Parametrization, Any], Any]
type SupportArg = Callable[[Parametrization], Support | None] | None
type NumberParameter = Number | NumericArray
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Move those types to types.py. SupportArg is already used in parametric_family.py so change there as well. NumberParameter is a bad naming, better smth like ArrayLikeNumeric or

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This type is not ArrayLike it's one of Number or Array. So I really don't know how to name this type

Comment thread src/pysatl_core/families/exponential_family.py
Comment thread src/pysatl_core/families/exponential_family.py
Comment thread src/pysatl_core/families/exponential_family.py
Comment thread src/pysatl_core/families/exponential_family.py Outdated
Comment thread tests/unit/families/test_exponential_family.py Outdated
@domosedy domosedy force-pushed the exponential-family branch from 66f7d09 to f67f3fd Compare May 3, 2026 21:18
@domosedy domosedy force-pushed the exponential-family branch from f67f3fd to 2d470c9 Compare May 3, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core.families Enhancement New feature or request

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

ExponentialClassFamily: conjugate prior support and posterior hyperparameters

3 participants