From 98970eb012771951d52b42696fa5f69aa39e6f6b Mon Sep 17 00:00:00 2001
From: Raphael Vallat
Date: Sat, 21 Dec 2024 04:54:30 -0800
Subject: [PATCH] Modern python packaging + v0.1.8 (#38)
* modern packaging
* ruff check
* add tests folder to coverage
* update doc to v0.1.8
* remove test folder
---
.github/workflows/black.yml | 10 --
.github/workflows/python_tests.yml | 15 ++-
.github/workflows/ruff.yml | 13 ++
.gitignore | 1 +
MANIFEST.in | 1 -
README.rst | 9 ++
codecov.yml | 2 -
docs/build/html/.buildinfo | 4 +-
docs/build/html/_modules/antropy/entropy.html | 17 +--
docs/build/html/_modules/antropy/fractal.html | 15 +--
docs/build/html/_modules/index.html | 12 +-
docs/build/html/_sources/changelog.rst.txt | 5 +
docs/build/html/_sources/index.rst.txt | 9 ++
docs/build/html/_static/basic.css | 15 +--
docs/build/html/_static/copybutton.js | 4 +-
docs/build/html/_static/doctools.js | 7 --
.../html/_static/documentation_options.js | 2 +-
docs/build/html/_static/language_data.js | 7 --
docs/build/html/_static/searchtools.js | 38 ++++--
docs/build/html/api.html | 12 +-
docs/build/html/changelog.html | 19 ++-
.../html/generated/antropy.app_entropy.html | 12 +-
.../antropy.detrended_fluctuation.html | 12 +-
.../html/generated/antropy.higuchi_fd.html | 12 +-
.../html/generated/antropy.hjorth_params.html | 12 +-
.../build/html/generated/antropy.katz_fd.html | 12 +-
.../generated/antropy.lziv_complexity.html | 12 +-
.../html/generated/antropy.num_zerocross.html | 12 +-
.../html/generated/antropy.perm_entropy.html | 12 +-
.../html/generated/antropy.petrosian_fd.html | 12 +-
.../generated/antropy.sample_entropy.html | 12 +-
.../generated/antropy.spectral_entropy.html | 12 +-
.../html/generated/antropy.svd_entropy.html | 12 +-
docs/build/html/genindex.html | 12 +-
docs/build/html/index.html | 19 ++-
docs/build/html/objects.inv | 2 +-
docs/build/html/searchindex.js | 2 +-
docs/changelog.rst | 5 +
docs/index.rst | 9 ++
pyproject.toml | 114 +++++++++++++++++-
requirements-test.txt | 4 -
requirements.txt | 5 -
setup.cfg | 21 ----
setup.py | 80 ------------
{antropy => src/antropy}/__init__.py | 4 +-
{antropy => src/antropy}/entropy.py | 5 +-
{antropy => src/antropy}/fractal.py | 3 +-
{antropy => src/antropy}/utils.py | 3 +-
{antropy/tests => tests}/test_entropy.py | 18 +--
{antropy/tests => tests}/test_fractal.py | 9 +-
{antropy/tests => tests}/utils.py | 0
51 files changed, 363 insertions(+), 313 deletions(-)
delete mode 100644 .github/workflows/black.yml
create mode 100644 .github/workflows/ruff.yml
delete mode 100644 codecov.yml
delete mode 100644 requirements-test.txt
delete mode 100644 requirements.txt
delete mode 100644 setup.cfg
delete mode 100644 setup.py
rename {antropy => src/antropy}/__init__.py (80%)
rename {antropy => src/antropy}/entropy.py (99%)
rename {antropy => src/antropy}/fractal.py (99%)
rename {antropy => src/antropy}/utils.py (99%)
rename {antropy/tests => tests}/test_entropy.py (98%)
rename {antropy/tests => tests}/test_fractal.py (93%)
rename {antropy/tests => tests}/utils.py (100%)
diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml
deleted file mode 100644
index 98b2a66..0000000
--- a/.github/workflows/black.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-name: Lint
-
-on: [push, pull_request]
-
-jobs:
- lint:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - uses: psf/black@stable
\ No newline at end of file
diff --git a/.github/workflows/python_tests.yml b/.github/workflows/python_tests.yml
index 69b88f1..1c7c99b 100644
--- a/.github/workflows/python_tests.yml
+++ b/.github/workflows/python_tests.yml
@@ -12,7 +12,7 @@ jobs:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
- python-version: ["3.9", "3.10", "3.11"]
+ python-version: ["3.9", "3.10", "3.11", "3.12"]
runs-on: ${{ matrix.platform }}
@@ -30,10 +30,15 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- pip install -r requirements.txt
- pip install -r requirements-test.txt
- pip install .
+ pip install ".[test]"
- name: Test with pytest
run: |
- pytest --cov --verbose
\ No newline at end of file
+ pytest --cov --cov-report=xml --verbose
+
+ - name: Upload coverage report
+ if: ${{ matrix.platform == 'ubuntu-latest' && matrix.python-version == 3.9 }}
+ uses: codecov/codecov-action@v4
+ with:
+ token: d5ef1de8-d1c4-4d89-b304-4d8fffdf9906
+ file: ./coverage.xml
\ No newline at end of file
diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml
new file mode 100644
index 0000000..6251dfa
--- /dev/null
+++ b/.github/workflows/ruff.yml
@@ -0,0 +1,13 @@
+name: Ruff
+on: [push, pull_request]
+jobs:
+ ruff:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - name: "Linting"
+ uses: astral-sh/ruff-action@v1
+ - name: "Formatting"
+ uses: astral-sh/ruff-action@v1
+ with:
+ args: "format --check"
diff --git a/.gitignore b/.gitignore
index 8d62719..f8e5056 100644
--- a/.gitignore
+++ b/.gitignore
@@ -105,3 +105,4 @@ desktop.ini
docs/build/doctrees/
docs/generated/
.DS_Store
+push_pypi.md
diff --git a/MANIFEST.in b/MANIFEST.in
index aa2485a..8543787 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,4 +1,3 @@
# Add README, LICENSE and requirements :
include README.rst
include LICENSE
-include requirements.txt
diff --git a/README.rst b/README.rst
index bf94653..15d65eb 100644
--- a/README.rst
+++ b/README.rst
@@ -41,6 +41,15 @@ or conda
conda config --set channel_priority strict
conda install antropy
+To build and install from source, clone this repository or download the source archive and decompress the files
+
+.. code-block:: shell
+
+ cd antropy
+ pip install ".[test]" # install the package
+ pip install -e ".[test]" # or editable install
+ pytest
+
**Dependencies**
- `numpy `_
diff --git a/codecov.yml b/codecov.yml
deleted file mode 100644
index 00e3f1f..0000000
--- a/codecov.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-codecov:
- token: d5ef1de8-d1c4-4d89-b304-4d8fffdf9906
diff --git a/docs/build/html/.buildinfo b/docs/build/html/.buildinfo
index 3d73440..9e3ae82 100644
--- a/docs/build/html/.buildinfo
+++ b/docs/build/html/.buildinfo
@@ -1,4 +1,4 @@
# Sphinx build info version 1
-# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
-config: 3a25f3b4fb97564eec51e3b795229bc5
+# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
+config: 7a843bd555ee874c00dbc710835f6133
tags: 645f666f9bcd5a90fca523b33c5a78b7
diff --git a/docs/build/html/_modules/antropy/entropy.html b/docs/build/html/_modules/antropy/entropy.html
index 84e7b1d..43fd727 100644
--- a/docs/build/html/_modules/antropy/entropy.html
+++ b/docs/build/html/_modules/antropy/entropy.html
@@ -4,16 +4,16 @@
- antropy.entropy — antropy 0.1.7 documentation
+ antropy.entropy — antropy 0.1.8 documentation
-
-
+
+
-
+
@@ -39,7 +39,7 @@
antropy
- 0.1.7
+ 0.1.8
@@ -81,11 +81,12 @@
Source code for antropy.entropy
"""Entropy functions"""
+from math import factorial, log
+
import numpy as np
from numba import jit, types
-from math import factorial, log
-from sklearn.neighbors import KDTree
from scipy.signal import periodogram, welch
+from sklearn.neighbors import KDTree
from .utils import _embed, _xlogx
@@ -1154,7 +1155,7 @@ Source code for antropy.entropy
© Copyright 2018-2024, Raphael Vallat.
- Created using Sphinx 7.4.7.
+ Created using Sphinx 8.1.3.
diff --git a/docs/build/html/_modules/antropy/fractal.html b/docs/build/html/_modules/antropy/fractal.html
index 59f6c01..8a4c9e2 100644
--- a/docs/build/html/_modules/antropy/fractal.html
+++ b/docs/build/html/_modules/antropy/fractal.html
@@ -4,16 +4,16 @@
- antropy.fractal — antropy 0.1.7 documentation
+ antropy.fractal — antropy 0.1.8 documentation
-
-
+
+
-
+
@@ -39,7 +39,7 @@
antropy
- 0.1.7
+ 0.1.8
@@ -81,9 +81,10 @@
Source code for antropy.fractal
"""Fractal functions"""
+from math import floor, log
+
import numpy as np
from numba import jit, types
-from math import log, floor
from .entropy import num_zerocross
from .utils import _linear_regression, _log_n
@@ -558,7 +559,7 @@ Source code for antropy.fractal
© Copyright 2018-2024, Raphael Vallat.
- Created using Sphinx 7.4.7.
+ Created using Sphinx 8.1.3.
diff --git a/docs/build/html/_modules/index.html b/docs/build/html/_modules/index.html
index c611a36..0cc0b09 100644
--- a/docs/build/html/_modules/index.html
+++ b/docs/build/html/_modules/index.html
@@ -4,16 +4,16 @@
- Overview: module code — antropy 0.1.7 documentation
+ Overview: module code — antropy 0.1.8 documentation
-
-
+
+
-
+
@@ -39,7 +39,7 @@
antropy
- 0.1.7
+ 0.1.8
@@ -98,7 +98,7 @@
All modules for which code is available
© Copyright 2018-2024, Raphael Vallat.
- Created using Sphinx 7.4.7.
+ Created using Sphinx 8.1.3.
diff --git a/docs/build/html/_sources/changelog.rst.txt b/docs/build/html/_sources/changelog.rst.txt
index 05504c8..1efbe43 100644
--- a/docs/build/html/_sources/changelog.rst.txt
+++ b/docs/build/html/_sources/changelog.rst.txt
@@ -3,6 +3,11 @@
What's new
##########
+v0.1.8 (December 2024)
+----------------------
+
+- Switch to modern python packaging
+- Use ruff instead of black/flake8
v0.1.7 (December 2024)
----------------------
diff --git a/docs/build/html/_sources/index.rst.txt b/docs/build/html/_sources/index.rst.txt
index dbddd32..f2e1895 100644
--- a/docs/build/html/_sources/index.rst.txt
+++ b/docs/build/html/_sources/index.rst.txt
@@ -36,6 +36,15 @@ or conda
conda config --set channel_priority strict
conda install antropy
+To build and install from source, clone this repository or download the source archive and decompress the files
+
+.. code-block:: shell
+
+ cd antropy
+ pip install ".[test]" # install the package
+ pip install -e ".[test]" # or editable install
+ pytest
+
**Dependencies**
- `numpy
`_
diff --git a/docs/build/html/_static/basic.css b/docs/build/html/_static/basic.css
index f316efc..7ebbd6d 100644
--- a/docs/build/html/_static/basic.css
+++ b/docs/build/html/_static/basic.css
@@ -1,12 +1,5 @@
/*
- * basic.css
- * ~~~~~~~~~
- *
* Sphinx stylesheet -- basic theme.
- *
- * :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS.
- * :license: BSD, see LICENSE for details.
- *
*/
/* -- main layout ----------------------------------------------------------- */
@@ -115,15 +108,11 @@ img {
/* -- search page ----------------------------------------------------------- */
ul.search {
- margin: 10px 0 0 20px;
- padding: 0;
+ margin-top: 10px;
}
ul.search li {
- padding: 5px 0 5px 20px;
- background-image: url(file.png);
- background-repeat: no-repeat;
- background-position: 0 7px;
+ padding: 5px 0;
}
ul.search li a {
diff --git a/docs/build/html/_static/copybutton.js b/docs/build/html/_static/copybutton.js
index f695d9f..ff4aa32 100644
--- a/docs/build/html/_static/copybutton.js
+++ b/docs/build/html/_static/copybutton.js
@@ -20,7 +20,7 @@ const messages = {
},
'fr' : {
'copy': 'Copier',
- 'copy_to_clipboard': 'Copié dans le presse-papier',
+ 'copy_to_clipboard': 'Copier dans le presse-papier',
'copy_success': 'Copié !',
'copy_failure': 'Échec de la copie',
},
@@ -224,7 +224,7 @@ var copyTargetText = (trigger) => {
var target = document.querySelector(trigger.attributes['data-clipboard-target'].value);
// get filtered text
- let exclude = '.linenos, .gp';
+ let exclude = '.linenos';
let text = filterText(target, exclude);
return formatCopyText(text, '>>> |\\.\\.\\. |\\$ ', true, true, true, true, '', '')
diff --git a/docs/build/html/_static/doctools.js b/docs/build/html/_static/doctools.js
index 4d67807..0398ebb 100644
--- a/docs/build/html/_static/doctools.js
+++ b/docs/build/html/_static/doctools.js
@@ -1,12 +1,5 @@
/*
- * doctools.js
- * ~~~~~~~~~~~
- *
* Base JavaScript utilities for all Sphinx HTML documentation.
- *
- * :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS.
- * :license: BSD, see LICENSE for details.
- *
*/
"use strict";
diff --git a/docs/build/html/_static/documentation_options.js b/docs/build/html/_static/documentation_options.js
index 8d5909e..4099efb 100644
--- a/docs/build/html/_static/documentation_options.js
+++ b/docs/build/html/_static/documentation_options.js
@@ -1,5 +1,5 @@
const DOCUMENTATION_OPTIONS = {
- VERSION: '0.1.7',
+ VERSION: '0.1.8',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
BUILDER: 'html',
diff --git a/docs/build/html/_static/language_data.js b/docs/build/html/_static/language_data.js
index 367b8ed..c7fe6c6 100644
--- a/docs/build/html/_static/language_data.js
+++ b/docs/build/html/_static/language_data.js
@@ -1,13 +1,6 @@
/*
- * language_data.js
- * ~~~~~~~~~~~~~~~~
- *
* This script contains the language-specific data used by searchtools.js,
* namely the list of stopwords, stemmer, scorer and splitter.
- *
- * :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS.
- * :license: BSD, see LICENSE for details.
- *
*/
var stopwords = ["a", "and", "are", "as", "at", "be", "but", "by", "for", "if", "in", "into", "is", "it", "near", "no", "not", "of", "on", "or", "such", "that", "the", "their", "then", "there", "these", "they", "this", "to", "was", "will", "with"];
diff --git a/docs/build/html/_static/searchtools.js b/docs/build/html/_static/searchtools.js
index b08d58c..2c774d1 100644
--- a/docs/build/html/_static/searchtools.js
+++ b/docs/build/html/_static/searchtools.js
@@ -1,12 +1,5 @@
/*
- * searchtools.js
- * ~~~~~~~~~~~~~~~~
- *
* Sphinx JavaScript utilities for the full-text search.
- *
- * :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS.
- * :license: BSD, see LICENSE for details.
- *
*/
"use strict";
@@ -20,7 +13,7 @@ if (typeof Scorer === "undefined") {
// and returns the new score.
/*
score: result => {
- const [docname, title, anchor, descr, score, filename] = result
+ const [docname, title, anchor, descr, score, filename, kind] = result
return score
},
*/
@@ -47,6 +40,14 @@ if (typeof Scorer === "undefined") {
};
}
+// Global search result kind enum, used by themes to style search results.
+class SearchResultKind {
+ static get index() { return "index"; }
+ static get object() { return "object"; }
+ static get text() { return "text"; }
+ static get title() { return "title"; }
+}
+
const _removeChildren = (element) => {
while (element && element.lastChild) element.removeChild(element.lastChild);
};
@@ -64,9 +65,13 @@ const _displayItem = (item, searchTerms, highlightTerms) => {
const showSearchSummary = DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY;
const contentRoot = document.documentElement.dataset.content_root;
- const [docName, title, anchor, descr, score, _filename] = item;
+ const [docName, title, anchor, descr, score, _filename, kind] = item;
let listItem = document.createElement("li");
+ // Add a class representing the item's type:
+ // can be used by a theme's CSS selector for styling
+ // See SearchResultKind for the class names.
+ listItem.classList.add(`kind-${kind}`);
let requestUrl;
let linkUrl;
if (docBuilder === "dirhtml") {
@@ -115,8 +120,10 @@ const _finishSearch = (resultCount) => {
"Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories."
);
else
- Search.status.innerText = _(
- "Search finished, found ${resultCount} page(s) matching the search query."
+ Search.status.innerText = Documentation.ngettext(
+ "Search finished, found one page matching the search query.",
+ "Search finished, found ${resultCount} pages matching the search query.",
+ resultCount,
).replace('${resultCount}', resultCount);
};
const _displayNextItem = (
@@ -138,7 +145,7 @@ const _displayNextItem = (
else _finishSearch(resultCount);
};
// Helper function used by query() to order search results.
-// Each input is an array of [docname, title, anchor, descr, score, filename].
+// Each input is an array of [docname, title, anchor, descr, score, filename, kind].
// Order the results by score (in opposite order of appearance, since the
// `_displayNextItem` function uses pop() to retrieve items) and then alphabetically.
const _orderResultsByScoreThenName = (a, b) => {
@@ -248,6 +255,7 @@ const Search = {
searchSummary.classList.add("search-summary");
searchSummary.innerText = "";
const searchList = document.createElement("ul");
+ searchList.setAttribute("role", "list");
searchList.classList.add("search");
const out = document.getElementById("search-results");
@@ -318,7 +326,7 @@ const Search = {
const indexEntries = Search._index.indexentries;
// Collect multiple result groups to be sorted separately and then ordered.
- // Each is an array of [docname, title, anchor, descr, score, filename].
+ // Each is an array of [docname, title, anchor, descr, score, filename, kind].
const normalResults = [];
const nonMainIndexResults = [];
@@ -337,6 +345,7 @@ const Search = {
null,
score + boost,
filenames[file],
+ SearchResultKind.title,
]);
}
}
@@ -354,6 +363,7 @@ const Search = {
null,
score,
filenames[file],
+ SearchResultKind.index,
];
if (isMain) {
normalResults.push(result);
@@ -475,6 +485,7 @@ const Search = {
descr,
score,
filenames[match[0]],
+ SearchResultKind.object,
]);
};
Object.keys(objects).forEach((prefix) =>
@@ -585,6 +596,7 @@ const Search = {
null,
score,
filenames[file],
+ SearchResultKind.text,
]);
}
return results;
diff --git a/docs/build/html/api.html b/docs/build/html/api.html
index 09f0faf..2251806 100644
--- a/docs/build/html/api.html
+++ b/docs/build/html/api.html
@@ -5,16 +5,16 @@
-
API reference — antropy 0.1.7 documentation
+
API reference — antropy 0.1.8 documentation
-
-
+
+
-
+
@@ -41,7 +41,7 @@
antropy
-
0.1.7
+
0.1.8
@@ -150,7 +150,7 @@
Fractal dimension 7.4.7.
+ Created using Sphinx 8.1.3.
diff --git a/docs/build/html/changelog.html b/docs/build/html/changelog.html
index 98e43a2..128feb7 100644
--- a/docs/build/html/changelog.html
+++ b/docs/build/html/changelog.html
@@ -5,16 +5,16 @@
-
What’s new — antropy 0.1.7 documentation
+
What’s new — antropy 0.1.8 documentation
-
-
+
+
-
+
@@ -40,7 +40,7 @@
antropy
-
0.1.7
+
0.1.8
@@ -81,6 +81,13 @@
What’s new
+
+v0.1.8 (December 2024)
+
+
v0.1.7 (December 2024)
@@ -172,7 +179,7 @@ v0.1.0 (October 2018)
diff --git a/docs/build/html/generated/antropy.app_entropy.html b/docs/build/html/generated/antropy.app_entropy.html
index ec5e587..5838614 100644
--- a/docs/build/html/generated/antropy.app_entropy.html
+++ b/docs/build/html/generated/antropy.app_entropy.html
@@ -5,16 +5,16 @@
- antropy.app_entropy — antropy 0.1.7 documentation
+ antropy.app_entropy — antropy 0.1.8 documentation
-
-
+
+
-
+
@@ -41,7 +41,7 @@
antropy
- 0.1.7
+ 0.1.8
@@ -188,7 +188,7 @@
antropy.app_entropy 7.4.7.
+ Created using Sphinx 8.1.3.
diff --git a/docs/build/html/generated/antropy.detrended_fluctuation.html b/docs/build/html/generated/antropy.detrended_fluctuation.html
index 6a70632..8903c85 100644
--- a/docs/build/html/generated/antropy.detrended_fluctuation.html
+++ b/docs/build/html/generated/antropy.detrended_fluctuation.html
@@ -5,16 +5,16 @@
- antropy.detrended_fluctuation — antropy 0.1.7 documentation
+ antropy.detrended_fluctuation — antropy 0.1.8 documentation
-
-
+
+
-
+
@@ -41,7 +41,7 @@
antropy
- 0.1.7
+ 0.1.8
@@ -201,7 +201,7 @@
antropy.detrended_fluctuation 7.4.7.
+ Created using Sphinx 8.1.3.
diff --git a/docs/build/html/generated/antropy.higuchi_fd.html b/docs/build/html/generated/antropy.higuchi_fd.html
index f80b5fd..aa53323 100644
--- a/docs/build/html/generated/antropy.higuchi_fd.html
+++ b/docs/build/html/generated/antropy.higuchi_fd.html
@@ -5,16 +5,16 @@
- antropy.higuchi_fd — antropy 0.1.7 documentation
+ antropy.higuchi_fd — antropy 0.1.8 documentation
-
-
+
+
-
+
@@ -40,7 +40,7 @@
antropy
- 0.1.7
+ 0.1.8
@@ -171,7 +171,7 @@
antropy.higuchi_fd 7.4.7.
+ Created using Sphinx 8.1.3.
diff --git a/docs/build/html/generated/antropy.hjorth_params.html b/docs/build/html/generated/antropy.hjorth_params.html
index 6a414dc..d72c8d7 100644
--- a/docs/build/html/generated/antropy.hjorth_params.html
+++ b/docs/build/html/generated/antropy.hjorth_params.html
@@ -5,16 +5,16 @@
- antropy.hjorth_params — antropy 0.1.7 documentation
+ antropy.hjorth_params — antropy 0.1.8 documentation
-
-
+
+
-
+
@@ -41,7 +41,7 @@
antropy
- 0.1.7
+ 0.1.8
@@ -188,7 +188,7 @@
antropy.hjorth_params
diff --git a/docs/build/html/generated/antropy.katz_fd.html b/docs/build/html/generated/antropy.katz_fd.html
index 5e7b32a..42b97d3 100644
--- a/docs/build/html/generated/antropy.katz_fd.html
+++ b/docs/build/html/generated/antropy.katz_fd.html
@@ -5,16 +5,16 @@
- antropy.katz_fd — antropy 0.1.7 documentation
+ antropy.katz_fd — antropy 0.1.8 documentation
-
-
+
+
-
+
@@ -41,7 +41,7 @@
antropy
- 0.1.7
+ 0.1.8
@@ -183,7 +183,7 @@
antropy.katz_fd 7.4.7.
+ Created using Sphinx 8.1.3.
diff --git a/docs/build/html/generated/antropy.lziv_complexity.html b/docs/build/html/generated/antropy.lziv_complexity.html
index b7db135..bbe1b9d 100644
--- a/docs/build/html/generated/antropy.lziv_complexity.html
+++ b/docs/build/html/generated/antropy.lziv_complexity.html
@@ -5,16 +5,16 @@
- antropy.lziv_complexity — antropy 0.1.7 documentation
+ antropy.lziv_complexity — antropy 0.1.8 documentation
-
-
+
+
-
+
@@ -41,7 +41,7 @@
antropy
- 0.1.7
+ 0.1.8
@@ -183,7 +183,7 @@
antropy.lziv_complexity
diff --git a/docs/build/html/generated/antropy.num_zerocross.html b/docs/build/html/generated/antropy.num_zerocross.html
index 29d4258..ef5a830 100644
--- a/docs/build/html/generated/antropy.num_zerocross.html
+++ b/docs/build/html/generated/antropy.num_zerocross.html
@@ -5,16 +5,16 @@
- antropy.num_zerocross — antropy 0.1.7 documentation
+ antropy.num_zerocross — antropy 0.1.8 documentation
-
-
+
+
-
+
@@ -40,7 +40,7 @@
antropy
- 0.1.7
+ 0.1.8
@@ -182,7 +182,7 @@
antropy.num_zerocross
diff --git a/docs/build/html/generated/antropy.perm_entropy.html b/docs/build/html/generated/antropy.perm_entropy.html
index 5a3434c..01698ab 100644
--- a/docs/build/html/generated/antropy.perm_entropy.html
+++ b/docs/build/html/generated/antropy.perm_entropy.html
@@ -5,16 +5,16 @@
- antropy.perm_entropy — antropy 0.1.7 documentation
+ antropy.perm_entropy — antropy 0.1.8 documentation
-
-
+
+
-
+
@@ -41,7 +41,7 @@
antropy
- 0.1.7
+ 0.1.8
@@ -199,7 +199,7 @@
antropy.perm_entropy
diff --git a/docs/build/html/generated/antropy.petrosian_fd.html b/docs/build/html/generated/antropy.petrosian_fd.html
index c865202..2702b83 100644
--- a/docs/build/html/generated/antropy.petrosian_fd.html
+++ b/docs/build/html/generated/antropy.petrosian_fd.html
@@ -5,16 +5,16 @@
- antropy.petrosian_fd — antropy 0.1.7 documentation
+ antropy.petrosian_fd — antropy 0.1.8 documentation
-
-
+
+
-
+
@@ -41,7 +41,7 @@
antropy
- 0.1.7
+ 0.1.8
@@ -184,7 +184,7 @@
antropy.petrosian_fd
diff --git a/docs/build/html/generated/antropy.sample_entropy.html b/docs/build/html/generated/antropy.sample_entropy.html
index 8eeae20..9dc1cfe 100644
--- a/docs/build/html/generated/antropy.sample_entropy.html
+++ b/docs/build/html/generated/antropy.sample_entropy.html
@@ -5,16 +5,16 @@
- antropy.sample_entropy — antropy 0.1.7 documentation
+ antropy.sample_entropy — antropy 0.1.8 documentation
-
-
+
+
-
+
@@ -41,7 +41,7 @@
antropy
- 0.1.7
+ 0.1.8
@@ -206,7 +206,7 @@
antropy.sample_entropy
diff --git a/docs/build/html/generated/antropy.spectral_entropy.html b/docs/build/html/generated/antropy.spectral_entropy.html
index aecafdf..659ad33 100644
--- a/docs/build/html/generated/antropy.spectral_entropy.html
+++ b/docs/build/html/generated/antropy.spectral_entropy.html
@@ -5,16 +5,16 @@
- antropy.spectral_entropy — antropy 0.1.7 documentation
+ antropy.spectral_entropy — antropy 0.1.8 documentation
-
-
+
+
-
+
@@ -41,7 +41,7 @@
antropy
- 0.1.7
+ 0.1.8
@@ -204,7 +204,7 @@
antropy.spectral_entropy 7.4.7.
+ Created using Sphinx 8.1.3.
diff --git a/docs/build/html/generated/antropy.svd_entropy.html b/docs/build/html/generated/antropy.svd_entropy.html
index 0765317..2c4787e 100644
--- a/docs/build/html/generated/antropy.svd_entropy.html
+++ b/docs/build/html/generated/antropy.svd_entropy.html
@@ -5,16 +5,16 @@
- antropy.svd_entropy — antropy 0.1.7 documentation
+ antropy.svd_entropy — antropy 0.1.8 documentation
-
-
+
+
-
+
@@ -41,7 +41,7 @@
antropy
- 0.1.7
+ 0.1.8
@@ -201,7 +201,7 @@
antropy.svd_entropy 7.4.7.
+ Created using Sphinx 8.1.3.
diff --git a/docs/build/html/genindex.html b/docs/build/html/genindex.html
index 2a714b1..4c2eca8 100644
--- a/docs/build/html/genindex.html
+++ b/docs/build/html/genindex.html
@@ -4,16 +4,16 @@
- Index — antropy 0.1.7 documentation
+ Index — antropy 0.1.8 documentation
-
-
+
+
-
+
@@ -39,7 +39,7 @@
antropy
- 0.1.7
+ 0.1.8
@@ -187,7 +187,7 @@
S
© Copyright 2018-2024, Raphael Vallat.
- Created using Sphinx 7.4.7.
+ Created using Sphinx 8.1.3.
diff --git a/docs/build/html/index.html b/docs/build/html/index.html
index 3abc62f..b889050 100644
--- a/docs/build/html/index.html
+++ b/docs/build/html/index.html
@@ -5,16 +5,16 @@
- Installation — antropy 0.1.7 documentation
+ Installation — antropy 0.1.8 documentation
-
-
+
+
-
+
@@ -40,7 +40,7 @@
antropy
- 0.1.7
+ 0.1.8
@@ -106,6 +106,13 @@
Installation
+To build and install from source, clone this repository or download the source archive and decompress the files
+cd antropy
+pip install ".[test]" # install the package
+pip install -e ".[test]" # or editable install
+pytest
+
+
Dependencies
numpy
@@ -234,7 +241,7 @@ Acknowledgement 7.4.7.
+ Created using Sphinx 8.1.3.
diff --git a/docs/build/html/objects.inv b/docs/build/html/objects.inv
index 61c676b..fc83e5a 100644
--- a/docs/build/html/objects.inv
+++ b/docs/build/html/objects.inv
@@ -1,6 +1,6 @@
# Sphinx inventory version 2
# Project: antropy
-# Version: 0.1.7
+# Version: 0.1.8
# The remainder of this file is compressed using zlib.
xڍ=n {Nl;ҦKbHi.q63^#Ilx`?*QxOn߃>>&l$`_
diff --git a/pyproject.toml b/pyproject.toml
index aa4949a..ec06143 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,2 +1,114 @@
-[tool.black]
+[build-system]
+requires = ["setuptools>=61.0", "wheel"]
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "antropy"
+description = "AntroPy: entropy and complexity of time-series in Python"
+readme = "README.rst"
+license = {text = "BSD (3-clause)"}
+authors = [
+ {name = "Raphael Vallat", email = "raphaelvallat9@gmail.com"},
+]
+maintainers = [
+ {name = "Raphael Vallat", email = "raphaelvallat9@gmail.com"},
+]
+classifiers = [
+ "Intended Audience :: Science/Research",
+ "Operating System :: MacOS",
+ "Operating System :: POSIX",
+ "Operating System :: Unix",
+ "Programming Language :: Python :: 3.9",
+ "Programming Language :: Python :: 3.10",
+ "Programming Language :: Python :: 3.11",
+ "Programming Language :: Python :: 3.12",
+ "Topic :: Scientific/Engineering :: Mathematics",
+]
+dynamic = ["version"]
+requires-python = ">=3.9"
+dependencies = [
+ "numpy",
+ "scipy",
+ "scikit-learn",
+ "numba>=0.57",
+ "stochastic",
+]
+
+[project.optional-dependencies]
+test = [
+ "pytest>=6",
+ "pytest-cov",
+ # Ensure coverage is new enough for `source_pkgs`.
+ "coverage[toml]>=5.3",
+ "ruff"
+]
+docs = [
+ "sphinx>7.0.0",
+ # "pydata_sphinx_theme",
+ "numpydoc",
+ "sphinx-copybutton",
+ "sphinx-design",
+ # "sphinx-notfound-page",
+]
+
+[project.urls]
+Homepage = "https://github.com/raphaelvallat/antropy/"
+Downloads = "https://github.com/raphaelvallat/antropy/"
+
+[tool.setuptools]
+py-modules = ["antropy"]
+include-package-data = false
+
+[tool.setuptools.packages.find]
+namespaces = false
+where = ["src"]
+
+[tool.setuptools.dynamic]
+version = {attr = "antropy.__version__"}
+
+[tool.pytest.ini_options]
+minversion = "6.0"
+addopts = "--showlocals --durations=10 --maxfail=2 --cov"
+doctest_optionflags= ["NORMALIZE_WHITESPACE", "IGNORE_EXCEPTION_DETAIL"]
+filterwarnings = [
+ "ignore::UserWarning",
+ "ignore::RuntimeWarning",
+ "ignore::FutureWarning",
+]
+markers = ["slow"]
+
+[tool.coverage.run]
+branch = true
+omit = [
+ "*/tests/*",
+]
+source_pkgs = ["antropy"]
+
+[tool.coverage.paths]
+source = ["src"]
+
+[tool.coverage.report]
+show_missing = true
+# sort = "Cover"
+
+[tool.ruff]
line-length = 100
+target-version = "py311"
+# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
+# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
+# McCabe complexity (`C901`) by default.
+lint.select = ["E4", "E7", "E9", "F", "I", "NPY201"]
+exclude = [
+ "notebooks", # Skip jupyter notebook examples
+ "docs",
+]
+
+[tool.ruff.lint.per-file-ignores]
+"__init__.py" = ["F401", "F403"] # Ignore star and unused import violations for __init__.py files
+
+[tool.ruff.lint.pydocstyle]
+convention = "numpy"
+
+[tool.ruff.format]
+docstring-code-format = false
+docstring-code-line-length = 90
diff --git a/requirements-test.txt b/requirements-test.txt
deleted file mode 100644
index 4290127..0000000
--- a/requirements-test.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-pytest>=7.2.0
-codecov
-pytest-cov
-pytest-sugar
diff --git a/requirements.txt b/requirements.txt
deleted file mode 100644
index 5c88fc3..0000000
--- a/requirements.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-numpy
-scipy
-scikit-learn
-numba>=0.57
-stochastic
diff --git a/setup.cfg b/setup.cfg
deleted file mode 100644
index 1535174..0000000
--- a/setup.cfg
+++ /dev/null
@@ -1,21 +0,0 @@
-[aliases]
-test=pytest
-
-# [tool:pytest]
-# addopts = --showlocals --durations=10 --cov --cov-report=
-# markers =
-# slow: mark a test as slow.
-
-[flake8]
-max-line-length = 100
-ignore = N806, N803, D301, D200, D205, D400, D401, E203
-exclude =
- .git,
- __pycache__,
- docs,
- tests,
- external,
- __init__.py,
- examples,
- setup.py,
-statistics=True
diff --git a/setup.py b/setup.py
deleted file mode 100644
index a98053b..0000000
--- a/setup.py
+++ /dev/null
@@ -1,80 +0,0 @@
-#! /usr/bin/env python
-#
-# Copyright (C) 2018 Raphael Vallat
-
-DESCRIPTION = "AntroPy: entropy and complexity of time-series in Python"
-DISTNAME = "antropy"
-MAINTAINER = "Raphael Vallat"
-MAINTAINER_EMAIL = "raphaelvallat9@gmail.com"
-URL = "https://raphaelvallat.com/antropy/build/html/index.html"
-LICENSE = "BSD (3-clause)"
-DOWNLOAD_URL = "https://github.com/raphaelvallat/antropy/"
-VERSION = "0.1.7"
-PACKAGE_DATA = {"antropy.data.icons": ["*.ico"]}
-
-try:
- from setuptools import setup
-
- _has_setuptools = True
-except ImportError:
- from distutils.core import setup
-
-
-def check_dependencies():
- install_requires = []
-
- try:
- import numpy
- except ImportError:
- install_requires.append("numpy")
- try:
- import scipy
- except ImportError:
- install_requires.append("scipy")
-
- try:
- import sklearn
- except ImportError:
- install_requires.append("scikit-learn")
-
- try:
- import numba
- except ImportError:
- install_requires.append("numba>=0.57")
-
- try:
- import stochastic
- except ImportError:
- install_requires.append("stochastic")
-
- return install_requires
-
-
-if __name__ == "__main__":
- install_requires = check_dependencies()
-
- setup(
- name=DISTNAME,
- author=MAINTAINER,
- author_email=MAINTAINER_EMAIL,
- maintainer=MAINTAINER,
- maintainer_email=MAINTAINER_EMAIL,
- description=DESCRIPTION,
- license=LICENSE,
- url=URL,
- version=VERSION,
- download_url=DOWNLOAD_URL,
- install_requires=install_requires,
- include_package_data=True,
- packages=["antropy"],
- package_data=PACKAGE_DATA,
- classifiers=[
- "Intended Audience :: Science/Research",
- "Programming Language :: Python",
- "License :: OSI Approved :: BSD License",
- "Topic :: Scientific/Engineering :: Mathematics",
- "Operating System :: POSIX",
- "Operating System :: Unix",
- "Operating System :: MacOS",
- ],
- )
diff --git a/antropy/__init__.py b/src/antropy/__init__.py
similarity index 80%
rename from antropy/__init__.py
rename to src/antropy/__init__.py
index dc51218..bad1cca 100644
--- a/antropy/__init__.py
+++ b/src/antropy/__init__.py
@@ -1,6 +1,6 @@
# Import AntroPy objects
-from .utils import *
from .entropy import *
from .fractal import *
+from .utils import *
-__version__ = "0.1.7"
+__version__ = "0.1.8"
diff --git a/antropy/entropy.py b/src/antropy/entropy.py
similarity index 99%
rename from antropy/entropy.py
rename to src/antropy/entropy.py
index 197da5c..d239fc2 100644
--- a/antropy/entropy.py
+++ b/src/antropy/entropy.py
@@ -1,10 +1,11 @@
"""Entropy functions"""
+from math import factorial, log
+
import numpy as np
from numba import jit, types
-from math import factorial, log
-from sklearn.neighbors import KDTree
from scipy.signal import periodogram, welch
+from sklearn.neighbors import KDTree
from .utils import _embed, _xlogx
diff --git a/antropy/fractal.py b/src/antropy/fractal.py
similarity index 99%
rename from antropy/fractal.py
rename to src/antropy/fractal.py
index 744dba9..cd31151 100644
--- a/antropy/fractal.py
+++ b/src/antropy/fractal.py
@@ -1,8 +1,9 @@
"""Fractal functions"""
+from math import floor, log
+
import numpy as np
from numba import jit, types
-from math import log, floor
from .entropy import num_zerocross
from .utils import _linear_regression, _log_n
diff --git a/antropy/utils.py b/src/antropy/utils.py
similarity index 99%
rename from antropy/utils.py
rename to src/antropy/utils.py
index 10ac2e8..554ed71 100644
--- a/antropy/utils.py
+++ b/src/antropy/utils.py
@@ -1,8 +1,9 @@
"""Helper functions"""
+from math import floor, log
+
import numpy as np
from numba import jit
-from math import log, floor
all = ["_embed", "_linear_regression", "_log_n", "_xlog2x"]
epsilon = 10e-9
diff --git a/antropy/tests/test_entropy.py b/tests/test_entropy.py
similarity index 98%
rename from antropy/tests/test_entropy.py
rename to tests/test_entropy.py
index 5678d17..b98dd9d 100644
--- a/antropy/tests/test_entropy.py
+++ b/tests/test_entropy.py
@@ -1,24 +1,24 @@
"""Test entropy functions."""
import unittest
+
import numpy as np
-from numpy.testing import assert_equal
from numpy import apply_along_axis as aal
+from numpy.testing import assert_equal
+from utils import ARANGE, NORMAL_TS, PURE_SINE, RANDOM_TS, RANDOM_TS_LONG, TEST_DTYPES
+
from antropy import (
- perm_entropy,
- spectral_entropy,
- svd_entropy,
- sample_entropy,
app_entropy,
+ hjorth_params,
lziv_complexity,
num_zerocross,
- hjorth_params,
+ perm_entropy,
+ sample_entropy,
+ spectral_entropy,
+ svd_entropy,
)
-
from antropy.utils import _xlogx
-from utils import RANDOM_TS, NORMAL_TS, RANDOM_TS_LONG, PURE_SINE, ARANGE, TEST_DTYPES
-
SF_TS = 100
BANDT_PERM = [4, 7, 9, 10, 6, 11, 3]
diff --git a/antropy/tests/test_fractal.py b/tests/test_fractal.py
similarity index 93%
rename from antropy/tests/test_fractal.py
rename to tests/test_fractal.py
index 4ce48d0..d33a7e0 100644
--- a/antropy/tests/test_fractal.py
+++ b/tests/test_fractal.py
@@ -1,14 +1,13 @@
"""Test fractal dimension functions."""
import unittest
+
import numpy as np
-from numpy.testing import assert_equal
from numpy import apply_along_axis as aal
-from antropy import petrosian_fd, katz_fd, higuchi_fd, detrended_fluctuation
-import stochastic.processes.noise as sn
-
+from numpy.testing import assert_equal
+from utils import ARANGE, NORMAL_TS, PURE_COSINE, PURE_SINE, RANDOM_TS, TEST_DTYPES
-from utils import RANDOM_TS, NORMAL_TS, PURE_SINE, PURE_COSINE, ARANGE, TEST_DTYPES
+from antropy import detrended_fluctuation, higuchi_fd, katz_fd, petrosian_fd
PPG_SIGNAL = np.array(
[
diff --git a/antropy/tests/utils.py b/tests/utils.py
similarity index 100%
rename from antropy/tests/utils.py
rename to tests/utils.py