Skip to content

Commit 24eeb1a

Browse files
author
Juan Orduz
authored
Add support python 3.11 (#109)
* ci and setup to allow python 3.11 * update pylint * make new pylint happy * Empty-Commit * rm python 3.8 * Empty-Commit
1 parent 2be60af commit 24eeb1a

File tree

7 files changed

+31
-32
lines changed

7 files changed

+31
-32
lines changed

.github/workflows/publish-to-test-pypi.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@master
14-
- name: Set up Python 3.10
14+
- name: Set up Python 3.11
1515
uses: actions/setup-python@v3
1616
with:
17-
python-version: "3.10"
17+
python-version: "3.11"
1818

1919
- name: Install pypa/build
2020
run: >-

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
python-version: ["3.8", "3.9", "3.10"]
14+
python-version: ["3.9", "3.10", "3.11"]
1515

1616
name: Set up Python ${{ matrix.python-version }}
1717
steps:

.pylintrc

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,7 @@ disable=missing-docstring,
6363
too-many-branches,
6464
too-many-statements,
6565
too-many-instance-attributes,
66-
no-self-use,
6766
too-few-public-methods,
68-
bad-continuation,
6967
import-error,
7068
protected-access
7169

@@ -136,13 +134,6 @@ max-line-length=100
136134
# Maximum number of lines in a module
137135
max-module-lines=1000
138136

139-
# List of optional constructs for which whitespace checking is disabled. `dict-
140-
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
141-
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
142-
# `empty-line` allows space-only lines.
143-
no-space-check=trailing-comma,
144-
dict-separator
145-
146137
# Allow the body of a class to be on the same line as the declaration if body
147138
# contains single statement.
148139
single-line-class-stmt=no

pymc_bart/bart.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def _supp_shape_from_params(self, dist_params, rep_param_idx=1, param_shapes=Non
4747
return dist_params[0].shape[:1]
4848

4949
@classmethod
50-
def rng_fn(
50+
def rng_fn( # pylint: disable=W0237
5151
cls, rng=None, X=None, Y=None, m=None, alpha=None, beta=None, split_prior=None, size=None
5252
):
5353
if not cls.all_trees:
@@ -147,21 +147,21 @@ def __new__(
147147
bart_op = type(
148148
f"BART_{name}",
149149
(BARTRV,),
150-
dict(
151-
name="BART",
152-
all_trees=cls.all_trees,
153-
inplace=False,
154-
initval=Y.mean(),
155-
X=X,
156-
Y=Y,
157-
m=m,
158-
response=response,
159-
alpha=alpha,
160-
beta=beta,
161-
split_prior=split_prior,
162-
split_rules=split_rules,
163-
separate_trees=separate_trees,
164-
),
150+
{
151+
"name": "BART",
152+
"all_trees": cls.all_trees,
153+
"inplace": False,
154+
"initval": Y.mean(),
155+
"X": X,
156+
"Y": Y,
157+
"m": m,
158+
"response": response,
159+
"alpha": alpha,
160+
"beta": beta,
161+
"split_prior": split_prior,
162+
"split_rules": split_rules,
163+
"separate_trees": separate_trees,
164+
},
165165
)()
166166

167167
Distribution.register(BARTRV)

pymc_bart/utils.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,11 @@ def plot_ice(
246246
rng = np.random.default_rng(random_seed)
247247

248248
if func is None:
249-
func = lambda x: x
249+
250+
def identity(x):
251+
return x
252+
253+
func = identity
250254

251255
(
252256
X,
@@ -392,7 +396,11 @@ def plot_pdp(
392396
rng = np.random.default_rng(random_seed)
393397

394398
if func is None:
395-
func = lambda x: x
399+
400+
def identity(x):
401+
return x
402+
403+
func = identity
396404

397405
(
398406
X,

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ click==8.0.4
33
mypy>=1.1.1
44
pandas-stubs==1.5.3.230304
55
pre-commit
6-
pylint==2.10.2
6+
pylint==2.17.4
77
pytest-cov>=2.6.1
88
pytest>=4.4.0

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
"Development Status :: 5 - Production/Stable",
3030
"Programming Language :: Python",
3131
"Programming Language :: Python :: 3",
32-
"Programming Language :: Python :: 3.8",
3332
"Programming Language :: Python :: 3.9",
3433
"Programming Language :: Python :: 3.10",
34+
"Programming Language :: Python :: 3.11",
3535
"License :: OSI Approved :: Apache Software License",
3636
"Intended Audience :: Science/Research",
3737
"Topic :: Scientific/Engineering",

0 commit comments

Comments
 (0)