Skip to content

Commit

Permalink
Add support python 3.11 (#109)
Browse files Browse the repository at this point in the history
* ci and setup to allow python 3.11

* update pylint

* make new pylint happy

* Empty-Commit

* rm python 3.8

* Empty-Commit
  • Loading branch information
juanitorduz committed Jul 12, 2023
1 parent 2be60af commit 24eeb1a
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 32 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish-to-test-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python 3.10
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: "3.10"
python-version: "3.11"

- name: Install pypa/build
run: >-
Expand Down
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.8", "3.9", "3.10"]
python-version: ["3.9", "3.10", "3.11"]

name: Set up Python ${{ matrix.python-version }}
steps:
Expand Down
9 changes: 0 additions & 9 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ disable=missing-docstring,
too-many-branches,
too-many-statements,
too-many-instance-attributes,
no-self-use,
too-few-public-methods,
bad-continuation,
import-error,
protected-access

Expand Down Expand Up @@ -136,13 +134,6 @@ max-line-length=100
# Maximum number of lines in a module
max-module-lines=1000

# List of optional constructs for which whitespace checking is disabled. `dict-
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
# `empty-line` allows space-only lines.
no-space-check=trailing-comma,
dict-separator

# Allow the body of a class to be on the same line as the declaration if body
# contains single statement.
single-line-class-stmt=no
Expand Down
32 changes: 16 additions & 16 deletions pymc_bart/bart.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def _supp_shape_from_params(self, dist_params, rep_param_idx=1, param_shapes=Non
return dist_params[0].shape[:1]

@classmethod
def rng_fn(
def rng_fn( # pylint: disable=W0237
cls, rng=None, X=None, Y=None, m=None, alpha=None, beta=None, split_prior=None, size=None
):
if not cls.all_trees:
Expand Down Expand Up @@ -147,21 +147,21 @@ def __new__(
bart_op = type(
f"BART_{name}",
(BARTRV,),
dict(
name="BART",
all_trees=cls.all_trees,
inplace=False,
initval=Y.mean(),
X=X,
Y=Y,
m=m,
response=response,
alpha=alpha,
beta=beta,
split_prior=split_prior,
split_rules=split_rules,
separate_trees=separate_trees,
),
{
"name": "BART",
"all_trees": cls.all_trees,
"inplace": False,
"initval": Y.mean(),
"X": X,
"Y": Y,
"m": m,
"response": response,
"alpha": alpha,
"beta": beta,
"split_prior": split_prior,
"split_rules": split_rules,
"separate_trees": separate_trees,
},
)()

Distribution.register(BARTRV)
Expand Down
12 changes: 10 additions & 2 deletions pymc_bart/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,11 @@ def plot_ice(
rng = np.random.default_rng(random_seed)

if func is None:
func = lambda x: x

def identity(x):
return x

func = identity

(
X,
Expand Down Expand Up @@ -392,7 +396,11 @@ def plot_pdp(
rng = np.random.default_rng(random_seed)

if func is None:
func = lambda x: x

def identity(x):
return x

func = identity

(
X,
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ click==8.0.4
mypy>=1.1.1
pandas-stubs==1.5.3.230304
pre-commit
pylint==2.10.2
pylint==2.17.4
pytest-cov>=2.6.1
pytest>=4.4.0
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"License :: OSI Approved :: Apache Software License",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
Expand Down

0 comments on commit 24eeb1a

Please sign in to comment.