diff --git a/.azure-pipelines/azure-pipelines-benchmarks.yml b/.azure-pipelines/azure-pipelines-benchmarks.yml index 91b1e08b8b..b2d8206333 100644 --- a/.azure-pipelines/azure-pipelines-benchmarks.yml +++ b/.azure-pipelines/azure-pipelines-benchmarks.yml @@ -26,10 +26,10 @@ jobs: - script: | python -m pip install --upgrade pip - python -m pip install wheel + python -m pip install wheel build python -m pip install --no-cache-dir -r requirements.txt python -m pip install --no-cache-dir -r requirements-optional.txt - python -m pip install asv==0.6.1 + python -m pip install asv displayName: 'Install requirements' - script: | diff --git a/.pylintrc b/.pylintrc index 80b60b1f82..b2c5bb5332 100644 --- a/.pylintrc +++ b/.pylintrc @@ -76,7 +76,11 @@ disable=missing-docstring, consider-using-f-string, # TODO: Remove this once update the code base. unnecessary-lambda-assignment, - use-dict-literal + use-dict-literal, + possibly-used-before-assignment, + # TODO (maybe): Remove this if the exess of issues related to that are fixed + # https://github.com/pylint-dev/pylint/issues?q=is%3Aissue+is%3Aopen+used-before-assignment+label%3A%22C%3A+used-before-assignment%22 + used-before-assignment # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option diff --git a/arviz/stats/stats.py b/arviz/stats/stats.py index 7e3e211e78..9747bc5f48 100644 --- a/arviz/stats/stats.py +++ b/arviz/stats/stats.py @@ -270,12 +270,12 @@ def gradient(weights): weights[i] = u_weights / np.sum(u_weights) weights = weights.mean(axis=0) - ses = pd.Series(z_bs.std(axis=0), index=names) # pylint: disable=no-member + ses = pd.Series(z_bs.std(axis=0), index=ics.index) # pylint: disable=no-member elif method.lower() == "pseudo-bma": min_ic = ics.iloc[0][f"elpd_{ic}"] z_rv = np.exp((ics[f"elpd_{ic}"] - min_ic) / scale_value) - weights = z_rv / np.sum(z_rv) + weights = (z_rv / np.sum(z_rv)).to_numpy() ses = ics["se"] if np.any(weights): diff --git a/arviz/tests/base_tests/test_stats.py b/arviz/tests/base_tests/test_stats.py index 3820ff364c..57b4bf16b5 100644 --- a/arviz/tests/base_tests/test_stats.py +++ b/arviz/tests/base_tests/test_stats.py @@ -179,7 +179,7 @@ def test_compare_same(centered_eight, multidim_models, method, multidim): else: data_dict = {"first": centered_eight, "second": centered_eight} - weight = compare(data_dict, method=method)["weight"] + weight = compare(data_dict, method=method)["weight"].to_numpy() assert_allclose(weight[0], weight[1]) assert_allclose(np.sum(weight), 1.0) diff --git a/asv_benchmarks/asv.conf.json b/asv_benchmarks/asv.conf.json index 7a421e18a6..4d9ea11d71 100644 --- a/asv_benchmarks/asv.conf.json +++ b/asv_benchmarks/asv.conf.json @@ -35,7 +35,14 @@ // If missing or the empty string, the tool will be automatically // determined by looking for tools on the PATH environment // variable. - "environment_type": "conda", + "environment_type": "virtualenv", + + // The command to run to build the project. + // copied from https://github.com/sympy/sympy/issues/26239 to fix the libmamba issue + "build_command": [ + "python -m pip install build", + "python -m build --wheel -o {build_cache_dir} {build_dir}" + ], // timeout in seconds for installing any dependencies in environment // defaults to 10 min @@ -50,7 +57,7 @@ // The list of conda channel names to be searched for benchmark // dependency packages in the specified order - "conda_channels": ["conda-forge", "defaults",], + // "conda_channels": ["conda-forge", "defaults",], // The matrix of dependencies to test. Each key is the name of a // package (in PyPI) and the values are version numbers. An empty