diff --git a/.all-contributorsrc b/.all-contributorsrc index 66bbb2a9e..1b6195cf3 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -4,6 +4,7 @@ ], "imageSize": 100, "commit": false, + "badgeTemplate": "[![All Contributors](https://img.shields.io/badge/all_contributors-<%= contributors.length %>-orange.svg?style=flat)](#contributors-)", "contributors": [ { "login": "danalclop", @@ -135,7 +136,7 @@ ] } ], - "contributorsPerLine": 5, + "contributorsPerLine": 7, "projectName": "phys2bids", "projectOwner": "physiopy", "repoType": "github", diff --git a/.autorc b/.autorc new file mode 100644 index 000000000..a96757455 --- /dev/null +++ b/.autorc @@ -0,0 +1,86 @@ +{ + "plugins": [ + "git-tag", + "all-contributors", + "conventional-commits", + "first-time-contributor", + "released" + ], + "release": { + "prerelease": true + }, + "owner": "physiopy", + "repo": "phys2bids", + "name": "Stefano Moia", + "email": "s.moia@bcbl.eu", + "labels": [ + { + "name": "Majormod", + "changelogTitle": "๐Ÿ’ฅ Breaking Change", + "description": "This PR breaks compatibility, and increments the major version (+1.0.0)", + "releaseType": "major", + "overwrite": true + }, + { + "name": "Minormod", + "changelogTitle": "๐Ÿš€ Enhancement", + "description": "This PR generally closes an `Enhancement` issue. It increments the minor version (0.+1.0)", + "releaseType": "minor", + "overwrite": true + }, + { + "name": "Minormod-breaking", + "changelogTitle": "๐Ÿ’ฅ Breaking Change during development", + "description": "For development only, this PR increments the minor version (0.+1.0) but breaks compatibility", + "releaseType": "minor", + "overwrite": true + }, + { + "name": "BugFIX", + "changelogTitle": "๐Ÿ› Bug Fix", + "description": "This PR generally closes a `Bug` issue, and increments the patch version (0.0.+1)", + "releaseType": "patch", + "overwrite": true + }, + { + "name": "Documentation", + "changelogTitle": "๐Ÿ“ Documentation", + "description": "This issue or PR is about the documentation ", + "releaseType": "none", + "overwrite": true + }, + { + "name": "Testing", + "changelogTitle": "โš ๏ธ Tests", + "description": "This is for testing features, writing tests or producing testing code", + "releaseType": "none", + "overwrite": true + }, + { + "name": "Internal", + "changelogTitle": "๐Ÿ  Internal", + "description": "Changes affect the internal API. It doesn't increase the version, but produces a changelog", + "releaseType": "none", + "overwrite": true + }, + { + "name": "Outreach", + "changelogTitle": "๐Ÿ–‹๏ธ Outreach", + "description": "Issue about outreaching of any form", + "releaseType": "none", + "overwrite": true + }, + { + "name": "Skip release", + "description": "This PR preserves the current version when merged, and doesn't appear in the changelog", + "releaseType": "skip", + "overwrite": true + }, + { + "name": "Release", + "description": "For PR only, trigger a release at the merge", + "releaseType": "release", + "overwrite": true + } + ] +} \ No newline at end of file diff --git a/.github/workflows/pythonpublish.yml b/.github/workflows/pythonpublish.yml new file mode 100644 index 000000000..9e24640a4 --- /dev/null +++ b/.github/workflows/pythonpublish.yml @@ -0,0 +1,32 @@ +# This workflows will upload a Python Package using Twine when a release is created +# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries + +name: Upload Python Package + +on: + release: + types: [created] + +jobs: + deploy: + + runs-on: ubuntu-18.04 + + steps: + - name: Checkout source + uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: 3.7 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install setuptools wheel twine + - name: Build and publish + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python -m python setup.py sdist bdist_wheel + python -m twine upload dist/* \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 746427493..50e560d3f 100755 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,12 @@ -language: python -sudo: false -dist: xenial +os: linux +dist: bionic services: - xvfb notifications: email: change +language: python + python: - 3.6 - 3.7 @@ -28,9 +29,27 @@ matrix: env: - INSTALL_TYPE=wheel - CHECK_TYPE=test + - language: node_js + node_js: 10 + env: + - INSTALL_TYPE=auto-svl + - CHECK_TYPE=auto-svl + - GIT_NAME="Stefano Moia" + - GIT_EMAIL="s.moia@bcbl.eu" + - GH_USER="smoia" before_install: - - python -m pip install --upgrade pip + - if [ "${CHECK_TYPE}" == "auto-svl" ]; then + CHECK_BRANCH=$( git branch | grep \*); + if [ "${CHECK_BRANCH}" == "* master" ]; then + git config --local user.name "${GIT_NAME}"; + git config --local user.email "${GIT_EMAIL}"; + else + echo "Not on master branch, skipping auto-svl"; + fi; + else + python -m pip install --upgrade pip; + fi - if [ "${CHECK_TYPE}" == "linting" ]; then pip install flake8; fi @@ -53,6 +72,14 @@ install: pip install "bioread>=1.0.5"; python setup.py bdist_wheel; pip install dist/*.whl; + elif [ "${INSTALL_TYPE}" == "auto-svl" ]; then + CHECK_BRANCH=$( git branch | grep \*); + if [ "${CHECK_BRANCH}" == "* master" ]; then + curl -vkL -o - https://github.com/intuit/auto/releases/download/v9.39.0/auto-linux.gz | gunzip > build/auto; + chmod a+x build/auto; + else + echo "Not on master branch, skipping auto-svl"; + fi; else false; fi @@ -71,6 +98,13 @@ script: cp ../setup.cfg ./; args="--doctest-modules --cov-report term-missing --cov=phys2bids --pyargs" python -m pytest ${args} phys2bids; + elif [ "${CHECK_TYPE}" == "auto-svl" ]; then + CHECK_BRANCH=$( git branch | grep \*); + if [ "${CHECK_BRANCH}" == "* master" ]; then + build/auto shipit; + else + echo "Not on master branch, skipping auto-svl"; + fi; else false; fi diff --git a/.zenodo.json b/.zenodo.json new file mode 100644 index 000000000..5220848ee --- /dev/null +++ b/.zenodo.json @@ -0,0 +1,78 @@ +{ + "metadata": { + "license": { + "id": "Apache-2.0" + }, + "title": "physiopy/phys2bids: BIDS formatting of physiological recordings", + "relations": { + "version": [ + { + "count": 8, + "index": 7, + "parent": { + "pid_type": "recid", + "pid_value": "3470091" + } + } + ] + }, + "creators": [ + { + "affiliation": "BCBL - Basque Center on Cognition, Brain and Language", + "name": "Daniel Alcal\u00e1" + }, + { + "affiliation": "Northwestern University", + "name": "Apoorva Ayyagari" + }, + { + "affiliation": "Northwestern University", + "name": "Molly Bright" + }, + { + "affiliation": "BCBL - Basque Center on Cognition, Brain and Language", + "name": "C\u00e9sar Caballero Gaudes" + }, + { + "affiliation": "BCBL - Basque Center on Cognition, Brain and Language", + "name": "Vicente Ferrer" + }, + { + "name": "Soichi Hayashi" + }, + { + "affiliation": "McGill University", + "name": "Ross Markello" + }, + { + "orcid": "0000-0002-2553-3327", + "affiliation": "BCBL - Basque Center on Cognition, Brain and Language", + "name": "Stefano Moia" + }, + { + "affiliation": "Northwestern University", + "name": "Rachael Stickland" + }, + { + "affiliation": "BCBL - Basque Center on Cognition, Brain and Language", + "name": "Eneko Uru\u00f1uela" + }, + { + "affiliation": "Northwestern University", + "name": "Kristina Zvolanek" + } + ], + "access_right": "open", + "resource_type": { + "type": "software", + "title": "Software" + }, + "related_identifiers": [ + { + "scheme": "doi", + "identifier": "10.5281/zenodo.3470091", + "relation": "isVersionOf" + } + ] + } +} \ No newline at end of file diff --git a/README.md b/README.md index 8f062f597..182236338 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,13 @@ phys2bids [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3653153.svg)](https://doi.org/10.5281/zenodo.3653153) [![Join the chat at Gitter: https://gitter.im/physiopy/phys2bids](https://badges.gitter.im/physiopy/phys2bids.svg)](https://gitter.im/physiopy/phys2bids?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=body_badge) [![codecov](https://codecov.io/gh/physiopy/phys2bids/branch/master/graph/badge.svg)](https://codecov.io/gh/physiopy/phys2bids) +[![Auto Release](https://img.shields.io/badge/release-auto.svg?colorA=888888&colorB=9B065A&label=auto)](https://github.com/intuit/auto) [![Build Status: Linux](https://travis-ci.org/physiopy/phys2bids.svg?branch=master)](https://travis-ci.org/physiopy/phys2bids) [![Build Status. Windows](https://dev.azure.com/physiopy/phys2bids/_apis/build/status/physiopy.phys2bids?branchName=master)](https://dev.azure.com/physiopy/phys2bids/_build/latest?definitionId=1&branchName=master) [![See the documentation at: https://phys2bids.readthedocs.io](https://readthedocs.org/projects/phys2bids/badge/?version=latest)](https://phys2bids.readthedocs.io/en/latest/?badge=latest) [![Requirements Status](https://requires.io/github/physiopy/phys2bids/requirements.svg?branch=master)](https://requires.io/github/physiopy/phys2bids/requirements/?branch=master) + [![All Contributors](https://img.shields.io/badge/all_contributors-11-orange.svg?style=flat)](#contributors-) diff --git a/docs/contributorfile.rst b/docs/contributorfile.rst index e8a96c168..9f09776ef 100644 --- a/docs/contributorfile.rst +++ b/docs/contributorfile.rst @@ -20,9 +20,9 @@ Already know what you're looking for in this guide? Jump to the following sectio - `Contributing code through GitHub <#code>`_ - `Issues and Milestones <#issuesmilestones>`_ - `Labels <#labeltypes>`_ + - `Issues & PRs labels <#issueprlabels>`_ - `Issues labels <#issuelabel>`_ - `PRs labels <#prlabel>`_ - - `Issues & PRs labels <#issueprlabels>`_ - `Good First Issues <#g1i>`_ - `Contribution workflow <#workflow>`_ - `Pull Requests <#pr>`_ @@ -116,12 +116,26 @@ At physiopy, we use Issues and Milestones to keep track of and organise our work Labels ------ The current list of labels are `here `_. They can be used for **Issues**, **PRs**, or both. +We use `auto `_ to automatise our semantic versioning and Pypi upload, so **it's extremely important to use the right PR labels**! + +.. _issueprlabels: + +Issue & PR labels +~~~~~~~~~~~~~~~~~~~ +- Documentation: Improvements or additions to documentation. This category includes (but is not limited to) docs pages, docstrings, and code comments. +- Duplicate: Whatever this is, it exists already! Maybe itโ€™s a closed Issue/PR, that should be reopened. +- Enhancement: New features added or requested. This normally goes with a ``minormod`` label for PRs. +- Outreach: As part of the scientific community, we care about outreach. Check the relevant section about it, but know that this Issue/PR contains information or tasks about abstracts, talks, demonstrations, papers. +- Paused: Issue or PR should not be worked on until the resolution of other issues or PRs. +- Testing: This is for testing features, writing tests or producing testing code. Both user testing and CI testing! +- Urgent: If you don't know where to start, start here! This is probably related to a milestone due soon! .. _issuelabel: -Issues labels -~~~~~~~~~~~~~ +Issue-only labels +~~~~~~~~~~~~~~~~~~ - Bug: Something isnโ€™t working. It either breaks the code or has an unexpected outcome. +- Community: This issue contains information about the `physiopy` community (e.g. the next developer call) - Discussion: Discussion of a concept or implementation. These Issues are prone to be open ad infinitum. Jump in the conversation if you want! - Good first issue: Good for newcomers. These issues calls for a **fairly** easy enhancement, or for a change that helps/requires getting to know the code better. They have educational value, and for this reason, unless urgent, experts in the topic should refrain from closing them - but help newcomers closing them. - Hacktoberfest: Dedicated to the hacktoberfest event, so that people can help and feel good about it (and show it with a T-shirt!). **Such commits will not be recognised in the all-contributor table, unless otherwise specified**. @@ -132,24 +146,23 @@ Issues labels .. _prlabel: -PRs labels -~~~~~~~~~~ -- BugFIX: These PRs close an issue labelled ``bug``. they also increase the semantic versioning for fixes (+0.0.1). -- Invalid: These PRs don't seem right. They actually seem so not right that they wonโ€™t be further processed. This label invalidates an Hacktoberfest contribution. If you think this is wrong, start a discussion in the relevant issue (or open one if missing). Reviewers are asked to give an explanation for the use of this label. +PR-only labels +~~~~~~~~~~~~~~~ + +Labels for semantic release and changelogs +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Majormod: These PRs call for a new major release (+1.0.0). This means that the PR is breaking backward compatibility. - Minormod: These PRs call for a new minor release (0.+1.0). This means that the PR is **not** breaking backward compatibility. - -.. _issueprlabels: - -Issues & PRs labels -~~~~~~~~~~~~~~~~~~~ -- Documentation: Improvements or additions to documentation. This category includes (but is not limited to) docs pages, docstrings, and code comments. -- Duplicate: Whatever this is, it exists already! Maybe itโ€™s a closed Issue/PR, that should be reopened. -- Enhancement: New features added or requested. This normally goes with a ``minormod`` label for PRs. -- Outreach: As part of the scientific community, we care about outreach. Check the relevant section about it, but know that this Issue/PR contains information or tasks about abstracts, talks, demonstrations, papers. -- Paused: Issue or PR should not be worked on until the resolution of other issues or PRs. -- Testing: This is for testing features, writing tests or producing testing code. Both user testing and CI testing! -- Urgent: If you don't know where to start, start here! This is probably related to a milestone due soon! +- BugFIX: These PRs close an issue labelled ``bug``. They also increase the semantic versioning for fixes (+0.0.1). +- Internal: This PR contains changes to the internal API. It won't trigger a release, but it will be reported in the changelog. +- Documentation: See above. This PR won't trigger a release, but it will be reported in the changelog. +- Testing: See above. This PR won't trigger a release, but it will be reported in the changelog. +- Skip release: This PR will **not** trigger a release. +- Release: This PR will force the trigger of a release. + +Other labels +^^^^^^^^^^^^ +- Invalid: These PRs don't seem right. They actually seem so not right that they wonโ€™t be further processed. This label invalidates a Hacktoberfest contribution. If you think this is wrong, start a discussion in the relevant issue (or open one if missing). Reviewers are asked to give an explanation for the use of this label. .. _g1i: diff --git a/docs/index.rst b/docs/index.rst index dde38dcc1..b56dbd5d9 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -26,6 +26,9 @@ phys2bids :target: https://codecov.io/gh/physiopy/phys2bids :alt: codecov +.. image:: https://img.shields.io/badge/release-auto.svg?colorA=888888&colorB=9B065A&label=auto + :target: https://github.com/intuit/auto + :alt: Auto Release ``phys2bids`` is a python3 library meant to format physiological files in BIDS. It was born for AcqKnowledge files (BIOPAC), and at the moment it supports diff --git a/phys2bids/heuristics/heur_ex.py b/phys2bids/heuristics/heur_ex.py new file mode 100644 index 000000000..e69de29bb