Skip to content

Commit

Permalink
Upgrading sensenet and fixing issues for Python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
mmerce committed Oct 2, 2024
1 parent f45f5a4 commit 1d310af
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests_01.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: [3.11]
python: [3.12]
env:
BIGML_USERNAME: ${{ secrets.BIGML_USERNAME }}
BIGML_API_KEY: ${{ secrets.BIGML_API_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests_05.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: [3.11]
python: [3.12]
env:
BIGML_USERNAME: ${{ secrets.BIGML_USERNAME }}
BIGML_API_KEY: ${{ secrets.BIGML_API_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests_22.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: [3.11]
python: [3.12]
env:
BIGML_USERNAME: ${{ secrets.BIGML_USERNAME }}
BIGML_API_KEY: ${{ secrets.BIGML_API_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests_23.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: [3.11]
python: [3.12]
env:
BIGML_USERNAME: ${{ secrets.BIGML_USERNAME }}
BIGML_API_KEY: ${{ secrets.BIGML_API_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests_36.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: [3.11]
python: [3.12]
env:
BIGML_USERNAME: ${{ secrets.BIGML_USERNAME }}
BIGML_API_KEY: ${{ secrets.BIGML_API_KEY }}
Expand Down
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ History
------------------

- Fixing the get_leaves function for local decision trees.
- Fixing setup issues in Python3.12
- Changing documentation templates.

9.8.0.dev1 (2024-02-28)
Expand Down
10 changes: 5 additions & 5 deletions bigml/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"""
import os
import logging
import warnings
import subprocess

from bigml.fields import Fields, sorted_headers, get_new_fields
Expand All @@ -40,12 +39,13 @@

#pylint: disable=locally-disabled,bare-except,ungrouped-imports
try:
# avoiding tensorflow info logging
warnings.filterwarnings("ignore", category=DeprecationWarning)
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
# bigml-sensenet should be installed for image processing
logging.disable(logging.WARNING)
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import tensorflow as tf
tf.get_logger().setLevel('ERROR')
tf.autograph.set_verbosity(0)
logging.getLogger("tensorflow").setLevel(logging.ERROR)
import sensenet
from bigml.images.featurizers import ImageFeaturizer as Featurizer
except:
pass
Expand Down
13 changes: 4 additions & 9 deletions bigml/deepnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,15 @@
import bigml.laminar.preprocess_np as pp

try:
# avoiding tensorflow info logging
warnings.filterwarnings("ignore", category=DeprecationWarning)
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
logging.disable(logging.WARNING)
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
logging.getLogger("tensorflow").setLevel(logging.ERROR)
import tensorflow as tf
tf.get_logger().setLevel('ERROR')
tf.autograph.set_verbosity(0)
LAMINAR_VERSION = False
except Exception:
LAMINAR_VERSION = True

try:
from sensenet.models.wrappers import create_model
from bigml.images.utils import to_relative_coordinates
from bigml.constants import IOU_REMOTE_SETTINGS
LAMINAR_VERSION = False
except Exception:
LAMINAR_VERSION = True

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
requires=[
"setuptools"
"setuptools==69.0.0"
]

[tool.black]
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
open(version_py_path).read()).group(1)

TOPIC_MODELING_DEPENDENCIES = ["cython", "pystemmer==2.2.0.1"]
IMAGES_DEPENDENCIES = ["bigml-sensenet==0.7.4"]
IMAGES_DEPENDENCIES = ["bigml-sensenet==0.7.5"]

# Concatenate files into the long description
file_contents = []
Expand All @@ -50,7 +50,7 @@
download_url="https://github.com/bigmlcom/python",
license="http://www.apache.org/licenses/LICENSE-2.0",
setup_requires = ['pytest'],
install_requires = ["unidecode", "bigml-chronos>=0.4.3", "requests",
install_requires = ["setuptools==69.0.0", "unidecode", "bigml-chronos>=0.4.3", "requests",
"requests-toolbelt", "msgpack", "numpy>=1.22", "scipy",
"javascript"],
extras_require={"images": IMAGES_DEPENDENCIES,
Expand Down

0 comments on commit 1d310af

Please sign in to comment.