Skip to content

Commit

Permalink
updating 10_entropy notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
“Frederic-vW” committed Nov 24, 2023
2 parents 074a2b1 + c043df3 commit e1e7c27
Show file tree
Hide file tree
Showing 55 changed files with 959 additions and 789 deletions.
25 changes: 25 additions & 0 deletions .codecov.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
comment: false
github_checks: # too noisy, even though "a" interactively disables them
annotations: false

codecov:
notify:
require_ci_to_pass: false

coverage:
status:
patch:
default:
informational: true
target: 95%
if_no_uploads: error
if_not_found: success
if_ci_failed: failure
project:
default: false
library:
informational: true
target: 90%
if_no_uploads: error
if_not_found: success
if_ci_failed: failure
File renamed without changes.
56 changes: 0 additions & 56 deletions .github/workflows/build.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: style
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
cancel-in-progress: true
on:
on: # yamllint disable-line rule:truthy
pull_request:
push:
branches: [main]
Expand All @@ -14,32 +14,36 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Python 3.9
uses: actions/setup-python@v4
with:
python-version: '3.9'
architecture: 'x64'
- name: Install dependencies
run: |
python -m pip install --progress-bar off --upgrade pip setuptools wheel
python -m pip install --progress-bar off --upgrade pip setuptools
python -m pip install --progress-bar off .[style]
- name: Run Ruff
run: ruff check pycrostates
- name: Run isort
uses: isort/isort-action@master
- name: Run black
uses: psf/black@stable
with:
options: "--check --verbose"
- name: Run Ruff
run: ruff check pycrostates
- name: Run codespell
uses: codespell-project/actions-codespell@master
with:
check_filenames: true
check_hidden: true
skip: ./.git,./build,./.github,*.bib
skip: ./.git,./build,./.github,*.bib,./.mypy_cache,./.pytest_cache
ignore_words_file: ./.codespellignore
- name: Run pydocstyle
run: pydocstyle .
- name: Run bibclean
run: bibclean-check docs/references.bib
- name: Run toml-sort
run: toml-sort pyproject.toml --check
- name: Run yamllint
run: yamllint . -c .yamllint.yaml --strict
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: publish

on:
on: # yamllint disable-line rule:truthy
release:
types: [published]
workflow_dispatch:
Expand All @@ -11,15 +11,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Python 3.9
uses: actions/setup-python@v4
with:
python-version: '3.9'
architecture: 'x64'
- name: Install dependencies
run: |
python -m pip install --progress-bar off --upgrade pip setuptools wheel
python -m pip install --progress-bar off --upgrade pip setuptools
python -m pip install --progress-bar off .[build]
- name: Build and publish
env:
Expand Down
109 changes: 109 additions & 0 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: pytest
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
cancel-in-progress: true
on: # yamllint disable-line rule:truthy
pull_request:
push:
branches: [main]
workflow_dispatch:
schedule:
- cron: '0 8 * * 1'

jobs:
pytest:
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [ubuntu, macos, windows]
python-version: [3.9, "3.10", "3.11", "3.12"]
name: ${{ matrix.os }} - py${{ matrix.python-version }}
runs-on: ${{ matrix.os }}-latest
defaults:
run:
shell: bash
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- name: Install package
run: |
python -m pip install --progress-bar off --upgrade pip setuptools
python -m pip install --progress-bar off .[test]
- name: Display system information
run: pycrostates-sys_info --developer
- name: Display MNE info
run: mne sys_info -pd
- name: Get testing dataset version
run: |
curl https://raw.githubusercontent.com/mne-tools/mne-testing-data/master/version.txt -o mne_testing_data_version.txt
- name: Cache testing dataset
uses: actions/cache@v3
with:
key: mne-testing-${{ hashFiles('mne_testing_data_version.txt') }}
path: ~/mne_data
- name: Download testing dataset
run: python -c "import mne; mne.datasets.testing.data_path(verbose=True)"
- name: Run pytest
run: pytest pycrostates --cov=pycrostates --cov-report=xml --cov-config=pyproject.toml
- name: Upload to codecov
uses: codecov/codecov-action@v3
with:
files: ./coverage.xml
flags: unittests # optional
name: codecov-umbrella # optional
verbose: true # optional (default = false)

pytest-pip-pre:
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
python-version: ["3.11"]
name: pip pre-release - py${{ matrix.python-version }}
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- name: Install dependencies
run: |
python -m pip install --progress-bar off --upgrade pip setuptools
python -m pip install --progress-bar off .[test]
python -m pip install --progress-bar off --upgrade git+https://github.com/mne-tools/mne-python
python -m pip install --progress-bar off --upgrade --pre --only-binary :all: -i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple --timeout=180 numpy scipy scikit-learn matplotlib
- name: Display system information
run: pycrostates-sys_info --developer
- name: Display MNE info
run: mne sys_info -pd
- name: Get testing dataset version
run: |
curl https://raw.githubusercontent.com/mne-tools/mne-testing-data/master/version.txt -o mne_testing_data_version.txt
- name: Cache testing dataset
uses: actions/cache@v3
with:
key: mne-testing-${{ hashFiles('mne_testing_data_version.txt') }}
path: ~/mne_data
- name: Download testing dataset
run: python -c "import mne; mne.datasets.testing.data_path(verbose=True)"
- name: Run pytest
run: pytest pycrostates --cov=pycrostates --cov-report=xml --cov-config=pyproject.toml
- name: Upload to codecov
uses: codecov/codecov-action@v3
with:
files: ./coverage.xml
flags: unittests # optional
name: codecov-umbrella # optional
verbose: true # optional (default = false)
56 changes: 56 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
ci:
skip: [codespell, pydocstyle, yamllint]

repos:
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
files: pycrostates

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.10.1
hooks:
- id: black
args: [--quiet]
files: pycrostates

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.4
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
files: pycrostates

- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
args: [--check-filenames, --ignore-words=.codespellignore, --skip=*.bib]

- repo: https://github.com/pycqa/pydocstyle
rev: 6.3.0
hooks:
- id: pydocstyle
files: pycrostates
additional_dependencies: [tomli]

- repo: https://github.com/mscheltienne/bibclean
rev: 0.7.1
hooks:
- id: bibclean-fix
files: docs/references.bib
args: [--exit-non-zero-on-fix]

- repo: https://github.com/pappasam/toml-sort
rev: v0.23.1
hooks:
- id: toml-sort-fix
files: pyproject.toml

- repo: https://github.com/adrienverge/yamllint
rev: v1.32.0
hooks:
- id: yamllint
args: [--strict, -c, .yamllint.yaml]
files: (.github/|.codecov.yaml|.pre-commit-config.yaml|.prospector.yaml|.readthedocs.yaml)
2 changes: 1 addition & 1 deletion .prospector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ pep257:

pylint:
disable:
- too-many-arguments
- too-many-arguments
21 changes: 9 additions & 12 deletions .readthedocs.yml → .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,19 @@ version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
builder: html
configuration: docs/source/conf.py
fail_on_warning: true

# Optionally set the version of Python and requirements required to build your docs
python:
install:
- method: pip
path: .
extra_requirements:
- docs
- method: pip
path: .
extra_requirements:
- docs

build:
os: ubuntu-20.04
tools:
python: "3.8"

sphinx:
builder: html
configuration: docs/source/conf.py
fail_on_warning: true
os: ubuntu-20.04
tools:
python: "3.10"
5 changes: 5 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
extends: default

rules:
line-length: disable
document-start: disable
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![PyPI version](https://badge.fury.io/py/pycrostates.svg)](https://badge.fury.io/py/pycrostates)
[![Conda Version](https://img.shields.io/conda/vn/conda-forge/pycrostates.svg)](https://anaconda.org/conda-forge/pycrostates)
[![Documentation Status](https://readthedocs.org/projects/pycrostates/badge/?version=latest)](https://pycrostates.readthedocs.io/en/latest/?badge=latest)
[![Build Status](https://dev.azure.com/vferat/pycrostates/_apis/build/status/vferat.pycrostates?branchName=main)](https://dev.azure.com/vferat/pycrostates/_build/latest?definitionId=1&branchName=main)
[![tests](https://github.com/vferat/pycrostates/actions/workflows/pytest.yaml/badge.svg?branch=main)](https://github.com/vferat/pycrostates/actions/workflows/pytest.yaml)
[![codecov](https://codecov.io/gh/vferat/pycrostates/branch/master/graph/badge.svg?token=47COGGCGX8)](https://codecov.io/gh/vferat/pycrostates)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/029e425f90614943b0a944e03922b637)](https://www.codacy.com/gh/vferat/pycrostates/dashboard?utm_source=github.com&utm_medium=referral&utm_content=vferat/pycrostates&utm_campaign=Badge_Grade)
[![DOI](https://joss.theoj.org/papers/10.21105/joss.04564/status.svg)](https://doi.org/10.21105/joss.04564)
Expand Down Expand Up @@ -38,7 +38,7 @@ To cite specific version numbers of the software, you can use the DOIs provided
by [Zenodo](https://zenodo.org/record/7129852).

## Contributing

[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/vferat/pycrostates/main.svg)](https://results.pre-commit.ci/latest/github/vferat/pycrostates/main)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
Expand Down
Loading

0 comments on commit e1e7c27

Please sign in to comment.