Skip to content

Separate forward map#428

Open
LucaMantani wants to merge 20 commits intomainfrom
separate-forward-map
Open

Separate forward map#428
LucaMantani wants to merge 20 commits intomainfrom
separate-forward-map

Conversation

@LucaMantani
Copy link
Copy Markdown
Member

This PR aims at separating the definition of the forward map from the pdf_model, granting us further flexibility to implement generalisations such as the addition of nuisance parameters or eft Wilson coefficients.

The main changes are:

  • remove pred_and_pdf function
  • Definition of an abstract class ForwardMap, which requires always the implementation of a __call__method with signature (pdf_grid_func, fk_arrays, params) -> predictions, pdf
  • The implementation of a particular case, which is the one we are currently using that does only PDF fitting.
  • Params are all the parameters of interest, and the first n_pdf_params are always assumed to be the pdf ones.

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 16, 2026

Codecov Report

❌ Patch coverage is 98.21429% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 95.20%. Comparing base (cf4d16e) to head (22207f3).
⚠️ Report is 23 commits behind head on main.

Files with missing lines Patch % Lines
colibri/forward_map.py 96.66% 1 Missing ⚠️

❌ Your patch check has failed because the patch coverage (98.21%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #428      +/-   ##
==========================================
+ Coverage   94.96%   95.20%   +0.23%     
==========================================
  Files          31       32       +1     
  Lines        1649     1667      +18     
==========================================
+ Hits         1566     1587      +21     
+ Misses         83       80       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@comane comane force-pushed the separate-forward-map branch from 59f1d0c to 1afebf6 Compare March 23, 2026 17:36
self,
pred_func: Callable[[jnp.ndarray, Any], jnp.ndarray],
pdf_model,
extra_param_names: list[str] = (),
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Suggested change
extra_param_names: list[str] = (),
extra_param_names: list[str] = [],

by the forward map via ``self.n_pdf_params``.
"""

def __init__(self, pdf_model, extra_param_names: list[str] = ()):
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Suggested change
def __init__(self, pdf_model, extra_param_names: list[str] = ()):
def __init__(self, pdf_model, extra_param_names: list[str] = []):

return self._pred_func(pdf, fk_tables), pdf


def forward_map(_pred_data, pdf_model, extra_param_names=()):
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Suggested change
def forward_map(_pred_data, pdf_model, extra_param_names=()):
def forward_map(_pred_data, pdf_model, extra_param_names=[]):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants