Skip to content

Commit

Permalink
Modern python packaging + v0.1.8 (#38)
Browse files Browse the repository at this point in the history
* modern packaging

* ruff check

* add tests folder to coverage

* update doc to v0.1.8

* remove test folder
  • Loading branch information
raphaelvallat authored Dec 21, 2024
1 parent 1e2c48a commit 98970eb
Show file tree
Hide file tree
Showing 51 changed files with 363 additions and 313 deletions.
10 changes: 0 additions & 10 deletions .github/workflows/black.yml

This file was deleted.

15 changes: 10 additions & 5 deletions .github/workflows/python_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand All @@ -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
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
13 changes: 13 additions & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -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"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,4 @@ desktop.ini
docs/build/doctrees/
docs/generated/
.DS_Store
push_pypi.md
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Add README, LICENSE and requirements :
include README.rst
include LICENSE
include requirements.txt
9 changes: 9 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://numpy.org/>`_
Expand Down
2 changes: 0 additions & 2 deletions codecov.yml

This file was deleted.

4 changes: 2 additions & 2 deletions docs/build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -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
17 changes: 9 additions & 8 deletions docs/build/html/_modules/antropy/entropy.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>antropy.entropy &#8212; antropy 0.1.7 documentation</title>
<title>antropy.entropy &#8212; antropy 0.1.8 documentation</title>
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../../_static/bootstrap-sphinx.css?v=9f61996d" />
<link rel="stylesheet" type="text/css" href="../../_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="../../_static/style.css?v=917eae1c" />
<script src="../../_static/documentation_options.js?v=ca7ad2ea"></script>
<script src="../../_static/doctools.js?v=9a2dae69"></script>
<script src="../../_static/documentation_options.js?v=22607128"></script>
<script src="../../_static/doctools.js?v=9bcbadda"></script>
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../../_static/clipboard.min.js?v=a7894cd8"></script>
<script src="../../_static/copybutton.js?v=fe0808e4"></script>
<script src="../../_static/copybutton.js?v=fd10adb8"></script>
<link rel="icon" href="../../_static/antropy.ico"/>
<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
Expand All @@ -39,7 +39,7 @@
</button>
<a class="navbar-brand" href="../../index.html">
antropy</a>
<span class="navbar-text navbar-version pull-left"><b>0.1.7</b></span>
<span class="navbar-text navbar-version pull-left"><b>0.1.8</b></span>
</div>

<div class="collapse navbar-collapse nav-collapse">
Expand Down Expand Up @@ -81,11 +81,12 @@
<h1>Source code for antropy.entropy</h1><div class="highlight"><pre>
<span></span><span class="sd">&quot;&quot;&quot;Entropy functions&quot;&quot;&quot;</span>

<span class="kn">from</span> <span class="nn">math</span> <span class="kn">import</span> <span class="n">factorial</span><span class="p">,</span> <span class="n">log</span>

<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
<span class="kn">from</span> <span class="nn">numba</span> <span class="kn">import</span> <span class="n">jit</span><span class="p">,</span> <span class="n">types</span>
<span class="kn">from</span> <span class="nn">math</span> <span class="kn">import</span> <span class="n">factorial</span><span class="p">,</span> <span class="n">log</span>
<span class="kn">from</span> <span class="nn">sklearn.neighbors</span> <span class="kn">import</span> <span class="n">KDTree</span>
<span class="kn">from</span> <span class="nn">scipy.signal</span> <span class="kn">import</span> <span class="n">periodogram</span><span class="p">,</span> <span class="n">welch</span>
<span class="kn">from</span> <span class="nn">sklearn.neighbors</span> <span class="kn">import</span> <span class="n">KDTree</span>

<span class="kn">from</span> <span class="nn">.utils</span> <span class="kn">import</span> <span class="n">_embed</span><span class="p">,</span> <span class="n">_xlogx</span>

Expand Down Expand Up @@ -1154,7 +1155,7 @@ <h1>Source code for antropy.entropy</h1><div class="highlight"><pre>
</p>
<p>
&copy; Copyright 2018-2024, Raphael Vallat.<br/>
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 7.4.7.<br/>
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 8.1.3.<br/>
</p>
</div>
</footer>
Expand Down
15 changes: 8 additions & 7 deletions docs/build/html/_modules/antropy/fractal.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>antropy.fractal &#8212; antropy 0.1.7 documentation</title>
<title>antropy.fractal &#8212; antropy 0.1.8 documentation</title>
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../../_static/bootstrap-sphinx.css?v=9f61996d" />
<link rel="stylesheet" type="text/css" href="../../_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="../../_static/style.css?v=917eae1c" />
<script src="../../_static/documentation_options.js?v=ca7ad2ea"></script>
<script src="../../_static/doctools.js?v=9a2dae69"></script>
<script src="../../_static/documentation_options.js?v=22607128"></script>
<script src="../../_static/doctools.js?v=9bcbadda"></script>
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../../_static/clipboard.min.js?v=a7894cd8"></script>
<script src="../../_static/copybutton.js?v=fe0808e4"></script>
<script src="../../_static/copybutton.js?v=fd10adb8"></script>
<link rel="icon" href="../../_static/antropy.ico"/>
<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
Expand All @@ -39,7 +39,7 @@
</button>
<a class="navbar-brand" href="../../index.html">
antropy</a>
<span class="navbar-text navbar-version pull-left"><b>0.1.7</b></span>
<span class="navbar-text navbar-version pull-left"><b>0.1.8</b></span>
</div>

<div class="collapse navbar-collapse nav-collapse">
Expand Down Expand Up @@ -81,9 +81,10 @@
<h1>Source code for antropy.fractal</h1><div class="highlight"><pre>
<span></span><span class="sd">&quot;&quot;&quot;Fractal functions&quot;&quot;&quot;</span>

<span class="kn">from</span> <span class="nn">math</span> <span class="kn">import</span> <span class="n">floor</span><span class="p">,</span> <span class="n">log</span>

<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
<span class="kn">from</span> <span class="nn">numba</span> <span class="kn">import</span> <span class="n">jit</span><span class="p">,</span> <span class="n">types</span>
<span class="kn">from</span> <span class="nn">math</span> <span class="kn">import</span> <span class="n">log</span><span class="p">,</span> <span class="n">floor</span>

<span class="kn">from</span> <span class="nn">.entropy</span> <span class="kn">import</span> <span class="n">num_zerocross</span>
<span class="kn">from</span> <span class="nn">.utils</span> <span class="kn">import</span> <span class="n">_linear_regression</span><span class="p">,</span> <span class="n">_log_n</span>
Expand Down Expand Up @@ -558,7 +559,7 @@ <h1>Source code for antropy.fractal</h1><div class="highlight"><pre>
</p>
<p>
&copy; Copyright 2018-2024, Raphael Vallat.<br/>
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 7.4.7.<br/>
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 8.1.3.<br/>
</p>
</div>
</footer>
Expand Down
12 changes: 6 additions & 6 deletions docs/build/html/_modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Overview: module code &#8212; antropy 0.1.7 documentation</title>
<title>Overview: module code &#8212; antropy 0.1.8 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../_static/bootstrap-sphinx.css?v=9f61996d" />
<link rel="stylesheet" type="text/css" href="../_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="../_static/style.css?v=917eae1c" />
<script src="../_static/documentation_options.js?v=ca7ad2ea"></script>
<script src="../_static/doctools.js?v=9a2dae69"></script>
<script src="../_static/documentation_options.js?v=22607128"></script>
<script src="../_static/doctools.js?v=9bcbadda"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/clipboard.min.js?v=a7894cd8"></script>
<script src="../_static/copybutton.js?v=fe0808e4"></script>
<script src="../_static/copybutton.js?v=fd10adb8"></script>
<link rel="icon" href="../_static/antropy.ico"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
Expand All @@ -39,7 +39,7 @@
</button>
<a class="navbar-brand" href="../index.html">
antropy</a>
<span class="navbar-text navbar-version pull-left"><b>0.1.7</b></span>
<span class="navbar-text navbar-version pull-left"><b>0.1.8</b></span>
</div>

<div class="collapse navbar-collapse nav-collapse">
Expand Down Expand Up @@ -98,7 +98,7 @@ <h1>All modules for which code is available</h1>
</p>
<p>
&copy; Copyright 2018-2024, Raphael Vallat.<br/>
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 7.4.7.<br/>
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 8.1.3.<br/>
</p>
</div>
</footer>
Expand Down
5 changes: 5 additions & 0 deletions docs/build/html/_sources/changelog.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
----------------------
Expand Down
9 changes: 9 additions & 0 deletions docs/build/html/_sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://numpy.org/>`_
Expand Down
15 changes: 2 additions & 13 deletions docs/build/html/_static/basic.css
Original file line number Diff line number Diff line change
@@ -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 ----------------------------------------------------------- */
Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions docs/build/html/_static/copybutton.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
Expand Down Expand Up @@ -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, '', '')
Expand Down
7 changes: 0 additions & 7 deletions docs/build/html/_static/doctools.js
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
2 changes: 1 addition & 1 deletion docs/build/html/_static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const DOCUMENTATION_OPTIONS = {
VERSION: '0.1.7',
VERSION: '0.1.8',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
BUILDER: 'html',
Expand Down
7 changes: 0 additions & 7 deletions docs/build/html/_static/language_data.js
Original file line number Diff line number Diff line change
@@ -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"];
Expand Down
Loading

0 comments on commit 98970eb

Please sign in to comment.