Skip to content

Commit

Permalink
Merge Anomaly Detector code into main (#43)
Browse files Browse the repository at this point in the history
* update python version & add tests for different python versions

* update python version & add tests for different python versions (#14)

* update setup.py (#13)

* add uvad and test

* step1

* setp2

* update Readme.md

* add dockerfile ,move get_margins

* fix predict

* delete pyd

* build success

* add build.py but no .pyd file generated

* update setup.py

* fix some error

* add model folder

---------

Co-authored-by: Duan Juanyong <[email protected]>

* update gitignore

* remove r dependency (#16)

* remove r dependency

* replace rpy2 with rstl

* update

* add build and release workflow (#12)

* Bump gitpython from 3.1.40 to 3.1.41 in /anomaly-detector (#4)

Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.40 to 3.1.41.
- [Release notes](https://github.com/gitpython-developers/GitPython/releases)
- [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES)
- [Commits](gitpython-developers/GitPython@3.1.40...3.1.41)

---
updated-dependencies:
- dependency-name: gitpython
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump jinja2 from 3.1.2 to 3.1.3 in /anomaly-detector (#6)

Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.2 to 3.1.3.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](pallets/jinja@3.1.2...3.1.3)

---
updated-dependencies:
- dependency-name: jinja2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* add build workflow

* add build workflow

* add build workflow

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* merge

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* test on different python version (#17)

* Bump gitpython from 3.1.40 to 3.1.41 in /anomaly-detector (#4)

Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.40 to 3.1.41.
- [Release notes](https://github.com/gitpython-developers/GitPython/releases)
- [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES)
- [Commits](gitpython-developers/GitPython@3.1.40...3.1.41)

---
updated-dependencies:
- dependency-name: gitpython
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump jinja2 from 3.1.2 to 3.1.3 in /anomaly-detector (#6)

Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.2 to 3.1.3.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](pallets/jinja@3.1.2...3.1.3)

---
updated-dependencies:
- dependency-name: jinja2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* add build workflow

* add build workflow

* add build workflow

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* merge

* add more test cases

* delete some uvad test cases

* delete some uvad test cases

* add different python version

* add different python version

* add different python version

* add different python version

* add different python version

* add different python version

* add different python version

* add different python version

* add different python version

* add different python version

* add different python version

* add different python version

* add different python version

* add different python version

* add different python version

* add different python version

* add different python version

* add different python version

* add caching packages dependencies

* add cache dependencies to boost test

* add cache dependencies to boost test

* Update ci.yml

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* update param check

* test mlflow on UnivariateAnomalyDetector, add new class (#18)

* add e2e_test for UnivariateAnomalyDetector

* add EntireAnomalyDetector, LatestAnomalyDetector

* rename

* update model output & usage

* update test, remove saving results

* update model output to avoid duplicated keys

* check insufficient predict data

* test output (#20)

* Bump gitpython from 3.1.40 to 3.1.41 in /anomaly-detector (#4)

Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.40 to 3.1.41.
- [Release notes](https://github.com/gitpython-developers/GitPython/releases)
- [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES)
- [Commits](gitpython-developers/GitPython@3.1.40...3.1.41)

---
updated-dependencies:
- dependency-name: gitpython
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump jinja2 from 3.1.2 to 3.1.3 in /anomaly-detector (#6)

Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.2 to 3.1.3.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](pallets/jinja@3.1.2...3.1.3)

---
updated-dependencies:
- dependency-name: jinja2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* add build workflow

* add build workflow

* add build workflow

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* test poetry install

* merge

* add more test cases

* delete some uvad test cases

* delete some uvad test cases

* add different python version

* add different python version

* add different python version

* add different python version

* add different python version

* add different python version

* add different python version

* add different python version

* add different python version

* add different python version

* add different python version

* add different python version

* add different python version

* add different python version

* add different python version

* add different python version

* add different python version

* add different python version

* add caching packages dependencies

* add cache dependencies to boost test

* add cache dependencies to boost test

* Update ci.yml

* test output

* test output

* test output

* add license to all .py file

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* update numpy version to 1.26.x (#21)

* add e2e_test for UnivariateAnomalyDetector

* add EntireAnomalyDetector, LatestAnomalyDetector

* rename

* update numpy version to 1.26.x

* update Dockerfile & pandas version

* Update pyproject.toml

numpy>=1.23.5

* update ci.yml

* fix expectedValue error

* Update pipeline for pypi publish (#22)

* update gitignore

* update build pipeline to push to pypi

* Merge (#23)

* update gitignore

* update build pipeline to push to pypi

* install deps

* update pipeline (#24)

* update pipeline (#25)

* update pipeline (#26)

* update build option

* add wheel

* update pipeline

* add long description

* add long text description type

* change package name

* uploade src only

* update maintainer

* update build

* Bump mlflow from 2.9.2 to 2.10.0 in /anomaly-detector

Bumps [mlflow](https://github.com/mlflow/mlflow) from 2.9.2 to 2.10.0.
- [Release notes](https://github.com/mlflow/mlflow/releases)
- [Changelog](https://github.com/mlflow/mlflow/blob/master/CHANGELOG.md)
- [Commits](mlflow/mlflow@v2.9.2...v2.10.0)

---
updated-dependencies:
- dependency-name: mlflow
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* change package name

* update version

* Update README.md

* update pipeline

* update workflow file

* add sample notebook

* update workflow and ignore file

* add numpy for build

* change trigger condition

* release version v0.2.2 (#41)

* fix error in publish pipeline

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: shuawei <[email protected]>
Co-authored-by: luxiong-ms1 <[email protected]>
Co-authored-by: Zeke Xia <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: jr-MS <[email protected]>
Co-authored-by: Zeke Xia <[email protected]>
  • Loading branch information
7 people committed May 31, 2024
1 parent 5b11a75 commit 135f79a
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/anomaly_detector/univariate/util/critical_table.txt

Large diffs are not rendered by default.

63 changes: 63 additions & 0 deletions src/build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------

import os
import os
import numpy as np
from distutils.errors import CCompilerError, DistutilsExecError, DistutilsPlatformError

# See if Cython is installed
try:
from Cython.Build import cythonize
# Do nothing if Cython is not available
except ImportError:
# Got to provide this function. Otherwise, poetry will fail
def build(setup_kwargs):
pass
# Cython is installed. Compile
else:
from setuptools import Extension
from setuptools.dist import Distribution
from setuptools.command.build_ext import build_ext
# use cythonize to build the extensions
modules = ["./anomaly_detector/univariate/*.pyx"]
extensions = cythonize(modules,
language_level=3,
compiler_directives={'linetrace': True},
)


# cmdclass = {'build_ext': build_ext}
class BuildFailed(Exception):
pass


class ExtBuilder(build_ext):

def run(self):
try:
build_ext.run(self)
except (DistutilsPlatformError, FileNotFoundError):
raise BuildFailed('File not found. Could not compile C extension.')

def build_extension(self, ext):
try:
build_ext.build_extension(self, ext)
except (CCompilerError, DistutilsExecError, DistutilsPlatformError, ValueError):
raise BuildFailed('Could not compile C extension.')


cmdclass = {"build_ext": ExtBuilder}


def build(setup_kwargs):
"""Needed for the poetry building interface."""

os.environ['CFLAGS'] = '-O3'

setup_kwargs.update({
'ext_modules': extensions,
'include_dirs': [np.get_include()],
'cmdclass': cmdclass
})

0 comments on commit 135f79a

Please sign in to comment.