Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12", "3.13"]
python-version: ["3.12", "3.13", "3.14"]

name: Set up Python ${{ matrix.python-version }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ If you find any bugs or have any feature requests, please open an [issue](https:

## Installation

Kulprit requires a working Python interpreter (3.11+).
Kulprit requires a working Python interpreter (3.12+).

Assuming a standard Python environment is installed on your machine (including pip), Kulprit itself can be installed in one line using:

Expand Down
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ If you find any bugs or have any feature requests, please open an `issue <https:
Installation
============

Kulprit requires a working Python interpreter (3.11+). We recommend installing Python and key numerical libraries using the `Anaconda Distribution <https://www.anaconda.com/products/individual#Downloads>`_, which has one-click installers available on all major platforms.
Kulprit requires a working Python interpreter (3.12+). We recommend installing Python and key numerical libraries using the `Anaconda Distribution <https://www.anaconda.com/products/individual#Downloads>`_, which has one-click installers available on all major platforms.

Assuming a standard Python environment is installed on your machine (including pip), Kulprit itself can be installed in one line using pip:

Expand Down Expand Up @@ -59,7 +59,7 @@ Alternatively, if you want the bleeding-edge version of the package, you can ins
Dependencies
============

Kulprit is tested on Python 3.11+. Dependencies are listed in `pyproject.toml` and should all be installed by the Kulprit installer; no further action should be required.
Kulprit is tested on Python 3.12+. Dependencies are listed in `pyproject.toml` and should all be installed by the Kulprit installer; no further action should be required.


Contributing
Expand Down
4 changes: 2 additions & 2 deletions kulprit/projection/arviz_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def check_idata(idata, model, rng):
raise UserWarning("Incompatible model and inference data.")

# check if we have the log_likelihood group
if "log_likelihood" not in idata.groups():
if "log_likelihood" not in idata.groups:
warnings.warn(
"log_likelihood group is missing from idata, it will be computed.\n"
"To avoid this message, please run Bambi's fit method with the option "
Expand All @@ -89,7 +89,7 @@ def check_idata(idata, model, rng):
model.compute_log_likelihood(idata)

# check if we have the posterior_predictive group
if "posterior_predictive" not in idata.groups():
if "posterior_predictive" not in idata.groups:
model.predict(idata, kind="response", inplace=True, random_seed=rng)

return idata
Expand Down
2 changes: 1 addition & 1 deletion kulprit/projection/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def solve(neg_log_likelihood, preds, initial_guess, var_info, weights, tolerance
posterior_dict[key] = transformation(posterior_dict[key])
size += new_size

new_idata = from_dict(posterior=posterior_dict)
new_idata = from_dict({"posterior": posterior_dict})
loss = np.mean(objectives) * 0.5
else:
new_idata = None
Expand Down
8 changes: 4 additions & 4 deletions kulprit/projector.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,15 +334,15 @@ def _project(self, term_names, clusters=True):
# Add observed data and log-likelihood to the projected InferenceData object
# We only do this for the selected projected model, not the intermediate ones
if new_idata is not None:
new_idata.add_groups(observed_data=self._observed_dataset)
new_idata.add_groups(log_likelihood=compute_llk(new_idata, self._pymc_model))
new_idata["observed_data"] = self._observed_dataset
new_idata["log_likelihood"] = compute_llk(new_idata, self._pymc_model)
# remove the variables that are not in the submodel
vars_to_drop = [
var
for var in new_idata.posterior.data_vars
for var in new_idata["posterior"].ds.data_vars
if var not in (term_names + self._base_terms)
]
new_idata.posterior = new_idata.posterior.drop_vars(vars_to_drop)
new_idata["posterior"] = new_idata["posterior"].ds.drop_vars(vars_to_drop)

# build SubModel object and return
sub_model = SubModel(
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
dynamic = ["version"]
description = "Kullback-Leibler projections for Bayesian model selection."
dependencies = [
"arviz_plots >=0.7.0",
"bambi >=0.16",
"arviz_plots >=1.1.0",
"bambi @ git+https://github.com/bambinos/bambi.git",
"scikit-learn>=1.0.2"
]

Expand Down
Loading