Skip to content

Commit

Permalink
Fix for an issue that could cause incorrect conversion to Constraint,…
Browse files Browse the repository at this point in the history
… extended tests to detect this, updated dependencies
  • Loading branch information
fjwillemsen committed Nov 1, 2023
1 parent 5ced57e commit 08fb58e
Show file tree
Hide file tree
Showing 5 changed files with 217 additions and 205 deletions.
30 changes: 15 additions & 15 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
alabaster==0.7.13 ; python_version >= "3.8" and python_version < "3.12"
appnope==0.1.3 ; python_version >= "3.8" and python_version < "3.12" and sys_platform == "darwin"
asttokens==2.4.0 ; python_version >= "3.8" and python_version < "3.12"
asttokens==2.4.1 ; python_version >= "3.8" and python_version < "3.12"
attrs==23.1.0 ; python_version >= "3.8" and python_version < "3.12"
babel==2.13.0 ; python_version >= "3.8" and python_version < "3.12"
babel==2.13.1 ; python_version >= "3.8" and python_version < "3.12"
backcall==0.2.0 ; python_version >= "3.8" and python_version < "3.12"
beautifulsoup4==4.12.2 ; python_version >= "3.8" and python_version < "3.12"
bleach==6.1.0 ; python_version >= "3.8" and python_version < "3.12"
certifi==2023.7.22 ; python_version >= "3.8" and python_version < "3.12"
cffi==1.16.0 ; python_version >= "3.8" and python_version < "3.12" and implementation_name == "pypy"
charset-normalizer==3.3.0 ; python_version >= "3.8" and python_version < "3.12"
charset-normalizer==3.3.2 ; python_version >= "3.8" and python_version < "3.12"
colorama==0.4.6 ; python_version >= "3.8" and python_version < "3.12" and sys_platform == "win32"
decorator==5.1.1 ; python_version >= "3.8" and python_version < "3.12"
defusedxml==0.7.1 ; python_version >= "3.8" and python_version < "3.12"
docutils==0.18.1 ; python_version >= "3.8" and python_version < "3.12"
dom-toml==0.6.1 ; python_version >= "3.8" and python_version < "3.12"
domdf-python-tools==3.6.1 ; python_version >= "3.8" and python_version < "3.12"
domdf-python-tools==3.7.0 ; python_version >= "3.8" and python_version < "3.12"
exceptiongroup==1.1.3 ; python_version >= "3.8" and python_version < "3.11"
executing==2.0.0 ; python_version >= "3.8" and python_version < "3.12"
executing==2.0.1 ; python_version >= "3.8" and python_version < "3.12"
fastjsonschema==2.18.1 ; python_version >= "3.8" and python_version < "3.12"
idna==3.4 ; python_version >= "3.8" and python_version < "3.12"
imagesize==1.4.1 ; python_version >= "3.8" and python_version < "3.12"
Expand All @@ -28,16 +28,16 @@ jedi==0.19.1 ; python_version >= "3.8" and python_version < "3.12"
jinja2==3.1.2 ; python_version >= "3.8" and python_version < "3.12"
joblib==1.3.2 ; python_version >= "3.8" and python_version < "3.12"
jsonschema-specifications==2023.7.1 ; python_version >= "3.8" and python_version < "3.12"
jsonschema==4.19.1 ; python_version >= "3.8" and python_version < "3.12"
jupyter-client==8.4.0 ; python_version >= "3.8" and python_version < "3.12"
jupyter-core==5.4.0 ; python_version >= "3.8" and python_version < "3.12"
jsonschema==4.19.2 ; python_version >= "3.8" and python_version < "3.12"
jupyter-client==8.5.0 ; python_version >= "3.8" and python_version < "3.12"
jupyter-core==5.5.0 ; python_version >= "3.8" and python_version < "3.12"
jupyterlab-pygments==0.2.2 ; python_version >= "3.8" and python_version < "3.12"
markupsafe==2.1.3 ; python_version >= "3.8" and python_version < "3.12"
matplotlib-inline==0.1.6 ; python_version >= "3.8" and python_version < "3.12"
mistune==3.0.2 ; python_version >= "3.8" and python_version < "3.12"
natsort==8.4.0 ; python_version >= "3.8" and python_version < "3.12"
nbclient==0.8.0 ; python_version >= "3.8" and python_version < "3.12"
nbconvert==7.9.2 ; python_version >= "3.8" and python_version < "3.12"
nbconvert==7.10.0 ; python_version >= "3.8" and python_version < "3.12"
nbformat==5.9.2 ; python_version >= "3.8" and python_version < "3.12"
nbsphinx==0.9.3 ; python_version >= "3.8" and python_version < "3.12"
numpy==1.24.4 ; python_version >= "3.8" and python_version < "3.12"
Expand All @@ -55,16 +55,16 @@ ptyprocess==0.7.0 ; python_version >= "3.8" and python_version < "3.12" and sys_
pure-eval==0.2.2 ; python_version >= "3.8" and python_version < "3.12"
pycparser==2.21 ; python_version >= "3.8" and python_version < "3.12" and implementation_name == "pypy"
pygments==2.16.1 ; python_version >= "3.8" and python_version < "3.12"
pytest==7.4.2 ; python_version >= "3.8" and python_version < "3.12"
pytest==7.4.3 ; python_version >= "3.8" and python_version < "3.12"
python-constraint2==2.0.0b3 ; python_version >= "3.8" and python_version < "3.12"
python-dateutil==2.8.2 ; python_version >= "3.8" and python_version < "3.12"
pytz==2023.3.post1 ; python_version >= "3.8" and python_version < "3.12"
pywin32==306 ; sys_platform == "win32" and platform_python_implementation != "PyPy" and python_version >= "3.8" and python_version < "3.12"
pyzmq==25.1.1 ; python_version >= "3.8" and python_version < "3.12"
referencing==0.30.2 ; python_version >= "3.8" and python_version < "3.12"
requests==2.31.0 ; python_version >= "3.8" and python_version < "3.12"
rpds-py==0.10.4 ; python_version >= "3.8" and python_version < "3.12"
scikit-learn==1.3.1 ; python_version >= "3.8" and python_version < "3.12"
rpds-py==0.10.6 ; python_version >= "3.8" and python_version < "3.12"
scikit-learn==1.3.2 ; python_version >= "3.8" and python_version < "3.12"
scipy==1.10.1 ; python_version >= "3.8" and python_version < "3.12"
six==1.16.0 ; python_version >= "3.8" and python_version < "3.12"
snowballstemmer==2.2.0 ; python_version >= "3.8" and python_version < "3.12"
Expand All @@ -85,11 +85,11 @@ tinycss2==1.2.1 ; python_version >= "3.8" and python_version < "3.12"
toml==0.10.2 ; python_version >= "3.8" and python_version < "3.12"
tomli==2.0.1 ; python_version >= "3.8" and python_version < "3.11"
tornado==6.3.3 ; python_version >= "3.8" and python_version < "3.12"
traitlets==5.11.2 ; python_version >= "3.8" and python_version < "3.12"
traitlets==5.13.0 ; python_version >= "3.8" and python_version < "3.12"
typing-extensions==4.8.0 ; python_version >= "3.8" and python_version < "3.12"
tzdata==2023.3 ; python_version >= "3.8" and python_version < "3.12"
urllib3==2.0.6 ; python_version >= "3.8" and python_version < "3.12"
wcwidth==0.2.8 ; python_version >= "3.8" and python_version < "3.12"
urllib3==2.0.7 ; python_version >= "3.8" and python_version < "3.12"
wcwidth==0.2.9 ; python_version >= "3.8" and python_version < "3.12"
webencodings==0.5.1 ; python_version >= "3.8" and python_version < "3.12"
xmltodict==0.13.0 ; python_version >= "3.8" and python_version < "3.12"
zipp==3.17.0 ; python_version >= "3.8" and python_version < "3.10"
16 changes: 12 additions & 4 deletions kernel_tuner/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -897,11 +897,19 @@ def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]:
number_is_int = isinstance(number, int)
if number_is_int:
if comparator == '<':
# (2 < x) == (2+1 <= x)
number += 1
if variables_on_left:
# (x < 2) == (x <= 2-1)
number -= 1
else:
# (2 < x) == (2+1 <= x)
number += 1
elif comparator == '>':
# (2 > x) == (2-1 >= x)
number -= 1
if variables_on_left:
# (x > 2) == (x >= 2+1)
number += 1
else:
# (2 > x) == (2-1 >= x)
number -= 1

# check if an operator is applied on the variables, if not return
operators = [r'\*\*', r'\*', r'\+']
Expand Down
Loading

0 comments on commit 08fb58e

Please sign in to comment.