From de9094812d038cbc2deb765645de2ba1ec3e4b14 Mon Sep 17 00:00:00 2001 From: Jonathan Calderon Chavez Date: Wed, 29 May 2024 00:08:13 +0000 Subject: [PATCH 1/5] commas --- Dockerfile.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile.tmpl b/Dockerfile.tmpl index 275750c4..3489e7c3 100644 --- a/Dockerfile.tmpl +++ b/Dockerfile.tmpl @@ -266,9 +266,9 @@ RUN pip install opencv-contrib-python opencv-python && \ /tmp/clean-layer.sh # Pin scipy until we update JAX b/335003097 -RUN pip install scipy==1.12.0 \ +RUN pip install "scipy==1.12.0" \ # Scikit-learn accelerated library for x86 - scikit-learn-intelex>=2023.0.1 \ + "scikit-learn-intelex>=2023.0.1" \ # HDF5 support h5py \ # PUDB, for local debugging convenience From e8debf2614e3465f11edb658d05f0ab60e254745 Mon Sep 17 00:00:00 2001 From: Jonathan Calderon Chavez Date: Thu, 30 May 2024 23:16:20 +0000 Subject: [PATCH 2/5] remove unused packages pt 3 --- tests/test_easyocr.py | 15 ------------ tests/test_ggplot.py | 12 ---------- tests/test_pykalman.py | 47 -------------------------------------- tests/test_vowpalwabbit.py | 10 -------- 4 files changed, 84 deletions(-) delete mode 100644 tests/test_easyocr.py delete mode 100644 tests/test_ggplot.py delete mode 100644 tests/test_pykalman.py delete mode 100644 tests/test_vowpalwabbit.py diff --git a/tests/test_easyocr.py b/tests/test_easyocr.py deleted file mode 100644 index 6a1b266e..00000000 --- a/tests/test_easyocr.py +++ /dev/null @@ -1,15 +0,0 @@ -import unittest - -import easyocr - -class TestEasyOCR(unittest.TestCase): - def test_readtext(self): - # The model_storage_directory is only need in tests where we overwrite HOME=/tmp - reader = easyocr.Reader(['en'], gpu=False, model_storage_directory='/root/.EasyOCR/model') - result = reader.readtext('/input/tests/data/english.png', detail = 0) - # ['Reduce your risk of coronavirus infection:', 'Clean hands with soap and water', - # 'or alcohol based hand rub', 'Cover nose and mouth when coughing and', - # 'sneezing with tissue or flexed elbow', 'Avoid close contact with anyone with', - # 'cold or flu like symptoms', 'Thoroughly cook meat and eggs', - # 'No unprotected contact with live wild', 'or farm animals', 'World Health', 'Organization'] - self.assertEqual(len(result), 12) diff --git a/tests/test_ggplot.py b/tests/test_ggplot.py deleted file mode 100644 index 30aec29f..00000000 --- a/tests/test_ggplot.py +++ /dev/null @@ -1,12 +0,0 @@ -import unittest -import os.path - -from ggplot import * - -class TestGgplot(unittest.TestCase): - - def test_plot(self): - p = ggplot(aes(x='mpg'), data=mtcars) + geom_histogram() - p.save("myplot.png") - - self.assertTrue(os.path.isfile("myplot.png")) diff --git a/tests/test_pykalman.py b/tests/test_pykalman.py deleted file mode 100644 index 26d86003..00000000 --- a/tests/test_pykalman.py +++ /dev/null @@ -1,47 +0,0 @@ -import unittest -import numpy as np -from pykalman import KalmanFilter -from pykalman import UnscentedKalmanFilter -from pykalman.sqrt import CholeskyKalmanFilter, AdditiveUnscentedKalmanFilter - -class TestPyKalman(unittest.TestCase): - def test_kalman_filter(self): - kf = KalmanFilter(transition_matrices = [[1, 1], [0, 1]], observation_matrices = [[0.1, 0.5], [-0.3, 0.0]]) - measurements = np.asarray([[1,0], [0,0], [0,1]]) # 3 observations - kf = kf.em(measurements, n_iter=5) - (filtered_state_means, filtered_state_covariances) = kf.filter(measurements) - (smoothed_state_means, smoothed_state_covariances) = kf.smooth(measurements) - return filtered_state_means - - def test_kalman_missing(self): - kf = KalmanFilter(transition_matrices = [[1, 1], [0, 1]], observation_matrices = [[0.1, 0.5], [-0.3, 0.0]]) - measurements = np.asarray([[1,0], [0,0], [0,1]]) # 3 observations - measurements = np.ma.asarray(measurements) - measurements[1] = np.ma.masked - kf = kf.em(measurements, n_iter=5) - (filtered_state_means, filtered_state_covariances) = kf.filter(measurements) - (smoothed_state_means, smoothed_state_covariances) = kf.smooth(measurements) - return filtered_state_means - - def test_unscented_kalman(self): - ukf = UnscentedKalmanFilter(lambda x, w: x + np.sin(w), lambda x, v: x + v, transition_covariance=0.1) - (filtered_state_means, filtered_state_covariances) = ukf.filter([0, 1, 2]) - (smoothed_state_means, smoothed_state_covariances) = ukf.smooth([0, 1, 2]) - return filtered_state_means - - def test_online_update(self): - kf = KalmanFilter(transition_matrices = [[1, 1], [0, 1]], observation_matrices = [[0.1, 0.5], [-0.3, 0.0]]) - measurements = np.asarray([[1,0], [0,0], [0,1]]) # 3 observations - measurements = np.ma.asarray(measurements) - measurements[1] = np.ma.masked # measurement at timestep 1 is unobserved - kf = kf.em(measurements, n_iter=5) - (filtered_state_means, filtered_state_covariances) = kf.filter(measurements) - for t in range(1, 3): - filtered_state_means[t], filtered_state_covariances[t] = \ - kf.filter_update(filtered_state_means[t-1], filtered_state_covariances[t-1], measurements[t]) - return filtered_state_means - - def test_robust_sqrt(self): - kf = CholeskyKalmanFilter(transition_matrices = [[1, 1], [0, 1]], observation_matrices = [[0.1, 0.5], [-0.3, 0.0]]) - ukf = AdditiveUnscentedKalmanFilter(lambda x, w: x + np.sin(w), lambda x, v: x + v, observation_covariance=0.1) - diff --git a/tests/test_vowpalwabbit.py b/tests/test_vowpalwabbit.py deleted file mode 100644 index 839aed05..00000000 --- a/tests/test_vowpalwabbit.py +++ /dev/null @@ -1,10 +0,0 @@ -import unittest - -from vowpalwabbit import pyvw - -class TestVowpalwabbit(unittest.TestCase): - def test_basic(self): - vw = pyvw.vw(quiet=True) - ex = vw.example('1 | a b c') - vw.learn(ex) - self.assertGreater(vw.predict(ex), 0) From fb649f4bb91ba02998cf7d75ed84333a646f68cf Mon Sep 17 00:00:00 2001 From: Jonathan Calderon Chavez Date: Thu, 30 May 2024 23:18:35 +0000 Subject: [PATCH 3/5] remove unused packages pt. 3 --- Dockerfile.tmpl | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/Dockerfile.tmpl b/Dockerfile.tmpl index 3489e7c3..87d9d48b 100644 --- a/Dockerfile.tmpl +++ b/Dockerfile.tmpl @@ -305,7 +305,6 @@ RUN pip install mpld3 \ nilearn \ nibabel \ imgaug \ - preprocessing \ path.py \ Geohash && \ pip install deap \ @@ -322,7 +321,6 @@ RUN pip install mpld3 \ missingno \ pandas-profiling \ s2sphere \ - bayesian-optimization \ matplotlib-venn \ pyldavis \ mlxtend \ @@ -340,7 +338,6 @@ RUN pip install mpld3 \ wavio \ SimpleITK \ hmmlearn \ - gplearn \ squarify \ fuzzywuzzy \ python-louvain \ @@ -354,7 +351,6 @@ RUN pip install mpld3 \ holoviews \ geoviews \ hypertools \ - mlens \ scikit-multilearn \ cleverhans \ leven \ @@ -365,7 +361,6 @@ RUN pip install mpld3 \ plotnine \ scikit-surprise \ pymongo \ - geoplot \ eli5 \ kaggle \ kagglehub \ @@ -377,9 +372,7 @@ RUN rm -rf /opt/conda/lib/python3.10/site-packages/numpy-1.23.5.dist-info* # Add google PAIR-code Facets RUN cd /opt/ && git clone https://github.com/PAIR-code/facets && cd facets/ && jupyter nbextension install facets-dist/ --user && \ export PYTHONPATH=$PYTHONPATH:/opt/facets/facets_overview/python/ && \ - pip install kmodes --no-dependencies && \ pip install librosa \ - polyglot \ sentencepiece \ cufflinks \ lime \ @@ -416,7 +409,6 @@ RUN pip install annoy \ # Add Japanese morphological analysis engine janome \ wfdb \ - vecstack \ # yellowbrick machine learning visualization library yellowbrick \ mlcrate && \ @@ -529,10 +521,7 @@ RUN pip install flashtext \ cesium \ rgf_python \ jieba \ - # ggplot is broken and main repo does not merge and release https://github.com/yhat/ggpy/pull/668 - https://github.com/hbasria/ggpy/archive/0.11.5.zip \ tsfresh \ - pykalman \ optuna \ plotly_express \ albumentations \ @@ -554,7 +543,6 @@ RUN pip install pytorch-ignite \ kaggle-environments \ geopandas \ "shapely<2" \ - vowpalwabbit \ pydub \ pydegensac \ torchmetrics \ @@ -564,7 +552,6 @@ RUN pip install pytorch-ignite \ flask \ # pycrypto is used by competitions team. pycryptodome \ - easyocr \ # ipympl adds interactive widget support for matplotlib ipympl==0.7.0 \ onnx \ From 53316d86fb8b72170483f63b0e9419ce2cd7fbde Mon Sep 17 00:00:00 2001 From: Jonathan Calderon Chavez Date: Fri, 31 May 2024 20:33:57 +0000 Subject: [PATCH 4/5] remove test --- tests/test_bayes_opt.py | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 tests/test_bayes_opt.py diff --git a/tests/test_bayes_opt.py b/tests/test_bayes_opt.py deleted file mode 100644 index 99af8aea..00000000 --- a/tests/test_bayes_opt.py +++ /dev/null @@ -1,32 +0,0 @@ -import unittest - -from bayes_opt import BayesianOptimization - - -class TestBayesOpt(unittest.TestCase): - def test_optimize(self): - # Bounded region of parameter space - pbounds = {'x': (2, 4), 'y': (-3, 3)} - - optimizer = BayesianOptimization( - f=black_box_function, - pbounds=pbounds, - random_state=1, - ) - - optimizer.maximize( - init_points=2, - n_iter=1, - ) - - self.assertAlmostEqual(-7, optimizer.max['target'], places=0) # compares using 0 decimal - - -def black_box_function(x, y): - """Function with unknown internals we wish to maximize. - - This is just serving as an example, for all intents and - purposes think of the internals of this function, i.e.: the process - which generates its output values, as unknown. - """ - return -x ** 2 - (y - 1) ** 2 + 1 \ No newline at end of file From 7808581707d9768e4e2ccb0f21dca327c8c49e02 Mon Sep 17 00:00:00 2001 From: Jonathan Calderon Chavez Date: Fri, 31 May 2024 20:45:59 +0000 Subject: [PATCH 5/5] remove test --- Dockerfile.tmpl | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/Dockerfile.tmpl b/Dockerfile.tmpl index 87d9d48b..879f1c09 100644 --- a/Dockerfile.tmpl +++ b/Dockerfile.tmpl @@ -562,20 +562,6 @@ RUN pip install pytorch-ignite \ pip install git+https://github.com/facebookresearch/segment-anything.git && \ /tmp/clean-layer.sh -# Download base easyocr models. -# https://github.com/JaidedAI/EasyOCR#usage -RUN mkdir -p /root/.EasyOCR/model && \ - wget --no-verbose "https://github.com/JaidedAI/EasyOCR/releases/download/v1.3/latin_g2.zip" -O /root/.EasyOCR/model/latin.zip && \ - unzip /root/.EasyOCR/model/latin.zip -d /root/.EasyOCR/model/ && \ - rm /root/.EasyOCR/model/latin.zip && \ - wget --no-verbose "https://github.com/JaidedAI/EasyOCR/releases/download/v1.3/english_g2.zip" -O /root/.EasyOCR/model/english.zip && \ - unzip /root/.EasyOCR/model/english.zip -d /root/.EasyOCR/model/ && \ - rm /root/.EasyOCR/model/english.zip && \ - wget --no-verbose "https://github.com/JaidedAI/EasyOCR/releases/download/pre-v1.1.6/craft_mlt_25k.zip" -O /root/.EasyOCR/model/craft_mlt_25k.zip && \ - unzip /root/.EasyOCR/model/craft_mlt_25k.zip -d /root/.EasyOCR/model/ && \ - rm /root/.EasyOCR/model/craft_mlt_25k.zip && \ - /tmp/clean-layer.sh - # Tesseract and some associated utility packages RUN apt-get install tesseract-ocr -y && \ pip install pytesseract \