pynwb icon indicating copy to clipboard operation
pynwb copied to clipboard

Improve docval for IndexSeries init

Open rly opened this issue 6 months ago • 1 comments

Motivation

In coordination with https://github.com/NeurodataWithoutBorders/nwb-schema/pull/644

The goal is to not write resolution, conversion, and offset for IndexSeries.

This PR also updates IndexSeries.__init__ so that unit cannot be passed in, since the schema requires a fixed value of "N/A" and currently in PyNWB, passing any different value will result in an error. This change improves the usability -- users do not need to provide `unit="N/A" during construction.

WIP. Removing resolution, conversion, and offset for IndexSeries.__init__ does not work because when resolution=None is passed to TimeSeries.__init__, then resolution is set to the default value for resolution (-1) specified in TimeSeries.

How to test the behavior?

Show how to reproduce the new behavior (can be a bug fix or a new feature)

Checklist

  • [ ] Did you update CHANGELOG.md with your changes?
  • [ ] Have you checked our Contributing document?
  • [ ] Have you ensured the PR clearly describes the problem and the solution?
  • [ ] Is your contribution compliant with our coding style? This can be checked running ruff check . && codespell from the source directory.
  • [ ] Have you checked to ensure that there aren't other open Pull Requests for the same change?
  • [ ] Have you included the relevant issue number using "Fix #XXX" notation where XXX is the issue number? By including "Fix #XXX" you allow GitHub to close issue #XXX when the PR is merged.

rly avatar Jun 25 '25 23:06 rly

We will punt this to the schema 2.10 release.

rly avatar Jun 25 '25 23:06 rly