Upgrade pylint and black, closes #797

This commit is contained in:
davidmezzetti
2024-10-11 13:22:11 -04:00
parent bbddcd2a4f
commit c3b3fc9915
7 changed files with 15 additions and 16 deletions
+1 -1
View File
@@ -47,7 +47,7 @@ jobs:
- name: Build
run: |
pip install -U wheel
pip install .[all,dev]
pip install .[all,dev] fasttext==0.9.2
python -c "import nltk; nltk.download(['punkt', 'punkt_tab', 'averaged_perceptron_tagger_eng'])"
python --version
make data coverage
+3 -2
View File
@@ -1,13 +1,14 @@
repos:
- repo: https://github.com/pycqa/pylint
rev: v2.16.2
rev: v3.3.1
hooks:
- id: pylint
args:
- -d import-error
- -d duplicate-code
- -d too-many-positional-arguments
- repo: https://github.com/ambv/black
rev: 23.1.0
rev: 24.10.0
hooks:
- id: black
language_version: python3
+1 -1
View File
@@ -497,7 +497,7 @@ class Application:
st.markdown("Find players with similar statistics.")
category = self.category("Batting", "searchcategory")
stats, category = None, self.category("Batting", "searchcategory")
with st.form("search"):
if category == "Batting":
stats, columns = self.batting, self.batting.columns[:-6]
@@ -2,7 +2,6 @@
Index imports
"""
from .action import Action
from .autoid import AutoId
from .configuration import Configuration
+5 -7
View File
@@ -127,13 +127,11 @@ class Models:
return (
deviceid
if isinstance(deviceid, str)
else "cpu"
if deviceid < 0
else f"cuda:{deviceid}"
if torch.cuda.is_available()
else "mps"
if Models.hasmpsdevice()
else Models.finddevice()
else (
"cpu"
if deviceid < 0
else f"cuda:{deviceid}" if torch.cuda.is_available() else "mps" if Models.hasmpsdevice() else Models.finddevice()
)
)
@staticmethod
@@ -2,7 +2,6 @@
Pooling imports
"""
from .base import Pooling
from .cls import ClsPooling
from .factory import PoolingFactory
+5 -3
View File
@@ -127,9 +127,11 @@ class PGText(Scoring):
MetaData(),
Column("indexid", Integer, primary_key=True, autoincrement=False),
Column("text", Text),
Column("vector", TSVECTOR, Computed(f"to_tsvector('{self.language}', text)", persisted=True))
if self.engine.dialect.name == "postgresql"
else Column("vector", Integer),
(
Column("vector", TSVECTOR, Computed(f"to_tsvector('{self.language}', text)", persisted=True))
if self.engine.dialect.name == "postgresql"
else Column("vector", Integer)
),
)
# Create ANN index - inner product is equal to cosine similarity on normalized vectors