Skip to content

Commit

Permalink
1.0.1 release: python 3.7 support
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminye committed Nov 25, 2022
1 parent ae271ed commit 2ea25a7
Show file tree
Hide file tree
Showing 9 changed files with 1,105 additions and 1,036 deletions.
4 changes: 2 additions & 2 deletions oats/generator/_base.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from typing import Protocol, Tuple
from typing import Tuple
import numpy.typing as npt


class Generator(Protocol):
class Generator():
"""Base class for Generators
Because of complex behavior of generators. Method signatures are not strictly enforced.
But must implement `get_dataset()` method that returns `(train, test, label)`
Expand Down
3 changes: 1 addition & 2 deletions oats/models/_base.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
from typing import Protocol
import numpy.typing as npt
import numpy as np


class Model(Protocol):
class Model():
"""Base class for Models
Preprocessors are any function that transforms timeseries T to T'.
Expand Down
2 changes: 1 addition & 1 deletion oats/models/predictive/rnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Recurrent Neural Networks (RNN)
-----------------
"""
from typing import Any, Literal
from typing import Any
from functools import partial

from darts import models
Expand Down
1 change: 0 additions & 1 deletion oats/models/rule_based/quantile.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ def get_scores(self, data):
window_threshold = np.percentile(
data[i - self.window : i],
self.quantile * 100,
method="closest_observation",
)
E[i] = 1 if data[i] > window_threshold else 0

Expand Down
4 changes: 1 addition & 3 deletions oats/preprocessor/_base.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
from typing import Protocol

import numpy as np


class Preprocessor(Protocol):
class Preprocessor():
"""Base class for Preprocessors.
Preprocessors are any function that transforms timeseries T to T'.
Expand Down
5 changes: 1 addition & 4 deletions oats/scorer/_base.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
from typing import Protocol


class Scorer(Protocol):
class Scorer():
"""Base class for Scorers.
Scorer computes the result of a predictor; can be either unsupervised or supervised.
Expand Down
4 changes: 2 additions & 2 deletions oats/threshold/_base.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from typing import Protocol, Any
from typing import Any

import numpy as np


class Threshold(Protocol):
class Threshold():
"""Base class for thresholders
Preprocessor object must take a `fit()` method as well as `get_threshold()`.
Expand Down
Loading

0 comments on commit 2ea25a7

Please sign in to comment.