Skip to content

rework the priors API#156

Merged
arberqoku merged 6 commits intomainfrom
priors_api
Dec 10, 2025
Merged

rework the priors API#156
arberqoku merged 6 commits intomainfrom
priors_api

Conversation

@ilia-kats
Copy link
Collaborator

Instead of having prior-specific arguments in DataOptions, each prior now has a user-facing class whose constructor takes all prior-specific arguments. Priors with no arguments, such as Normal or Laplace, can still be specified as strings.

User-facing API classes are generated automatically from the known priors and don't expose any methods or properties, since the user is not supposed to interact with them after construction.

Also restructure documentation. Now that we have a bit more material for
the main API page, we no longer need automodsumm and can use the
standard autosummary. Unfortunately, we still need  a custom module
template to make autosummary automatically generate stub pages for the
module contents.
If e.g. a GP prior with many parameters is used for a subset of groups,
it can now be specified only once, with the groups given as a tuple key
of the dict, instead of having to create multiple identical
GaussianProcess objects.
@arberqoku arberqoku self-assigned this Dec 10, 2025
@codecov
Copy link

codecov bot commented Dec 10, 2025

Codecov Report

❌ Patch coverage is 93.96552% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.52%. Comparing base (5696e2d) to head (94c0d22).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/mofaflex/_core/api/priors.py 90.00% 5 Missing ⚠️
src/mofaflex/_core/priors/base.py 91.66% 1 Missing ⚠️
.../_core/priors/gaussian_process/gaussian_process.py 95.45% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #156      +/-   ##
==========================================
- Coverage   89.59%   89.52%   -0.08%     
==========================================
  Files          52       53       +1     
  Lines        4855     4877      +22     
==========================================
+ Hits         4350     4366      +16     
- Misses        505      511       +6     
Files with missing lines Coverage Δ
src/mofaflex/__init__.py 100.00% <100.00%> (ø)
src/mofaflex/_core/__init__.py 100.00% <100.00%> (ø)
src/mofaflex/_core/api/__init__.py 100.00% <100.00%> (ø)
src/mofaflex/_core/mofaflex.py 93.56% <100.00%> (-0.06%) ⬇️
src/mofaflex/_core/priors/__init__.py 100.00% <100.00%> (ø)
...mofaflex/_core/priors/gaussian_process/__init__.py 100.00% <100.00%> (ø)
src/mofaflex/_core/priors/horseshoe.py 90.90% <100.00%> (ø)
src/mofaflex/_core/priors/spike_slab.py 83.33% <ø> (ø)
src/mofaflex/_core/priors/base.py 97.04% <91.66%> (-0.57%) ⬇️
.../_core/priors/gaussian_process/gaussian_process.py 90.07% <95.45%> (-0.67%) ⬇️
... and 1 more

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@arberqoku arberqoku merged commit 63ba208 into main Dec 10, 2025
7 of 9 checks passed
@arberqoku arberqoku deleted the priors_api branch December 10, 2025 16:04
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.

2 participants