diff --git a/.circleci/config.yml b/.circleci/config.yml index e7dc1c13..ae66c8fe 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -48,15 +48,6 @@ jobs: command: | sudo apt-get install -y libgeos-dev libproj-dev proj-data graphviz - - run: - name: Install llvmlite - command: | - sudo apt-get install lsb-release wget software-properties-common - wget https://apt.llvm.org/llvm.sh - chmod +x llvm.sh - sudo ./llvm.sh 10 - ls /usr/bin/llvm* - - run: name: Install standard libraries command: | @@ -74,15 +65,6 @@ jobs: pip install --no-binary shapely shapely pip install cartopy - - run: - name: Install numba, llvmlite - command: | - python -m venv venv - . venv/bin/activate - # export LLVM_CONFIG=/usr/local/opt/llvm/bin/llvm-config - sudo ln -s /usr/bin/llvm-config-10 /usr/bin/llvm-config - pip install llvmlite numba - - run: name: install dependencies command: | diff --git a/.travis.yml b/.travis.yml index 49cc62c2..222d6028 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,12 +17,6 @@ matrix: before_install: - sudo apt-get install libgeos-dev libproj-dev proj-data graphviz libblas-dev liblapack-dev - - wget https://apt.llvm.org/llvm.sh - - chmod +x llvm.sh - - sudo ./llvm.sh 10 - - ls /usr/bin/llvm* - - export LLVM_CONFIG=/usr/bin/llvm-config - # - sudo ln -s /usr/bin/llvm-config-10 /usr/bin/llvm-config - sudo apt-get -y install graphviz install: diff --git a/_unittests/ut_module/test_SKIP_code_style.py b/_unittests/ut_module/test_SKIP_code_style.py index 88b779eb..59012fe2 100644 --- a/_unittests/ut_module/test_SKIP_code_style.py +++ b/_unittests/ut_module/test_SKIP_code_style.py @@ -16,7 +16,7 @@ def test_style_src(self): check_pep8(src_, fLOG=fLOG, pylint_ignore=('C0103', 'C1801', 'R0201', 'R1705', 'W0108', 'W0613', 'W0201', 'W0221', 'E0632', 'R1702', 'W0212', 'W0223', - 'W0107', "R1720"), + 'W0107', "R1720", 'R1732'), skip=["categories_to_integers.py:174: W0640", "E0401: Unable to import 'mlinsights.mlmodel.piecewise_tree_regression_criterion", "setup.py:", @@ -29,7 +29,8 @@ def test_style_test(self): test = os.path.normpath(os.path.join(thi, "..", )) check_pep8(test, fLOG=fLOG, neg_pattern="temp_.*", pylint_ignore=('C0103', 'C1801', 'R0201', 'R1705', 'W0108', 'W0613', - 'C0111', 'W0107', 'C0111', 'R1702', 'C0415', "R1720"), + 'C0111', 'W0107', 'C0111', 'R1702', 'C0415', "R1720", + 'R1732'), skip=["Instance of 'tuple' has no", "[E402] module level import", "E0611: No name '_test_criterion_", diff --git a/mlinsights/mlmodel/_piecewise_tree_regression_common024.pyx b/mlinsights/mlmodel/_piecewise_tree_regression_common024.pyx index 5c2fd694..01f4c89b 100644 --- a/mlinsights/mlmodel/_piecewise_tree_regression_common024.pyx +++ b/mlinsights/mlmodel/_piecewise_tree_regression_common024.pyx @@ -43,6 +43,14 @@ cdef class CommonRegressorCriterion(Criterion): def __cinit__(self, const DOUBLE_t[:, ::1] X): self.sample_X = X + def __deepcopy__(self, memo=None): + """ + This does not a copy but mostly creates a new instance + of the same criterion initialized with the same data. + """ + inst = self.__class__(self.sample_X) + return inst + cdef void _update_weights(self, SIZE_t start, SIZE_t end, SIZE_t old_pos, SIZE_t new_pos) nogil: """ Updates members `weighted_n_right` and `weighted_n_left`