Skip to content

improve naming to make logic clearer#902

Merged
AlexanderFengler merged 1 commit into
mainfrom
improve-params-only-logic
Mar 3, 2026
Merged

improve naming to make logic clearer#902
AlexanderFengler merged 1 commit into
mainfrom
improve-params-only-logic

Conversation

@AlexanderFengler
Copy link
Copy Markdown
Member

The way params_only was used before was highly confusing as it propagated through the function calls. It had one meaning and then suddenly flipped it's meaning conceptually.

This rename should make it clearer what it is actually doing at the level of the jax function constructors.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR clarifies the meaning of params_only throughout the JAX/ONNX likelihood wrappers by updating documentation and renaming an internal flag to better reflect whether observed data is present.

Changes:

  • Expanded params_only docstrings to explicitly describe the expected callable signature (f(data, *params) vs f(*params)).
  • Renamed an internal Op state flag from is_params_only to has_data to match the actual boolean meaning.
  • Removed leftover debug print() statements.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/hssm/distribution_utils/onnx.py Clarifies params_only semantics for ONNX-derived JAX logp constructors.
src/hssm/distribution_utils/jax.py Renames internal flag to has_data, aligns conditionals, and improves params_only documentation.
src/hssm/distribution_utils/dist.py Updates make_likelihood_callable docs to explain params_only as signature control (and None treated as False).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Collaborator

@digicosmos86 digicosmos86 left a comment

Choose a reason for hiding this comment

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

Great! I like this change!

Copy link
Copy Markdown
Collaborator

@cpaniaguam cpaniaguam left a comment

Choose a reason for hiding this comment

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

👍

@AlexanderFengler AlexanderFengler merged commit c12bc20 into main Mar 3, 2026
8 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.

4 participants