From 0cf2dcc12b05a0f8e3c1a0443a661a662a25cb53 Mon Sep 17 00:00:00 2001 From: bbayukari <17bbayukari@gmail.com> Date: Thu, 20 Jun 2024 00:36:32 +0800 Subject: [PATCH] fix: CI fail --- .../logistic-regression.ipynb | 12 +++++++++++- .../poisson-identity-link.ipynb | 4 ++-- pybind11 | 2 +- pytest/test_args.py | 10 ++-------- skscope/solver.py | 3 ++- 5 files changed, 18 insertions(+), 13 deletions(-) diff --git a/docs/source/gallery/GeneralizedLinearModels/logistic-regression.ipynb b/docs/source/gallery/GeneralizedLinearModels/logistic-regression.ipynb index ee7186e..2282e68 100644 --- a/docs/source/gallery/GeneralizedLinearModels/logistic-regression.ipynb +++ b/docs/source/gallery/GeneralizedLinearModels/logistic-regression.ipynb @@ -1,5 +1,15 @@ { "cells": [ + { + "cell_type": "code", + "execution_count": null, + "id": "1ac67c32", + "metadata": {}, + "outputs": [], + "source": [ + "%matplotlib inline" + ] + }, { "cell_type": "markdown", "id": "7f5e5d54", @@ -516,4 +526,4 @@ }, "nbformat": 4, "nbformat_minor": 5 -} +} \ No newline at end of file diff --git a/docs/source/gallery/GeneralizedLinearModels/poisson-identity-link.ipynb b/docs/source/gallery/GeneralizedLinearModels/poisson-identity-link.ipynb index fe002b6..82b43f0 100644 --- a/docs/source/gallery/GeneralizedLinearModels/poisson-identity-link.ipynb +++ b/docs/source/gallery/GeneralizedLinearModels/poisson-identity-link.ipynb @@ -5,7 +5,7 @@ "id": "f540b29b", "metadata": {}, "source": [ - "# Poisson Regression with Identity link" + "# multiple response non-negativity identity link Poisson model" ] }, { @@ -414,7 +414,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.14" + "version": "3.10.13" } }, "nbformat": 4, diff --git a/pybind11 b/pybind11 index e53d58a..3e9dfa2 160000 --- a/pybind11 +++ b/pybind11 @@ -1 +1 @@ -Subproject commit e53d58af6c0ade85fa6edce6a228ad2aeace55ee +Subproject commit 3e9dfa2866941655c56877882565e7577de6fc7b diff --git a/pytest/test_args.py b/pytest/test_args.py index 760cbaf..e460fd8 100644 --- a/pytest/test_args.py +++ b/pytest/test_args.py @@ -32,9 +32,7 @@ def test_numeric_solver(model, solver_creator): from skscope.numeric_solver import convex_solver_BFGS - solver = solver_creator( - model["n_features"], model["n_informative"], numeric_solver=convex_solver_BFGS - ) + solver = solver_creator(model["n_features"], model["n_informative"], numeric_solver=convex_solver_BFGS) solver.solve(model["loss"], jit=True) assert set(model["support_set"]) == set(solver.get_support()) @@ -169,9 +167,7 @@ def test_scope_hessian(): def test_scope_dynamic_max_exchange_num(): - solver = ScopeSolver( - linear["n_features"], linear["n_informative"], is_dynamic_max_exchange_num=False - ) + solver = ScopeSolver(linear["n_features"], linear["n_informative"], is_dynamic_max_exchange_num=False) solver.solve(linear["loss"], jit=True) assert set(linear["support_set"]) == set(solver.support_set) @@ -188,7 +184,6 @@ def test_scope_args(): path_type="gs", important_search=1, preselect=[linear["support_set"][0]], - console_log_level="error", ) solver.solve(linear["loss"], jit=True) @@ -200,6 +195,5 @@ def test_scope_args(): sample_size=linear["n_samples"], cv=2, split_method=lambda data, indeices: (data[0][indeices], data[1][indeices]), - file_log_level="error", ) solver.solve(linear["loss_data"], data=linear["data"]) diff --git a/skscope/solver.py b/skscope/solver.py index 83c6574..773e9e6 100644 --- a/skscope/solver.py +++ b/skscope/solver.py @@ -256,7 +256,8 @@ def _set_log_level(console_log_level, file_log_level, log_file_name): if not isinstance(log_file_name, str): raise ValueError("log_file_name must be a string") - _scope.init_spdlog(console_log_level, file_log_level, log_file_name) + if console_log_level < 6 or file_log_level < 6: + _scope.init_spdlog(console_log_level, file_log_level, log_file_name) def solve( self,