Skip to content

Commit

Permalink
Update tests, infrastructure
Browse files Browse the repository at this point in the history
  • Loading branch information
rly committed Oct 25, 2023
1 parent 75d5d03 commit bc28f4c
Show file tree
Hide file tree
Showing 18 changed files with 344 additions and 273 deletions.
72 changes: 63 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
# output NWB files
*.nwb

# generated docs
docs/_build
docs/source/_format_auto_docs
docs/source/_static
!docs/source/_static/theme_overrides.css

# copied spec files
src/pynwb/ndx_events/spec/*.yaml

# Byte-compiled / optimized / DLL files
__pycache__/
Expand All @@ -29,6 +26,7 @@ parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
Expand All @@ -47,14 +45,18 @@ pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
.ruff_cache/

# Translations
*.mo
Expand All @@ -64,6 +66,7 @@ coverage.xml
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
Expand All @@ -76,16 +79,49 @@ instance/
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version
# IPython
profile_default/
ipython_config.py

# celery beat schedule file
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py
Expand All @@ -111,6 +147,24 @@ venv.bak/

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# Mac finder
.DS_Store
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog for ndx-events

## 0.3.0 (Upcoming)


29 changes: 29 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BSD 3-Clause License

Copyright (c) 2023, Ryan Ly
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5 changes: 0 additions & 5 deletions MANIFEST.in

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ subtype of `DynamicTable`, where each row corresponds to a different event type.
Unlike for the other event types, users can add their own custom columns to annotate each event type or event time.
This can be useful for storing event metadata related to data preprocessing and analysis, such as marking bad events.

This extension was developed by Ryan Ly, Ben Dichter, Oliver Rübel, and Andrew Tritt. Information about the rationale,
background, and alternative approaches to this extension can be found here:
This extension was developed by Ryan Ly, Oliver Rübel, and the NWB Technical Advisory Board.
Information about the rationale, background, and alternative approaches to this extension can be found here:
https://docs.google.com/document/d/1qcsjyFVX9oI_746RdMoDdmQPu940s0YtDjb1en1Xtdw

## Installation
Expand Down
112 changes: 112 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "ndx-events"
version = "0.3.0"
authors = [
{ name="Ryan Ly", email="rly@lbl.gov" }
]
description = "NWB extension for storing timestamped event and TTL pulse data"
readme = "README.md"
requires-python = ">=3.8"
license = {text = "BSD-3"}
classifiers = [
# TODO: add classifiers before release
"Programming Language :: Python",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
]
keywords = [
'NeurodataWithoutBorders',
'NWB',
'nwb-extension',
'ndx-extension',
]
dependencies = [
"pynwb>=2.5.0",
"hdmf>=3.10.0",
]

# TODO: add URLs before release
[project.urls]
"Homepage" = "https://github.com/rly/ndx-events"
# "Documentation" = "https://package.readthedocs.io/"
"Bug Tracker" = "https://github.com/rly/ndx-events/issues"
"Discussions" = "https://github.com/rly/ndx-events/discussions"
"Changelog" = "https://github.com/rly/ndx-events/CHANGELOG.md"

[tool.hatch.build]
include = [
"src/pynwb",
"spec/ndx-events.extensions.yaml",
"spec/ndx-events.namespace.yaml",
]
exclude = [
"src/pynwb/tests",
]

[tool.hatch.build.targets.wheel]
packages = [
"src/pynwb/ndx_events",
"spec"
]

[tool.hatch.build.targets.wheel.sources]
"spec" = "ndx_events/spec"

[tool.hatch.build.targets.sdist]
include = [
"src/pynwb",
"spec/ndx-events.extensions.yaml",
"spec/ndx-events.namespace.yaml",
"docs",
]
exclude = []

[tool.pytest.ini_options]
addopts = "--cov --cov-report html"

[tool.codespell]
skip = "htmlcov,.git,.mypy_cache,.pytest_cache,.coverage,*.pdf,*.svg,venvs,.tox,hdmf-common-schema,./docs/_build/*,*.ipynb"

[tool.coverage.run]
branch = true
source = ["src/pynwb"]

[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"@abstract"
]

[tool.black]
line-length = 120
preview = true
exclude = ".git|.mypy_cache|.tox|.venv|venv|.ipynb_checkpoints|_build/|dist/|__pypackages__|.ipynb|docs/"

[tool.ruff]
select = ["E", "F", "T100", "T201", "T203"]
exclude = [
".git",
".tox",
"__pycache__",
"build/",
"dist/",
]
line-length = 120

[tool.ruff.per-file-ignores]
"src/spec/create_extension_spec.py" = ["T201"]
"src/pynwb/tests/test_example_usage.py" = ["T201"]

[tool.ruff.mccabe]
max-complexity = 17
15 changes: 15 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# pinned dependencies to reproduce an entire development environment to
# run tests, check code style, and generate documentation
black==23.9.1
codespell==2.2.6
coverage==7.3.2
hdmf==3.10.0
hdmf-docutils==0.4.5
pre-commit==3.4.0
pynwb==2.5.0
pytest==7.4.2
pytest-cov==4.1.0
python-dateutil==2.8.2
pytest-subtests==0.6.0
ruff==0.0.292
tox==4.11.3
5 changes: 5 additions & 0 deletions requirements-min.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# minimum versions of package dependencies for installation
# these should match the minimum versions specified in pyproject.toml
# NOTE: it may be possible to relax these minimum requirements
pynwb==2.5.0
hdmf==3.10.0
3 changes: 0 additions & 3 deletions requirements.txt

This file was deleted.

20 changes: 0 additions & 20 deletions setup.cfg

This file was deleted.

Loading

0 comments on commit bc28f4c

Please sign in to comment.