diff --git a/.devcontainer/post_create.sh b/.devcontainer/post_create.sh index 6fb96a0..0f88e4e 100644 --- a/.devcontainer/post_create.sh +++ b/.devcontainer/post_create.sh @@ -7,4 +7,4 @@ curl -sSL https://install.python-poetry.org | python - # To make sure Poetry doesn't redundantly nest a virtual environment # within the Docker container we configure it as follows: poetry config virtualenvs.create false --local -poetry install --with main,dev,build +poetry install --with main,dev diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 29ab754..a6fe75e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -1,9 +1,3 @@ -# All CI tasks (testing, building) are maintained in this workflow file -# and their inter-dependencies controlled with job-level `if` and `needs` until -# GitHub Actions allows for them to be factored out into separate, inter-dependent -# workflow files. -# See https://github.community/t/depend-on-another-workflow/16311/8. - name: CI on: [push, pull_request, release] # runs on all branches env: @@ -28,7 +22,7 @@ jobs: virtualenvs-create: false - name: Install biopeaks - run: poetry install --no-interaction --without build + run: poetry install --no-interaction --with main,dev - name: Install system dependencies for headless testing run: sudo ./.devcontainer/install_system_dependencies.sh @@ -60,15 +54,7 @@ jobs: - name: Install and configure Poetry uses: snok/install-poetry@v1 with: - virtualenvs-create: true - virtualenvs-in-project: true - - - name: Load cached venv - id: cached-pip-wheelsy - uses: actions/cache@v4 - with: - path: ~/.cache - key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} + virtualenvs-create: false - name: Build and upload distribution env: @@ -76,72 +62,3 @@ jobs: PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} run: | poetry publish -u $PYPI_USERNAME -p $PYPI_PASSWORD --build - - - build_executable: - - needs: test - runs-on: windows-latest - if: github.event_name == 'release' && github.event.action == 'published' - - steps: - - - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: ${{ env.PYTHON_VERSION }} - - - name: Install and configure Poetry - uses: snok/install-poetry@v1 - with: - virtualenvs-create: true - virtualenvs-in-project: true - - - name: Load cached venv - id: cached-pip-wheels - uses: actions/cache@v4 - with: - path: ~/.cache - key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} - - - name: Install dependencies - run: | - poetry install --no-interaction --no-root --no-dev --extras "pyinstaller" - - - name: Build executable - shell: bash -l {0} - run: | - source $VENV - pyinstaller --onefile --windowed --name=biopeaks --paths=D:\\a\\biopeaks\\biopeaks \ - --hidden-import=distutils --hidden-import=distutils.version --hidden-import=distutils.unixccompiler \ - --hidden-import=numpy.distutils --collect-all=numpy.distutils \ - --icon=biopeaks\\images\\python_icon.ico biopeaks\\__main__.py - - - name: Upload executable - uses: actions/upload-artifact@v4 - with: - name: biopeaks_windows - path: dist/biopeaks.exe - - - upload_executable_to_release: # separate job on Ubuntu since JasonEtco/upload-to-release@master only runs on Linux - - needs: build_executable - runs-on: ubuntu-latest - if: github.event_name == 'release' && github.event.action == 'published' - - steps: - - - name: Download executable - uses: actions/download-artifact@v4 - with: - name: biopeaks_windows - - - name: Upload executable to release - uses: JasonEtco/upload-to-release@master - with: - args: biopeaks.exe application/octet-stream - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # token generated implicitly \ No newline at end of file diff --git a/.github/workflows/manual_build.yml b/.github/workflows/manual_build.yml deleted file mode 100644 index a610500..0000000 --- a/.github/workflows/manual_build.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: pyinstaller -on: - workflow_dispatch - -jobs: - - build_windows: - - runs-on: windows-latest - - steps: - - - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: "3.9" - - - name: Install and configure Poetry - uses: snok/install-poetry@v1 - with: - virtualenvs-create: true - virtualenvs-in-project: true - - - name: Load cached venv - id: cached-pip-wheels - uses: actions/cache@v2 - with: - path: ~/.cache - key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} - - - name: Install dependencies - run: | - poetry install --no-interaction --no-root --no-dev --extras "pyinstaller" - - - name: Build executable - shell: bash -l {0} - run: | - source $VENV - pyinstaller --onefile --name=biopeaks --paths=D:\\a\\biopeaks\\biopeaks \ - --hidden-import=distutils --hidden-import=distutils.version --hidden-import=distutils.unixccompiler \ - --hidden-import=numpy.distutils --collect-all=numpy.distutils \ - --icon=biopeaks\\images\\python_icon.ico biopeaks\\__main__.py - - - name: Upload executable - uses: actions/upload-artifact@v2 - with: - name: biopeaks_windows - path: dist/biopeaks.exe diff --git a/README.md b/README.md index 83b159b..add78d7 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,6 @@ [![PyPI version](https://img.shields.io/pypi/v/biopeaks.svg)](https://pypi.org/project/biopeaks/) [![JOSS](https://joss.theoj.org/papers/10.21105/joss.02621/status.svg)](https://doi.org/10.21105/joss.02621) - # General Information `biopeaks` is a straightforward graphical user interface for feature extraction from electrocardiogram (ECG), photoplethysmogram (PPG) and breathing biosignals. @@ -25,10 +24,8 @@ peaks in breathing signals) with signal-specific, sensible defaults + .csv export of extrema and instantaneous features for further analysis (e.g., heart rate variability) + automatic analysis of multiple files (batch processing) - ![GUI](https://github.com/JanCBrammer/biopeaks/raw/main/docs/images/screenshot_statistics.png) - # Installation `biopeaks` can be installed from PyPI: @@ -37,33 +34,22 @@ peaks in breathing signals) with signal-specific, sensible defaults pip install biopeaks ``` -Alternatively, on Windows, download [biopeaks.exe](https://github.com/JanCBrammer/biopeaks/releases/latest) -and run it. Running the executable does not require a Python installation. - You can find more details on the installation [here](https://jancbrammer.github.io/biopeaks/installation.html). - # Documentation Have a look at the [user guide](https://jancbrammer.github.io/biopeaks/user_guide.html) to get started with `biopeaks`. - -# Contributors welcome! +# Contributors welcome Improvements or additions to the repository (documentation, tests, code) are welcome and encouraged. Spotted a typo in the documentation? Caught a bug in the code? Ideas for improving the documentation, increase test coverage, or adding features to the GUI? Get started with the [contributor guide](https://jancbrammer.github.io/biopeaks/contributor_guide.html). - # Citation Please refer to the [biopeaks paper](https://joss.theoj.org/papers/10.21105/joss.02621) in The Journal of Open Source Software. - # Changelog Have a look at the [changelog](https://jancbrammer.github.io/biopeaks/changelog.html) to get an overview of what has changed throughout the versions of `biopeaks`. - - - - diff --git a/docs/contributor_guide.md b/docs/contributor_guide.md index d51c14a..e799bc5 100644 --- a/docs/contributor_guide.md +++ b/docs/contributor_guide.md @@ -112,33 +112,3 @@ You can then run the `benchmark_PPG_local` script in the `benchmarks` folder. In Use the project's [devcontainer](https://github.com/JanCBrammer/biopeaks/blob/master/.devcontainer/devcontainer.json) (e.g., in Visual Studio Code) to set up your local development environment. - -### Building executable with PyInstaller - -Create an additional environment that contains only the build dependencies in -order to reduce the build size. Configure the build environment just like the [editable development environment](#editable-development). - -``` -conda create --name biopeaks_build python=3.9 -conda activate biopeaks_build -pip install poetry -poetry config virtualenvs.create false --local -``` - -Now we use Poetry to only install the build dependencies, leaving out the development dependencies. -The latter would unnecessarily increase the build size. - -``` -poetry install --no-root --no-dev --extras "pyinstaller" -``` - -Now we can build the application from the root of the repository using PyInstaller. -Note that PyInstaller needs access to the `__main__.py` entry-point as if the file -would be located outside the `biopeaks` sub-directory (since `biopeaks` is imported -using absolute imports inside `__main__.py`). This is why we need to pass the root (`.`) -to the PyInstaller paths. For more details see . - -``` -pyinstaller --onefile --windowed --name=biopeaks --paths=. \ ---icon=biopeaks\images\python_icon.ico biopeaks\__main__.py -``` diff --git a/docs/installation.md b/docs/installation.md index b026a4b..ba72506 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -1,15 +1,7 @@ # Installation -## As executable +## Instructions for users without a Python installation -For Windows you can download [biopeaks.exe](https://github.com/JanCBrammer/biopeaks/releases/latest). Double-click the -executable to run it. You don't need a Python installation on your computer to run the executable. -Currently, there are no executables available for macOS or Linux -(please [open an issue](https://help.github.com/en/github/managing-your-work-on-github/creating-an-issue) if you're interested). - -## As Python package - -### Instructions for users without a Python installation If you don't have experience with installing Python packages and/or if you aren't sure if you have Python on your computer start by setting up Python. Go to and install the latest @@ -27,17 +19,21 @@ pip install scipy numpy matplotlib pandas PySide6 biopeaks ``` After the successful installation, open the application by typing + ``` biopeaks ``` + Note that every time you open the Anaconda Prompt, you need to activate the biopeaks environment before starting the application: + ``` conda activate biopeaks biopeaks ``` ### Instructions for users who already have a Python installation + Have a look at the project's [pyproject.toml file](https://github.com/JanCBrammer/biopeaks/blob/main/pyproject.toml) for an up-to-date list of the dependencies. In order to manage the dependencies, it is highly recommended to install `biopeaks` into an isolated environment using [miniconda](https://docs.conda.io/en/latest/miniconda.html), diff --git a/pyproject.toml b/pyproject.toml index c9c1dc5..4ddd7b7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,9 +30,6 @@ aiohttp = ">=3.8.1" wfdb = ">=3.4.1" h5py = ">=3.6.0" -[tool.poetry.group.build.dependencies] -pyinstaller = ">=6.9.0" - [tool.poetry.scripts] # Command line entry-point. biopeaks = "biopeaks.__main__:main"