Repository navigation
Add read_signals as a structured signal reader - #798
Conversation
tompollard
left a comment
There was a problem hiding this comment.
Thanks. The wrapper passes every option through, and the signatures and defaults currently match. The offline suite, Ruff and the strict docs build pass locally.
My main concern is the design. read_signal_values came out in 5.10.0 today, and the docs describe it as provisional while the #672 naming is settled. Adding read_signals alongside it leaves two public names for one function, and every docs passage now has to mention both. Removing one later would need a deprecation cycle. Since we removed warn_empty from the new readers for the same reason, could we do the same here: rename read_signal_values to read_signals, and note in the changelog that the old name was available briefly in 5.10.0? If you'd prefer to be cautious, a thin alias that emits DeprecationWarning would also work, but I'd avoid two equal names.
Either way, the full copy of the signature and docstring should go. The copies have already drifted (path is "str or os.PathLike" in read_signals and "str" in read_signal_values), and every future parameter would need adding twice. After a rename, the docs edits also become simpler: one name instead of "read_signals and read_signal_values" in five places.
|
Agreed. I changed I kept |
tompollard
left a comment
There was a problem hiding this comment.
Thanks, this is much cleaner. read_signals is now the single implementation with one docstring, nothing in the package or docs calls the old name (the remaining mentions are the 5.10.0 entries in docs/changes.rst, which should stay), and the suite passes with the package's own DeprecationWarnings treated as errors. The offline suite, Ruff and the strict docs build pass locally.
On reflection, let's remove read_signal_values rather than deprecate it, as we did for warn_empty. It has been public for about a day, the docs marked it provisional, and a deprecated alias would stay in the namespace until the next major release. Could you:
- delete the alias from
record.pyand from the exports inwfdb/__init__.pyandwfdb/io/__init__.py, so the old name raises the usualAttributeErrororImportError; - replace
test_deprecated_signal_values_aliaswith a test thatwfdb.read_signal_valuesno longer exists, keeping theread_signalsresult checks; - change the changelog from "remains as a deprecated alias" to say
read_signal_valueswas renamed toread_signalsand was available only in 5.10.0.
|
Agreed. I removed The changelog now says the provisional name was available only in 5.10.0. The full offline suite passes (1,218 passed), as do Ruff and the strict docs build. I updated the PR description to match. |
Summary
Rename the structured signal reader to
read_signals. It returns the existingSignalReadresult with explicit uniform or expanded layout, values, logical metadata, and source segment provenance. The provisionalread_signal_valuesname was available only in 5.10.0 and is removed. Legacyrdsampkeeps its tuple return.Document
read_signals, migrate the tests to it, and add a changelog entry for the planned 5.11.0 release.Checks
Related to #376 and #672.