Skip to content

Displayed inference library version is wrong in InferenceData from PyMC3 #1257

@rpgoldman

Description

@rpgoldman

Describe the bug

I was running PyMC3 version 3.9.1, and returned an InferenceData object from pymc3.sample(). The resulting InferenceData shows this:

>>> tr.posterior
<xarray.Dataset>
Dimensions:   (chain: 2, draw: 1000, features: 5)
Coordinates:
  * chain     (chain) int64 0 1
  * draw      (draw) int64 0 1 2 3 4 5 6 7 8 ... 992 993 994 995 996 997 998 999
  * features  (features) int64 0 1 2 3 4
Data variables:
    a         (chain, draw, features) float64 96.61 44.09 26.66 ... 78.56 -55.58
    b         (chain, draw, features) float64 -85.38 94.78 45.37 ... 29.86 7.584
Attributes:
    created_at:                 2020-06-21T20:22:46.159824
    arviz_version:              0.8.3
    inference_library:          pymc3
    inference_library_version:  3.8
    sampling_time:              2.887521743774414
    tuning_steps:               1000

But that is not the PyMC3 version reported by PyMC3:

>>> pm.__version__
'3.9.1'

To Reproduce

I ran this script (trying to replicate an issue in PyMC3):

import pymc3 as pm
import numpy as np

chains = 2
n_features = 5
n_samples = 1000

coords = {"features": np.arange(n_features)}

with pm.Model(coords=coords):
    a = pm.Uniform("a", -100, 100, dims="features")
    b = pm.Uniform("b", -100, 100, dims="features")
    tr = pm.sample(n_samples, chains=chains, return_inferencedata=True)

Expected behavior

Two reported versions of PyMC3 version should agree.

Additional context

ArviZ from git at 7cec6dd and PyMC3 from git at 66cd2163039b3c2f76420357ee801d7ec351c4fc

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions