Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 1 addition & 2 deletions .github/workflows/doctest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
pip install .[docs]
pip list

# Change the directory to the docs directory.
Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/test-notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,13 @@ jobs:
with:
python-version: '3.10' # Only for one python version to save on resources

# Install dependencies
- name: Install dependencies
# Install dtaianomaly + all dependencies
- name: Install dtaianomaly
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
pip install nbconvert jupyter
pip install .[all]
pip list

# Install dtaianomaly locally
- name: Install dtaianomaly
run: pip install .

# Test the notebooks
- name: Execute Anomaly detection notebook
run:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4
Expand All @@ -26,11 +26,11 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
# Install dtaianomaly + all dependencies
- name: Install dtaianomaly
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
pip install .[all]
pip install flake8
pip list

Expand Down
3 changes: 3 additions & 0 deletions docs/additional_information/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ Added
- Implemented ``KMeansAnomalyDetector`` anomaly detector.
- Implemented ``CopulaBasedOutlierDetector`` (COPOD) anomaly detector.
- Implemented ``RobustScaler`` preprocessor.
- Added optional dependencies to ``dtaianomaly``, rather than having to install
everything via different requirements files.
- Added support for Python 3.13.

Changed
^^^^^^^
Expand Down
25 changes: 11 additions & 14 deletions docs/additional_information/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,17 @@ Setup the environment

Next, you can set up your environment to start working on the issue.
For this, we highly recommend to `virtual environment <https://docs.python.org/3/library/venv.html>`_
to isolate the dependencies. To install the core-dependencies (e.g.,
`Numpy <https://numpy.org/>`_) of``dtaianomaly``, run the following
command:
to isolate the dependencies. To install the dependencies of
``dtaianomaly``, including all optional dependencies,
navigate to the directory where you downloaded the code and
run the following command:

.. code-block:: bash

pip install -r requirements.txt
pip install --editable .[all]

In addition, you should also install the development dependencies
(e.g., `pytest <https://docs.pytest.org/en/stable/>`_) as follows:

.. code-block:: bash

pip install -r requirements-dev.txt
You should include the ``--editable`` flag to ensure that your
changes to the code are actually reflected in the installed version.

