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

fix initial MCMC values #302

Merged
merged 5 commits into from
Jun 28, 2023
Merged

fix initial MCMC values #302

merged 5 commits into from
Jun 28, 2023

Conversation

johannesostner
Copy link
Collaborator

Fixes initialization of MCMC values (pyro-ppl/numpyro#1604)

PR Checklist

  • Referenced issue is linked
  • If you've fixed a bug or added code that should be tested, add tests!
  • Documentation in docs is updated

Description of changes

Fixes initialization of MCMC values (pyro-ppl/numpyro#1604)

Technical details

numpyro 0.12 changed the way init_params is handled in MCMC (see pyro-ppl/numpyro#1604). This fix reflects these changes in pertpy

Fixes initialization of MCMC values (pyro-ppl/numpyro#1604)
@github-actions github-actions bot added the bug Something isn't working label Jun 27, 2023
@Zethson
Copy link
Member

Zethson commented Jun 27, 2023

mypy:


mypy.....................................................................Failed
- hook id: mypy
- exit code: 1

pertpy/tools/_coda/_tasccoda.py: note: In member "set_init_mcmc_states" of class "Tasccoda":
pertpy/tools/_coda/_tasccoda.py:308:5: error: Signature of
"set_init_mcmc_states" incompatible with supertype "CompositionalModel2" 
[override]
        def set_init_mcmc_states(self, rng_key: None, ref_index: np.ndarra...
        ^
pertpy/tools/_coda/_tasccoda.py:308:5: note:      Superclass:
pertpy/tools/_coda/_tasccoda.py:308:5: note:          def set_init_mcmc_states(self, *args: Any, **kwargs: Any) -> Any
pertpy/tools/_coda/_tasccoda.py:308:5: note:      Subclass:
pertpy/tools/_coda/_tasccoda.py:308:5: note:          def set_init_mcmc_states(self, rng_key: None, ref_index: Any, sample_adata: Any) -> Any
pertpy/tools/_coda/_sccoda.py: note: In member "set_init_mcmc_states" of class "Sccoda":
pertpy/tools/_coda/_sccoda.py:196:5: error: Signature of "set_init_mcmc_states"
incompatible with supertype "CompositionalModel2"  [override]
        def set_init_mcmc_states(self, rng_key: None, ref_index: np.ndarra...
        ^
pertpy/tools/_coda/_sccoda.py:196:5: note:      Superclass:
pertpy/tools/_coda/_sccoda.py:196:5: note:          def set_init_mcmc_states(self, *args: Any, **kwargs: Any) -> Any
pertpy/tools/_coda/_sccoda.py:196:5: note:      Subclass:
pertpy/tools/_coda/_sccoda.py:196:5: note:          def set_init_mcmc_states(self, rng_key: None, ref_index: Any, sample_adata: Any) -> Any
Found 2 errors in 2 files (checked 57 source files)

and flake8


pertpy/tools/_coda/_base_coda.py:294:104: B026 Star-arg unpacking after a keyword argument is strongly discouraged, because it only works when the keyword parameter is declared after all parameters supplied by the unpacked sequence, and this change of ordering can surprise and mislead readers.
pertpy/tools/_coda/_base_coda.py:348:102: B026 Star-arg unpacking after a keyword argument is strongly discouraged, because it only works when the keyword parameter is declared after all parameters supplied by the unpacked sequence, and this change of ordering can surprise and mislead readers.

@Zethson Zethson merged commit 653fa34 into development Jun 28, 2023
@Zethson Zethson deleted the fix/mcmc_init_values branch July 9, 2023 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants