Skip to content

add compile_logp convenience function#607

Merged
AlexanderFengler merged 8 commits intomainfrom
compile_logp
Dec 28, 2024
Merged

add compile_logp convenience function#607
AlexanderFengler merged 8 commits intomainfrom
compile_logp

Conversation

@AlexanderFengler
Copy link
Copy Markdown
Member

adding small convenience function

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 3, 2024

Codecov Report

Attention: Patch coverage is 72.89720% with 29 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/hssm/distribution_utils/dist.py 67.18% 21 Missing ⚠️
src/hssm/hssm.py 73.33% 4 Missing ⚠️
src/hssm/distribution_utils/onnx/onnx.py 62.50% 3 Missing ⚠️
src/hssm/config.py 50.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
src/hssm/distribution_utils/__init__.py 100.00% <ø> (ø)
src/hssm/distribution_utils/onnx/__init__.py 100.00% <ø> (ø)
src/hssm/likelihoods/analytical.py 100.00% <ø> (ø)
src/hssm/utils.py 85.39% <100.00%> (ø)
tests/test_distribution_utils.py 100.00% <100.00%> (ø)
tests/test_hssm.py 100.00% <100.00%> (ø)
src/hssm/config.py 86.81% <50.00%> (ø)
src/hssm/distribution_utils/onnx/onnx.py 96.39% <62.50%> (ø)
src/hssm/hssm.py 76.69% <73.33%> (ø)
src/hssm/distribution_utils/dist.py 86.30% <67.18%> (ø)

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.

Looks good! Only a fewminor comments. I haven't had a chance to review the tutorials but I trust you, @AlexanderFengler 😆

@@ -0,0 +1,36 @@
name: Run fast tests
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.

Did you update these flows or do they come from a recent update?

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.

They came from a recent update, this is some git weirdness :/.
Seemed harmless enough so I let it pass, but annoying and not exactly sure what happened there.


def make_distribution(
rv: str | Type[RandomVariable],
rv: str | Type[RandomVariable] | RandomVariable | Callable,
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.

This argument can be confusing now since it also accepts a callable. Might be a good idea to have a separate simulator_fn argument if someone wants to pass a simulator

DDM: Type[pm.Distribution] = make_distribution(
"ddm",
logp_ddm,
rv="ddm",
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.

does rv always have to be passed now? Is there a way to intelligently figure this out from the model string?

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