To check if the environment is correct, you verify if all tests
succeed by running the following command (which also checks the
Expand Down Expand Up @@ -248,7 +245,7 @@ BaseDetector
| |check_box| Have you implemented the :py:func:`~dtaianomaly.anomaly_detection.BaseDetector.fit()` method?
| |check_box| Have you implemented the :py:func:`~dtaianomaly.anomaly_detection.BaseDetector.decision_function()` method?
| |check_box| Did you add the anomaly detector in ``__all__`` of the ``dtaianomaly/anomaly_detection/__init__.py`` file?
| |check_box| Can you load the anomaly detector via :py:func:`~dtaianomaly.workflow.interpret_config`` (specifically, in the ``detector_entry()`` function)?
| |check_box| Can you load the anomaly detector via :py:func:`~dtaianomaly.workflow.interpret_config` (specifically, in the ``detector_entry()`` function)?

.. rubric:: Test the anomaly detector

Expand Down Expand Up @@ -277,7 +274,7 @@ LazyDataLoader
| |check_box| Are all hyperparameters set as an attribute of the object (necessary for ``__str__()`` method)?
| |check_box| Have you implemented the :py:func:`~dtaianomaly.data.LazyDataLoader._load()` method?
| |check_box| Did you add the data loader in ``__all__`` of the ``dtaianomaly/data/__init__.py`` file?
| |check_box| Can you load the data loader via :py:func:`~dtaianomaly.workflow.interpret_config`` (specifically, in the ``data_entry()`` function)?
| |check_box| Can you load the data loader via :py:func:`~dtaianomaly.workflow.interpret_config` (specifically, in the ``data_entry()`` function)?

.. rubric:: Test the data loader

Expand Down Expand Up @@ -306,7 +303,7 @@ Preprocessor
| |check_box| Have you implemented the :py:func:`~dtaianomaly.preprocessing.Preprocessor._fit()` method?
| |check_box| Have you implemented the :py:func:`~dtaianomaly.preprocessing.Preprocessor._transform()` method?
| |check_box| Did you add the preprocessor in ``__all__`` of the ``dtaianomaly/preprocessing/__init__.py`` file?
| |check_box| Can you load the preprocessor via :py:func:`~dtaianomaly.workflow.interpret_config`` (specifically, in the ``preprocessor_entry()`` function)?
| |check_box| Can you load the preprocessor via :py:func:`~dtaianomaly.workflow.interpret_config` (specifically, in the ``preprocessor_entry()`` function)?

.. rubric:: Test the preprocessor

Expand Down Expand Up @@ -334,7 +331,7 @@ Thresholding
| |check_box| Are all hyperparameters set as an attribute of the object (necessary for ``__str__()`` method)?
| |check_box| Have you implemented the :py:func:`~dtaianomaly.thresholding.Thresholder.threshold()` method?
| |check_box| Did you add the thresholder in ``__all__`` of the ``dtaianomaly/thresholding/__init__.py`` file?
| |check_box| Can you load the thresholder via :py:func:`~dtaianomaly.workflow.interpret_config`` (specifically, in the `threshold_entry()`` function)?
| |check_box| Can you load the thresholder via :py:func:`~dtaianomaly.workflow.interpret_config` (specifically, in the `threshold_entry()`` function)?

.. rubric:: Test the thresholder

Expand Down
17 changes: 17 additions & 0 deletions docs/getting_started/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,23 @@ Use the following command to install the latest version:

pip install dtaianomaly

Some dependencies are optional to ensure that ``dtaianomaly`` remains
lightweight. Use the following command to install all optional
dependencies:

.. code-block:: bash

pip install dtaianomaly[all]

It is also possible to only install a subset of the optional dependencies.
You can install these by replacing 'all' with the corresponding name in the
command above. To install multiple subsets, separate the names with a comma.
Currently, following subsets are available:

- ``tests``: Dependencies for running the tests.
- ``docs``: Dependencies for generating the documentation.
- ``notebooks``: Dependencies for using jupyter notebooks.

To install version ``X.Y.Z``, use the following command:

.. code-block:: bash
Expand Down
42 changes: 38 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "dtaianomaly"
version = "0.2.3"
description = "A simple-to-use Python package for time series anomaly detection!"
requires-python = ">=3.8,<=3.12"
requires-python = ">=3.8,<3.14"
authors = [
{name = "Louis Carpentier", email = "louis.carpentier@kuleuven.be"}
]
Expand All @@ -15,8 +15,19 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
dependencies = [
"numpy>=1.22",
"scipy>=1.10",
"numba>=0.58",
"stumpy>=1.12",
"scikit-learn>=1.3",
"pandas>=1.3.0",
"matplotlib>=3.7",
"statsmodels>=0.6",
"pyod>=2.0.0"
]
dynamic = ["dependencies"]

[project.readme]
file = "README.md"
Expand All @@ -39,5 +50,28 @@ build-backend = "setuptools.build_meta"
include = ["dtaianomaly", "dtaianomaly.*"] # alternatively: `exclude = ["additional*"]`
namespaces = false

[tool.setuptools.dynamic.dependencies]
file = ["requirements.txt"]
[project.optional-dependencies]
all = [ # All the optional dependencies
"sphinx",
"sphinx-rtd-theme",
"numpydoc",
"toml",
"pytest",
"pytest-cov",
"notebook",
"jupyterlab",
]
tests = [ # For testing
"pytest",
"pytest-cov"
]
docs = [ # For generating the docs
"sphinx",
"sphinx-rtd-theme",
"numpydoc",
"toml"
]
notebooks = [ # For using notebooks
"notebook",
"jupyterlab",
]
6 changes: 0 additions & 6 deletions requirements-dev.txt

This file was deleted.

9 changes: 0 additions & 9 deletions requirements.txt

This file was deleted.

Loading