Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add uvad,test and update setup.py #7

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .script/install_poetry.sh
v-shuawei marked this conversation as resolved.
Show resolved Hide resolved

This file was deleted.

5 changes: 5 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
recursive-include anomaly-detector/anomaly_detector/univariate *.pyx
recursive-include anomaly-detector/anomaly_detector/univariate *.c
recursive-include anomaly-detector/anomaly_detector/univariate *.h
recursive-include anomaly-detector/anomaly_detector/univariate *.py
include setup.py
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
# Environment
python = 3.11

R >= 4.0

# Install

```git clone https://github.com/microsoft/anomaly-detector.git```

```cd anomaly-detector```

```pip install -r requirements.txt```

```python setup.py build_ext --inplace ```

# Test

```cd anomaly-detector```

```python tests/uvad_test.py```

# Project

> This repo has been populated by an initial template to help get you started. Please
Expand Down
1 change: 1 addition & 0 deletions anomaly-detector/anomaly_detector/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from .multivariate.model import MultivariateAnomalyDetector
from .univariate.univariate_anomaly_detection import UnivariateAnomalyDetector
11 changes: 11 additions & 0 deletions anomaly-detector/anomaly_detector/common/exception.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ def __repr__(self):
def to_dict(self):
return {"code": self.code, "message": self.message}

class AnomalyDetectionRequestError(Exception):
"""Raised when an error occurs in the request."""
def __init__(self, error_msg, error_code=None):
if isinstance(error_msg, type(b'')):
error_msg = error_msg.decode('UTF-8', 'replace')

super(AnomalyDetectionRequestError, self).__init__(
error_msg
)
self.message = error_msg
self.code = error_code

class DataFormatError(AnomalyDetectorException):
pass
Expand Down
5 changes: 5 additions & 0 deletions anomaly-detector/anomaly_detector/univariate/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from .util import fit_trend
from .util import get_period_pattern
from .model.detect_model import AnomalyDetectionModel
from .resource.error_message import InvalidJsonFormat, CustomSupportRequired
from .period import period_detection
Loading