Skip to content

Commit e825849

Browse files
authored
Merge pull request #20 from selimfirat/develop
Release v0.3.2
2 parents 4082c46 + 6610406 commit e825849

33 files changed

+1681
-92
lines changed

.coveragerc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
[run]
22
omit = pysad/models/kitnet_model/*
3+
setup.py
4+
_build_readme.py

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ docs/_build
77
# Byte-compiled / optimized / DLL files
88
*.py[cod]
99
*$py.class
10+
paper
11+
.vscode
1012

1113
# C extensions
1214
*.so

CHANGES.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
v<0.1.0>, <08/15/2020> -- Initial release.
22
v<0.2.0> <06/10/2023> -- Upgraded some libraries like numpy,pandas and small refactorings.
33
v<0.3.0>, <05/23/2025> -- Updated dependencies to latest versions, improved documentation, added quick start example in README. Added Inqmad model. Special thanks to @TechyNilesh @Joaggi @onixlas.
4-
v<0.3.1>, <06/04/2025> -- Enhanced README with comprehensive community engagement section, educational content, third-party integrations, and developer community highlights. Fixed sublist formatting in reStructuredText. Improved error handling for Inqmad model imports.
4+
v<0.3.1>, <06/04/2025> -- Enhanced README with comprehensive community engagement section, educational content, third-party integrations, and developer community highlights. Fixed sublist formatting in reStructuredText. Improved error handling for Inqmad model imports.
5+
v<0.3.2>, <06/14/2025> -- Updated PyOD version and added Python 3.13 support. Fixed Flaticon link in documentation. Enhanced error handling for optional JAX dependencies. Updated rrcf version to 0.4.4 and improved quantization in RelativeEntropy model. Improved test coverage and configuration. Added deprecation warning tests and enhanced model methods array handling. Special thanks to @onixlas for multiple contributions.

README.rst

Lines changed: 14 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -95,65 +95,6 @@ Free and Open Source Software (FOSS)
9595

9696
`PySAD` is distributed under `BSD License 2.0 <https://github.com/selimfirat/pysad/blob/master/LICENSE>`_ and favors FOSS principles.
9797

98-
Community Engagement
99-
=====================
100-
101-
PySAD has built a strong and active community with significant adoption across academia and industry:
102-
103-
Academic Recognition
104-
^^^^^^^^^^^^^^^^^^^^
105-
106-
* **Cited in academic literature** with growing adoption in streaming data research with more than 50 citations to the arXiv version (excluding GitHub link-only citations). See `Google Scholar <https://scholar.google.com/citations?view_op=view_citation&hl=tr&user=R6Hwp20AAAAJ&citation_for_view=R6Hwp20AAAAJ:2osOgNQ5qMEC>`_ for detailed citation metrics.
107-
108-
GitHub Community
109-
^^^^^^^^^^^^^^^^^
110-
111-
* **260+ GitHub Stars** demonstrating widespread community interest and adoption among developers and researchers in the machine learning community.
112-
113-
Active Usage
114-
^^^^^^^^^^^^
115-
116-
* **Strong PyPI download statistics** according to `pypistats.org <https://pypistats.org/packages/pysad>`_ with 2K+ downloads in the May 2025 and consistent weekly usage.
117-
118-
Educational Content
119-
^^^^^^^^^^^^^^^^^^^
120-
121-
Featured in educational content across multiple platforms:
122-
123-
* **Medium Articles:**
124-
125-
* `Real-time Anomaly Detection with Python <https://medium.com/data-science/real-time-anomaly-detection-with-python-36e3455e84e2>`_
126-
* `Real-time Anomaly Detection for Quality Control <https://medium.com/data-science/real-time-anomaly-detection-for-quality-control-e6af28a3350d>`_
127-
* `The Challenges of AI in an Industrial Environment <https://medium.com/@anthonycvn/the-challenges-of-ai-in-an-industrial-environment-6e118a8daa67>`_
128-
129-
* **Resource Collections:**
130-
131-
* `Anomaly Detection Resources <https://andrewm4894.com/2021/01/03/anomaly-detection-resources/>`_ comprehensive guide
132-
* `Anomaly Detection Resources by Yue Zhao <https://github.com/yzhao062/anomaly-detection-resources>`_ curated collection of papers, algorithms, and datasets
133-
134-
Third-party Integrations
135-
^^^^^^^^^^^^^^^^^^^^^^^^^
136-
137-
PySAD has been adopted and integrated into major machine learning frameworks:
138-
139-
* **TurboML Integration:** `PySAD example documentation <https://docs.turboml.com/wyo_models/pysad_example/>`_ showing adoption in machine learning workflow platforms.
140-
141-
* **Apache Beam Integration:** PySAD modules adapted into Apache Beam's ML package with `zscore <https://beam.apache.org/releases/pydoc/2.64.0/apache_beam.ml.anomaly.detectors.zscore.html>`_ and `robust_zscore <https://beam.apache.org/releases/pydoc/2.64.0/apache_beam.ml.anomaly.detectors.robust_zscore.html>`_ anomaly detectors.
142-
143-
* **River ML Integration:** The prominent online machine learning library has adapted PySAD algorithms, including the `StandardAbsoluteDeviation detector <https://riverml.xyz/0.20.0/api/anomaly/StandardAbsoluteDeviation/?query=pysad>`_ with explicit PySAD references.
144-
145-
Developer Community
146-
^^^^^^^^^^^^^^^^^^^
147-
148-
* **Widespread GitHub usage** with 50+ files using ``import pysad`` and 200+ files using ``from pysad`` across various repositories: `import usage <https://github.com/search?q=%22import+pysad%22&type=code>`_, `from usage <https://github.com/search?q=%22from+pysad%22&type=code>`_.
149-
150-
* **External projects** demonstrating practical applications across diverse domains:
151-
152-
* `Online Isolation Forest implementation <https://github.com/ineveLoppiliF/Online-Isolation-Forest>`_
153-
* `Anomaly Detection Final Project <https://github.com/berfinkavsut/anomaly-detection-final-project>`_
154-
* `Natural Gas Wells Anomaly Detection <https://github.com/charles-cao/Anomaly-detection-in-natural-gas-wells>`_
155-
* `EuroPython 2024 Conference Material <https://github.com/ciortanmadalina/europython2024>`_
156-
15798
Installation
15899
============
159100

@@ -183,7 +124,7 @@ Alternatively, you can install the library directly using the source code in Git
183124
* numpy==2.0.2
184125
* scikit-learn==1.5.2
185126
* scipy==1.13.1
186-
* pyod==1.1.0
127+
* pyod==2.0.5
187128
* combo==0.1.3
188129

189130
**Optional Dependencies:**
@@ -247,6 +188,19 @@ Quick Links
247188

248189

249190

191+
Contributors
192+
============
193+
194+
.. raw:: html
195+
196+
<div align="center">
197+
<a href="https://github.com/selimfirat/pysad/graphs/contributors">
198+
<img src="https://contrib.rocks/image?repo=selimfirat/pysad" alt="Contributors" />
199+
</a>
200+
</div>
201+
202+
We thank all our contributors for their valuable input and efforts to make PySAD better!
203+
250204
Versioning
251205
==========
252206

README_template.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,19 @@ Here's a simple example showing how to use PySAD for anomaly detection on stream
3737
3838
.. include:: docs/quick_links.rst
3939

40+
Contributors
41+
============
42+
43+
.. raw:: html
44+
45+
<div align="center">
46+
<a href="https://github.com/selimfirat/pysad/graphs/contributors">
47+
<img src="https://contrib.rocks/image?repo=selimfirat/pysad" alt="Contributors" />
48+
</a>
49+
</div>
50+
51+
We thank all our contributors for their valuable input and efforts to make PySAD better!
52+
4053
.. include:: docs/versioning.rst
4154

4255
.. include:: docs/license.rst

docs/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Alternatively, you can install the library directly using the source code in Git
2727
* numpy==2.0.2
2828
* scikit-learn==1.5.2
2929
* scipy==1.13.1
30-
* pyod==1.1.0
30+
* pyod==2.0.5
3131
* combo==0.1.3
3232

3333
**Optional Dependencies:**

docs/references.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ References
44
.. bibliography:: refs.bib
55
:labelprefix: B
66

7-
The infinity icon made by `Freepik <http://www.freepik.com/>`_ from `Flaticon <www.flaticon.com>`_.
7+
The infinity icon made by `Freepik <https://www.freepik.com/>`_ from `Flaticon <https://www.flaticon.com/>`_.

pyproject.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "pysad"
7-
version = "0.3.1"
7+
version = "0.3.2"
88
dependencies = [
99
"numpy",
1010
"scikit-learn",
1111
"scipy",
12-
"pyod==1.1.0",
12+
"pyod==2.0.5",
1313
"combo==0.1.3",
1414
]
1515
requires-python = ">=3.10"
@@ -40,10 +40,11 @@ classifiers = [
4040
"Programming Language :: Python :: 3.10",
4141
"Programming Language :: Python :: 3.11",
4242
"Programming Language :: Python :: 3.12",
43+
"Programming Language :: Python :: 3.13"
4344
]
4445

4546
[project.optional-dependencies]
46-
rrcf = ["rrcf==0.4.3"]
47+
rrcf = ["rrcf==0.4.4"]
4748
slop = ["PyNomaly==0.3.3"]
4849
xStream = ["mmh3==2.5.1"]
4950
pandas = ["pandas"]

pysad/core/base_model.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ def score(self, X):
7070
"""
7171
y_pred = np.empty(X.shape[0], dtype=np.float64)
7272
for i, (xi, _) in enumerate(_iterate(X)):
73-
y_pred[i] = self.score_partial(xi)
73+
score = self.score_partial(xi)
74+
y_pred[i] = np.asarray(score).item() if np.asarray(score).ndim > 0 else score
7475

7576
return y_pred
7677

pysad/core/base_postprocessor.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ def transform(self, scores):
5353
"""
5454
processed_scores = np.empty(scores.shape[0], dtype=np.float64)
5555
for i, (score, _) in enumerate(_iterate(scores)):
56-
processed_scores[i] = self.transform_partial(score)
56+
result = self.transform_partial(score)
57+
processed_scores[i] = np.asarray(result).item() if np.asarray(result).ndim > 0 else result
5758

5859
return processed_scores
5960

@@ -82,6 +83,7 @@ def fit_transform(self, scores):
8283
"""
8384
processed_scores = np.empty(scores.shape[0], dtype=np.float64)
8485
for i, (score, _) in enumerate(_iterate(scores)):
85-
processed_scores[i] = self.fit_transform_partial(score)
86+
result = self.fit_transform_partial(score)
87+
processed_scores[i] = np.asarray(result).item() if np.asarray(result).ndim > 0 else result
8688

8789
return processed_scores

0 commit comments

Comments
 (0)