Skip to content

Do not compare arrays with strings in make_initial_point_expression #5133

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 1 commit into from
Nov 3, 2021

Conversation

ricardoV94
Copy link
Member

This gets rid of numpy FutureWarnings when we set the initval to an array:

import numpy as np
import pymc as pm

with pm.Model() as m:
  x = pm.Normal('x', size=10, initval=np.arange(10))
m.recompute_initial_point()

@codecov
Copy link

codecov bot commented Nov 3, 2021

Codecov Report

Merging #5133 (510d7b8) into main (8950f21) will increase coverage by 9.71%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5133      +/-   ##
==========================================
+ Coverage   67.88%   77.60%   +9.71%     
==========================================
  Files          88       88              
  Lines       14098    14100       +2     
==========================================
+ Hits         9571    10942    +1371     
+ Misses       4527     3158    -1369     
Impacted Files Coverage Δ
pymc/initial_point.py 100.00% <100.00%> (ø)
pymc/step_methods/hmc/integration.py 78.84% <0.00%> (-3.85%) ⬇️
pymc/parallel_sampling.py 86.33% <0.00%> (-1.00%) ⬇️
pymc/tests/sampler_fixtures.py 90.51% <0.00%> (-0.73%) ⬇️
pymc/step_methods/hmc/nuts.py 95.00% <0.00%> (-0.63%) ⬇️
pymc/step_methods/hmc/base_hmc.py 90.32% <0.00%> (ø)
pymc/backends/base.py 86.25% <0.00%> (+0.76%) ⬆️
pymc/step_methods/hmc/hmc.py 92.30% <0.00%> (+1.92%) ⬆️
pymc/distributions/discrete.py 98.02% <0.00%> (+2.30%) ⬆️
pymc/util.py 74.35% <0.00%> (+2.56%) ⬆️
... and 22 more

Copy link
Member

@michaelosthege michaelosthege left a comment

Choose a reason for hiding this comment

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

Test failures are unrelated (flaky tests?).

I remember that you (?) mentioned this problem somewhere, but it looks like there's no corresponding issue?

Anyway, your changes fix it so that's good.

@ricardoV94
Copy link
Member Author

The failures are coming from #5131 because the Metropolis proposals are no longer following a global seeding, but several tests in test_step are based on this assumption.

@ricardoV94 ricardoV94 merged commit 6093fcd into pymc-devs:main Nov 3, 2021
@ricardoV94 ricardoV94 deleted the get_moment_str_comparison branch December 8, 2021 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants