Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add compile_logp convenience function #607

Merged
merged 8 commits into from
Dec 28, 2024
Merged

add compile_logp convenience function #607

merged 8 commits into from
Dec 28, 2024

Conversation

AlexanderFengler
Copy link
Collaborator

adding small convenience function

Copy link

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
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
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
Collaborator 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.

src/hssm/distribution_utils/dist.py Outdated Show resolved Hide resolved
def make_distribution(
rv: str | Type[RandomVariable],
rv: str | Type[RandomVariable] | RandomVariable | Callable,
Copy link
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

@@ -396,22 +396,21 @@ def logp_ddm_sdv(
ddm_sdv_params = ddm_params + ["sv"]

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

@AlexanderFengler AlexanderFengler merged commit fd030b9 into main Dec 28, 2024
11 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.

2 participants