Skip to content

Port Prior class from PyMC-Marketing #470

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

Merged
merged 17 commits into from
May 29, 2025

Conversation

williambdean
Copy link
Collaborator

@williambdean williambdean commented May 4, 2025

This ports the Prior class from PyMC-Marketing to pymc_extras.

The deserialize module is coming along for the ride as well.

Closes #448

CC: @drbenvincent

TODO:

  • Get rid of any PyMC-Marketing references

@williambdean
Copy link
Collaborator Author

test_prior file isn't being run? At least what the action logs are showing

@drbenvincent
Copy link

First time playing around with pymc-extras. I did:

conda env create -f conda-envs/environment-test.yml
conda activate pymc-extras-test
pytest tests/test_prior.py

and I got

=============================================================== test session starts ===============================================================
platform darwin -- Python 3.12.10, pytest-8.3.5, pluggy-1.6.0 -- /Users/benjamv/miniforge3/envs/pymc-extras-test/bin/python3.12
cachedir: .pytest_cache
rootdir: /Users/benjamv/git/pymc-extras
configfile: pyproject.toml
plugins: cov-6.1.1
collected 0 items / 2 skipped                                                                                                                     

=============================================================== 2 skipped in 35.11s ===============================================================

I'm probably doing something wrong with the environment setup?

@williambdean williambdean marked this pull request as ready for review May 20, 2025 13:18
@williambdean
Copy link
Collaborator Author

That seems to be with the preliz

pz = pytest.importorskip("preliz")

@williambdean
Copy link
Collaborator Author

williambdean commented May 20, 2025

Need to

  • add to docs
  • install test for tests

@williambdean
Copy link
Collaborator Author

tests passing, yay!

@williambdean
Copy link
Collaborator Author

@williambdean
Copy link
Collaborator Author

williambdean commented May 21, 2025

The init is showing up in the docs as well in a weird way
https://pymcio--470.org.readthedocs.build/projects/extras/en/470/generated/pymc_extras.prior.Prior.html#pymc_extras.prior.Prior.__init__

Might be something to do with the validate_call decorator

But also noticed some of the existing ones experience this already

@zaxtax
Copy link
Contributor

zaxtax commented May 25, 2025

@williambdean would it be possible to split out the deserialize module into its own PR for review that links to this one?

@williambdean
Copy link
Collaborator Author

Can be done

@williambdean
Copy link
Collaborator Author

@zaxtax, what aspects of it are you interested in pulling apart?

  • The deserialization moduleI
  • the to_dict / from_dict methods

@zaxtax
Copy link
Contributor

zaxtax commented May 26, 2025

@zaxtax, what aspects of it are you interested in pulling apart?

* The `deserialization` moduleI

* the `to_dict` / `from_dict` methods

Yep, there are also just a lot of updates to CI files and updating dependencies versions that seems not related

@williambdean
Copy link
Collaborator Author

Done with b9868bb

@zaxtax
Copy link
Contributor

zaxtax commented May 27, 2025 via email

@williambdean
Copy link
Collaborator Author

Sounds good. I will add in another PR shortly

@williambdean
Copy link
Collaborator Author

Think there is something is wrong on readthedocs end

Copy link

@juanitorduz juanitorduz left a comment

Choose a reason for hiding this comment

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

As this is a port from pymc-marketing this approval means I agree with the inclusion of this to pymc-extras and the code works as expected :)

@williambdean
Copy link
Collaborator Author

Thanks for the reviews! I don't have merge access

@zaxtax
Copy link
Contributor

zaxtax commented May 29, 2025 via email

@williambdean
Copy link
Collaborator Author

Good catch. Removed

@zaxtax
Copy link
Contributor

zaxtax commented May 29, 2025 via email

@zaxtax zaxtax merged commit 6619550 into pymc-devs:main May 29, 2025
17 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.

port pymc-marketing.prior module
4 participants