pymc-devs / pymc-devs/pymc-examples
Error in `examples/samplers/DEMetropolisZ_EfficiencyComparison.ipynb`
Open
Beginner friendly
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 398
- Forks
- 325
- Avg merge
- 9d 15m
- Merged PRs (30d)
- 1
Description
Not working with matplotlib '3.9.2'
──────────────────────────────────── Error running examples/samplers/DEMetropolisZ_EfficiencyComparison.ipynb ────────────────────────────────────
---------------------------------------------------------------------------
Exception encountered at "In [18]":
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
Cell In[18], line 1
----> 1 plot_forest_compare_analytical(results_df)
Cell In[12], line 41, in plot_forest_compare_analytical(results_df)
39 labels = ax.get_legend().__dict__["texts"]
40 labels = [label.__dict__["_text"] for label in labels]
---> 41 handles = ax.get_legend().__dict__["legendHandles"]
42 ax.legend(
43 handles[::-1],
44 labels[::-1],
(...)
49 title="94% and 50% HDI",
50 )
51 ax.set_title(
52 f"Comparison of MCMC Samples and Analytical Solutions\nFirst 5 Dimensions of {D} Dimensional Target Distribution"
53 )
KeyError: 'legendHandles'
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open examples/samplers/DEMetropolisZ_EfficiencyComparison.ipynb and inspect the plotting function in cell In [12], especially the legend handling reported in the traceback. Run the notebook with matplotlib 3.9.2 and confirm that cell In [18] completes without the KeyError and produces the comparison plot.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- matplotlib, python
- Domain
- data-visualization, documentation
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100