Skip to content

Commit

Permalink
Merge branch 'guide_progress_bars_1' into parallel_nwbinspector_bars_…
Browse files Browse the repository at this point in the history
…for_guide
  • Loading branch information
CodyCBakerPhD authored Apr 22, 2024
2 parents e13c5a3 + 2375d21 commit 9d58106
Show file tree
Hide file tree
Showing 12 changed files with 67 additions and 9 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Codespell configuration is within pyproject.toml
---
name: Codespell

on:
push:
branches: [dev]
pull_request:
branches: [dev]

permissions:
contents: read

jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Codespell
uses: codespell-project/actions-codespell@v2
12 changes: 10 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 24.3.0
rev: 24.4.0
hooks:
- id: black

- repo: https://github.com/codespell-project/codespell
# Configuration for codespell is in pyproject.toml
rev: v2.2.6
hooks:
- id: codespell
additional_dependencies:
- tomli
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Upcoming

# v0.4.34

### Fixes

* Fixed `--modules` flag in `nwbinspector` command line interface to allow for import of additional modules in the command line. This was necessary to be able to register new customized checks to the NWB Inspector. [#446](https://github.com/NeurodataWithoutBorders/nwbinspector/pull/446)

# v0.4.33

### Fixes
Expand Down Expand Up @@ -185,7 +191,7 @@
# v0.4.14

### Fixes
* Fixed an error with attribute retrieval specific to the `cell_id` of the `IntracellularElectrode` neurodata type that occured with respect to older versions of PyNWB. [PR #264](https://github.com/NeurodataWithoutBorders/nwbinspector/pull/264)
* Fixed an error with attribute retrieval specific to the `cell_id` of the `IntracellularElectrode` neurodata type that occurred with respect to older versions of PyNWB. [PR #264](https://github.com/NeurodataWithoutBorders/nwbinspector/pull/264)



Expand Down
2 changes: 1 addition & 1 deletion docs/best_practices/best_practices_index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ and its ecosystem of software tools.

To enable NWB to accommodate the needs of the diverse neuroscience community, NWB provides a great degree of flexibility.
In particular, the number of instances of a particular neurodata_type and corresponding names are often not fixed, to enable,
e.g., storage of data from arbitrary numbers of devices withing the same file. While this flexibility is essential to enable
e.g., storage of data from arbitrary numbers of devices within the same file. While this flexibility is essential to enable
coverage of a broad range of use-cases, it can also lead to ambiguity. At the same time, we ultimately have the desire to have
the schema as strict-as-possible to provide users and tool builders with a consistent organization of data. As such, we need to
strike a fine balance between flexibility to enable support for varying experiments and use-cases and strictness in the schema
Expand Down
6 changes: 6 additions & 0 deletions docs/best_practices/ecephys.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ For relative position of an electrode on a probe, use ``rel_x``, ``rel_y``, and
that are close enough to share a neuron.


Avoid Duplication of Metadata
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The ``ElectrodeTable`` should not contain redundant information that is present somewhere else within the :ref:`nwb-schema:sec-NWBFile` . Avoid adding columns to the `ElectrodeTable` that correspond to properties of the :ref:`nwb-schema:sec-ElectricalSeries` such as ``unit``, ``offsets`` or ``channel gains`` These properties should be stored in the corresponding attributes of the :ref:`nwb-schema:sec-ElectricalSeries` object.

As a concrete example, the package objects from the `SpikeInterface <https://spikeinterface.readthedocs.io/en/latest/>`__ package contain two properties named ``gain_to_uv`` and ``offset_to_uv`` that are used to convert the raw data to microvolts. These properties should not be stored in the `ElectrodeTable` but rather in the ``ElectricalSeries`` object as ``channel_conversion`` and ``offset`` respectively.

Units Table
-----------
Expand Down
2 changes: 1 addition & 1 deletion docs/best_practices/extensions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Extend the core NWB schema only when necessary. Extensions are an essential mech
data with NWB that is otherwise not supported. However, we here need to consider that there are certain costs associated
with extensions, *e.g.*, cost of creating, supporting, documenting, and maintaining new extensions and effort for users
to use and learn already-created extensions. As such, users should attempt to use core ``neurodata_types`` or
pre-existing extentions before creating new ones. :ref:`hdmf-schema:sec-dynamictable`, which are used throughout the
pre-existing extensions before creating new ones. :ref:`hdmf-schema:sec-dynamictable`, which are used throughout the
NWB schema to store information about time intervals, electrodes, or spiking output, provide the ability to
dynamically add columns without the need for extensions, and can help avoid the need for custom extensions in many
cases.
Expand Down
6 changes: 6 additions & 0 deletions docs/best_practices/general.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,9 @@ Empty Strings
Required free-text fields for neurodata types should not use placeholders such as empty strings (`""`), ``"no description"``, or ``"PLACEHOLDER"``. For example, the :py:attr:`description` field should always richly describe that particular neurodata type and its interpretation within the experiment.

Many attributes of neurodata types in NWB are optional details to include. It is not necessary, therefore, to use placeholders for these attributes. Instead, they should not be specified at all.


Avoid Duplication of Metadata
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Avoid duplication of metadata across different objects. If a piece of metadata is shared between multiple objects, consider creating a separate object to store that metadata and linking to it from the other objects. This will help to keep the metadata consistent and reduce the risk of errors when updating the metadata.
4 changes: 2 additions & 2 deletions docs/user_guide/using_the_command_line_interface.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ the most useful of these options.
Streaming
---------

If the NWB file(s) you wish to inspect are already on the :dandi-archive:`DANDI archive <>`, you can run the NWB Inspector directly on that DANDI set instead of having to download it. All that is needed is to specfy the DANDI set ID (six-digit identifier) as the path and add the ``--stream`` flag.
If the NWB file(s) you wish to inspect are already on the :dandi-archive:`DANDI archive <>`, you can run the NWB Inspector directly on that DANDI set instead of having to download it. All that is needed is to specify the DANDI set ID (six-digit identifier) as the path and add the ``--stream`` flag.

::

Expand Down Expand Up @@ -75,7 +75,7 @@ For example,
numbers like ``"0, 1"``.


The defalt report also aggregates identical outputs into a summary over multiple files; running
The default report also aggregates identical outputs into a summary over multiple files; running

::

Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,10 @@ extend-exclude = '''
|dist
)/
'''

[tool.codespell]
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
skip = '.git*,*.pdf,*.css'
check-hidden = true
# ignore-regex = ''
# ignore-words-list = ''
1 change: 1 addition & 0 deletions src/nwbinspector/nwbinspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ def inspect_all_cli(
DANDI archive (i.e., https://dandiarchive.org/dandiset/{dandiset_id}/{version_id}), or a six-digit Dandiset ID.
"""
levels = ["importance", "file_path"] if levels is None else levels.split(",")
modules = [] if modules is None else modules.split(",")
reverse = [False] * len(levels) if reverse is None else [strtobool(x) for x in reverse.split(",")]
progress_bar = strtobool(progress_bar) if progress_bar is not None else True
if config is not None:
Expand Down
2 changes: 1 addition & 1 deletion src/nwbinspector/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.4.34"
__version__ = "0.4.35"
3 changes: 2 additions & 1 deletion tests/test_inspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,8 @@ def test_command_line_runs_cli_only(self):
console_output_file = self.tempdir / "test_console_output.txt"
os.system(
f"nwbinspector {str(self.tempdir)} --overwrite --select check_timestamps_match_first_dimension,"
"check_data_orientation,check_regular_timestamps,check_small_dataset_compression"
"check_data_orientation,check_regular_timestamps,check_small_dataset_compression "
"--modules random,math,datetime"
f"> {console_output_file}"
)
self.assertLogFileContentsEqual(
Expand Down

0 comments on commit 9d58106

Please sign in to comment.