Skip to content

Upgrade CmdStanPy interface #1834

@bletham

Description

@bletham

The CmdStanPy version is currently pinned at 0.9.5, which came out Mar 11 2020.

Since then, there has been a breaking change in the interface for extracting parameter values as described here: stan-dev/cmdstanpy#287

Based on the dates, I expect that versions 0.9.67 and later are not compatible with fbprophet.

It should be straightforward to adapt our code to the new interface in that PR. Everything that needs to be changed on our end should be in these two functions, where we use CmdStanPy to do the optimization/sampling and then extract the parameter values:

def fit(self, stan_init, stan_data, **kwargs):

def sampling(self, stan_init, stan_data, samples, **kwargs) -> dict:

The extraction of parameter values is what has changed in CmdStanPy, and the logic for doing that in our code is in this function:

def stan_to_dict_numpy(column_names: Tuple[str, ...], data: 'np.array'):

Adapting that to the new interface will allow us to keep up with the latest CmdStanPy releases.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions