Skip to content

Commit

Permalink
lintfix, baby one more time
Browse files Browse the repository at this point in the history
  • Loading branch information
mitzimorris committed Feb 14, 2021
1 parent 0c04979 commit 989fe73
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions arviz/data/io_cmdstanpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,9 @@ def posterior_to_xarray(self):

return (
dict_to_dataset(data, library=self.cmdstanpy, coords=coords, dims=dims),
dict_to_dataset(
data_warmup, library=self.cmdstanpy, coords=coords, dims=dims
),
dict_to_dataset(data_warmup, library=self.cmdstanpy, coords=coords, dims=dims),
)


@requires("posterior")
def sample_stats_to_xarray(self):
"""Extract sample_stats from prosterior fit."""
Expand Down Expand Up @@ -141,14 +138,12 @@ def posterior_predictive_to_xarray(self):
"""Convert posterior_predictive samples to xarray."""
return self.predictive_to_xarray(self.posterior_predictive, self.posterior)


@requires("prior")
@requires("prior_predictive")
def prior_predictive_to_xarray(self):
"""Convert prior_predictive samples to xarray."""
return self.predictive_to_xarray(self.prior_predictive, self.prior)


def predictive_to_xarray(self, names, fit):
"""Convert predictive samples to xarray."""
predictive = _as_set(names)
Expand Down Expand Up @@ -279,7 +274,6 @@ def prior_to_xarray(self):
),
)


@requires("observed_data")
def observed_data_to_xarray(self):
"""Convert observed data to xarray."""
Expand Down Expand Up @@ -438,6 +432,7 @@ def sample_stats_to_xarray_pre_v_0_9_68(self, fit):
),
)


def _as_set(spec):
"""Uniform representation for args which be name or list of names."""
if spec is None:
Expand All @@ -448,7 +443,6 @@ def _as_set(spec):
return set(spec)



def _filter(names, spec):
"""Remove names from list of names."""
if isinstance(spec, str):
Expand All @@ -461,12 +455,12 @@ def _filter(names, spec):
names.remove(item)
return names


def _filter_columns(columns, spec):
"""Parse variable name from column label, removing element index, if any."""
return [col for col in columns if col.split("[")[0].split(".")[0] in spec]



def _unpack_fit(fit, items, save_warmup):
"""Transform fit to dictionary containing ndarrays.
Expand Down

0 comments on commit 989fe73

Please sign in to comment.