diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml index c3a8740..0e76f61 100644 --- a/.github/workflows/black.yml +++ b/.github/workflows/black.yml @@ -1,5 +1,5 @@ --- -name: Black +name: black on: push: diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml index ad2d7d8..82005e6 100644 --- a/.github/workflows/codespell.yml +++ b/.github/workflows/codespell.yml @@ -1,5 +1,5 @@ --- -name: Codespell +name: codespell on: push: diff --git a/.github/workflows/update_precommit_hooks.yml b/.github/workflows/update_precommit_hooks.yml index 570f7e5..c28e79c 100644 --- a/.github/workflows/update_precommit_hooks.yml +++ b/.github/workflows/update_precommit_hooks.yml @@ -1,5 +1,5 @@ --- -name: Update precommit hooks +name: update precommit hooks on: @@ -50,4 +50,4 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} delete-branch: true title: '[BOT] update pre-commit hooks' - body: done via this [GitHub Action](https://github.com/${{ github.repository_owner }}/neuropower/blob/master/.github/workflows/update_precommit_hooks.yml) + body: done via this [GitHub Action](https://github.com/${{ github.repository_owner }}/neurodesign/blob/master/.github/workflows/update_precommit_hooks.yml) diff --git a/.gitignore b/.gitignore index da91d44..f384603 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,8 @@ examples/test.pdf output design_* -test_db/ +# hatch handles this one +neurodesign/_version.py # Byte-compiled / optimized / DLL files __pycache__/ diff --git a/CHANGES.md b/CHANGES.md index d1a2228..4494ee3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,130 +1,203 @@ -0.2.02 - 08/24/2018 +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + + + +## [Unreleased] + +### Added + +### Changed + +### Deprecated + +### Removed + +### Fixed + +### Security + +## [0.2.02] - 2018-08-24 + * bug with timepoints fix -0.2.01 - 02/09/2018 +## [0.2.01] - 2018-02-09 + * bug in report.py -0.2.00 - 02/09/2018 +## [0.2.00] - 2018-02-09 + * change names to reflect new options * update examples * reflects JSS submission -0.1.13 - 02/06/2018 +## [0.1.13] - 2018-02-06 + * fix on not doing FdMax and FeMax if not necessary -0.1.12 - 02/06/2018 +## [0.1.12] - 2018-02-06 + * fix on matplotlib bug -0.1.08-11 - 02/06/2018 +## [0.1.08]-11 - 2018-02-06 + * fix on duration bug -0.1.07 - 02/05/2018 +## [0.1.07] - 2018-02-05 + * added option for random design generation -0.1.06 - 01/22/2018 +## [0.1.06] - 2018-11-22 + * debug conda matplotlib * remove shift in onsets * ensure ITI is nominal value * improve handling of resolution * improve handling of hrf (resolution) -0.1.05 - 11/22/2017 +## [0.1.05] - 2017-11-22 + * report: remove bug ndarray check in report -0.1.04 - 08/30/2017 +## [0.1.04] - 2017-08-30 + * add hrf_precision as parameter: not same as resolution -0.1.03 - 08/09/2017 +## [0.1.03] - 2017-08-09 + * remove indentation bugs * replace often reoccuring warnings with internal warning -0.1.02 - 07/31/2017 +## [0.1.02] - 2017-07-31 + * debug first ITI (should be 0) * debug Hardprob * debug maximum ITI with resolution * round ITI to resolution before computing onsets * added exceptions for longer designs -0.1.01 - 07/03/2017 +## [0.1.01] - 2017-07-03 + * debug numpy exception -0.1.00 - 04/26/2017 +## [0.1.00] - 2017-04-26 + * package underwent extensive testing through the online application * examples are added complementary to the manuscript under revision -0.0.28 - 02/20/2017 +## [0.0.28] - 2017-02-20 + * debug correlation check -0.0.27 - 02/20/2017 +## [0.0.27] - 2017-02-20 + * debug rest durations * debug repeated msequences -0.0.26 - 02/14/2017 +## [0.0.26] - 2017-02-14 + * patch reoccurring (but rare) problem with too long a design -0.0.25 - 02/06/2017 +## [0.0.25] - 2017-02-06 + * avoid getting stuck while trying to find blocked designs -0.0.24 - 02/02/2017 +## [0.0.24] - 2017-02-02 + * add some extra space for max duration (0.5s) to avoid trials exceeding the experiment duration -0.0.23 - 02/01/2017 +## [0.0.23] - 2017-02-01 + * remove requirements for now -0.0.22 - 02/01/2017 +## [0.0.22] - 2017-02-01 + * update requirements -0.0.21 - 02/01/2017 +## [0.0.21] - 2017-02-01 + * remove itertools from requirements -0.0.20 - 02/01/2017 +## [0.0.20] - 2017-02-01 + * remove collections from requirements -0.0.19 - 02/01/2017 +## [0.0.19] - 2017-02-01 + * pypi problems -0.0.18 - 02/01/2017 +## [0.0.18] - 2017-02-01 + * remove typo in install_requires -0.0.17 - 02/01/2017 +## [0.0.17] - 2017-02-01 + * remove requirements.txt -0.0.16 - 02/01/2017 +## [0.0.16] - 2017-02-01 + * debug memory problem induced in 0.0.15 -0.0.15 - 01/31/2017 +## [0.0.15] - 2017-01-31 + * debug LinAlgError * debug necessity for calculating both Fe and Fd --> speed up * debug initial population weights -0.0.14 - 01/19/2017 +## [0.0.14] - 2017-01-19 + * improve which designs are outputted * improve report -0.0.13 - 01/18/2017 +## [0.0.13] - 2017-01-18 + * debug max number of repeats -0.0.12 - 01/18/2017 +## [0.0.12] - 2017-01-18 + * debug generation of ITI's from truncated distribution -0.0.11 - 01/17/2017 +## [0.0.11] - 2017-01-17 + * debug generation of ITI's from truncated distribution -0.0.10 - 01/10/2017 +## [0.0.10] - 2017-01-10 + * remove direct support for GUI -0.0.9 - 12/19/2016 +## [0.0.9] - 2016-12-19 + * change matplotlib backend for report -0.0.8 - 12/19/2016 +## [0.0.8] - 2016-12-19 + * debug script -0.0.7 - 12/09/2016 +## [0.0.7] - 2016-12-09 + * debug seeds * restructure a few parameters in other classes -0.0.6 - 11/18/2016 +## [0.0.6] - 2016-11-18 + * add report to download -0.0.2 - 11/18/2016 +## [0.0.2] - 2016-11-18 + * remove bug in report when numpy array is given. diff --git a/docs/_templates/layout.html b/docs/_templates/layout.html index 1697969..389bfa4 100644 --- a/docs/_templates/layout.html +++ b/docs/_templates/layout.html @@ -2,8 +2,8 @@ {% block rootrellink %} -
  • home
  • -
  • search
  • +
  • home | 
  • +
  • search | 
  • {% endblock %} diff --git a/docs/conf.py b/docs/conf.py index fdd47c7..b577eb9 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,23 +1,25 @@ -# -# neurodesign documentation build configuration file, created by -# sphinx-quickstart on Mon Jan 23 16:58:27 2017. -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. +"""Neurodesign documentation build configuration file. + +This file is execfile()d with the current directory set to its +containing dir. + +Note that not all possible configuration values are present in this +autogenerated file. + +All configuration values have a default; values that are commented out +serve to show the default. +""" + import os import sys from unittest import mock +from neurodesign._version import __version__ + # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath("../source/")) +sys.path.insert(0, os.path.abspath("../neurodesign")) # -- General configuration ------------------------------------------------ @@ -46,16 +48,16 @@ # General information about the project. project = "neurodesign" -copyright = "2017, Joke Durnez" +copyright = "Joke Durnez" # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. -version = "0.0.13" +version = __version__ # The full version, including alpha/beta/rc tags. -release = "0.0.13" +release = __version__ # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/genalg.rst b/docs/genalg.rst index 62eecf6..624cea9 100644 --- a/docs/genalg.rst +++ b/docs/genalg.rst @@ -6,24 +6,24 @@ Neurodesign documentation Neurodesign: design optimisation -------------------------------- -.. automodule:: src.neurodesign +.. automodule:: neurodesign :members: :noindex: Generate: generating stimulus order and ITI's --------------------------------------------- -.. automodule:: src.generate +.. automodule:: neurodesign.generate :members: :noindex: Msequence: generating msequences -------------------------------- -.. automodule:: src.msequence +.. automodule:: neurodesign.msequence :members: :noindex: Report: summarise results from optimisation ------------------------------------------- -.. automodule:: src.report +.. automodule:: neurodesign.report :members: :noindex: diff --git a/docs/getting_started.rst b/docs/getting_started.rst index a99c040..981d8cb 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -18,14 +18,21 @@ neurodesign is available on pypi. To install, run:: About Design Optimisation Using the Genetic Algorithm ===================================================== -This toolbox is for the optimization of experimental designs for fMRI. Minimizing the variance of the design matrix will help detect or estimate (depending on the outcome of interest) the effect researchers are looking for. The genetic algorithm for experimental designs was introduced by Wager and Nichols (2002) and further improved by Kao, Mandal, Lazar and Stufken (2009). We implemented these methods in a python package and a userfriendly web-application and introduced some improvements and allows more flexibility for the experimental setup. +This toolbox is for the optimization of experimental designs for fMRI. +Minimizing the variance of the design matrix will help detect or estimate +(depending on the outcome of interest) the effect researchers are looking for. +The genetic algorithm for experimental designs was introduced by Wager and Nichols (2002) +and further improved by Kao, Mandal, Lazar and Stufken (2009). +We implemented these methods in a python package and a userfriendly web-application +and introduced some improvements and allows more flexibility for the experimental setup. .. _design-efficiency: Design efficiency ================= -The core idea of this package is to run an optimization algorithm that (among others) optimizes the design efficiency of an fMRI design using A-optimality, with this formula: +The core idea of this package is to run an optimization algorithm that (among others) +optimizes the design efficiency of an fMRI design using A-optimality, with this formula: .. math:: Eff(C\beta) = \frac{n}{Trace(CX'X^{-1}C')} diff --git a/docs/index.rst b/docs/index.rst index 5e222a2..b51380c 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -4,7 +4,9 @@ Welcome to the neurodesign documentation! ========================================= -We have built a GUI for this package, in the form of an online toolbox available at `www.neuropowertools.org`_. The GUI uses functions from the neurodesign package. +We have built a GUI for this package, +in the form of an online toolbox available at `neuropowertools `_. +The GUI uses functions from the neurodesign package. .. toctree:: :maxdepth: 4 diff --git a/neurodesign/_version.py b/neurodesign/_version.py deleted file mode 100644 index 102b65a..0000000 --- a/neurodesign/_version.py +++ /dev/null @@ -1,17 +0,0 @@ -# file generated by setuptools_scm -# don't change, don't track in version control -TYPE_CHECKING = False -if TYPE_CHECKING: - from typing import Tuple, Union - - VERSION_TUPLE = Tuple[Union[int, str], ...] -else: - VERSION_TUPLE = object - -version: str -__version__: str -__version_tuple__: VERSION_TUPLE -version_tuple: VERSION_TUPLE - -__version__ = version = "0.2.3.dev25+g1a2b14b.d20240216" -__version_tuple__ = version_tuple = (0, 2, 3, "dev25", "g1a2b14b.d20240216") diff --git a/pyproject.toml b/pyproject.toml index f781336..09a1578 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,14 +22,10 @@ classifiers = [ "Programming Language :: Python :: 3.12" ] dependencies = [ - "numpy>1.0.0", - "scipy>1.0.0", "scikit-learn>0.15.0", - "pandas>0.15.0", "progressbar>2.0", "reportlab", "pdfrw", - "matplotlib", "seaborn" ] description = "Package for design optimisation for fMRI experiments" @@ -44,10 +40,15 @@ requires-python = ">=3.8" [project.optional-dependencies] # A combination of dependencies useful for developers dev = [ - "neurodesign[test]", + "neurodesign[doc,test]", 'pre-commit', 'tox' ] +# Requirements necessary for building the documentation +doc = [ + "sphinx", + "sphinx-copybutton" +] # For running unit and docstring tests test = [ "coverage",