From a1e5a320d42216c88f6b1cca1286096348da8636 Mon Sep 17 00:00:00 2001 From: Ryan Ly Date: Fri, 7 Feb 2025 11:11:45 -0800 Subject: [PATCH 1/4] Add DeprecationWarning to monitor.py --- src/hdmf/monitor.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/hdmf/monitor.py b/src/hdmf/monitor.py index 823ccf72d..c331b9efd 100644 --- a/src/hdmf/monitor.py +++ b/src/hdmf/monitor.py @@ -1,8 +1,16 @@ from abc import ABCMeta, abstractmethod +import warnings from .data_utils import AbstractDataChunkIterator, DataChunkIterator, DataChunk from .utils import docval, getargs +warnings.warn( + "The hdmf.monitor module is deprecated and will be removed in HDMF 5.0. If you are using this module, " + "please copy this module to your codebase or raise an issue in the HDMF repository: " + "https://github.com/hdmf-dev/hdmf/issues" + DeprecationWarning, +) + class NotYetExhausted(Exception): pass From a8264887a83946ff678f611fb2e114a2da558d57 Mon Sep 17 00:00:00 2001 From: rly Date: Fri, 7 Feb 2025 11:14:59 -0800 Subject: [PATCH 2/4] Fix syntax --- src/hdmf/monitor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hdmf/monitor.py b/src/hdmf/monitor.py index c331b9efd..9f8e7e0cc 100644 --- a/src/hdmf/monitor.py +++ b/src/hdmf/monitor.py @@ -7,7 +7,7 @@ warnings.warn( "The hdmf.monitor module is deprecated and will be removed in HDMF 5.0. If you are using this module, " "please copy this module to your codebase or raise an issue in the HDMF repository: " - "https://github.com/hdmf-dev/hdmf/issues" + "https://github.com/hdmf-dev/hdmf/issues", DeprecationWarning, ) From 536cf8941fa9c54fee26466cd8fd19df66767a79 Mon Sep 17 00:00:00 2001 From: rly Date: Fri, 7 Feb 2025 11:20:22 -0800 Subject: [PATCH 3/4] Add warning test --- tests/unit/test_monitor.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 tests/unit/test_monitor.py diff --git a/tests/unit/test_monitor.py b/tests/unit/test_monitor.py new file mode 100644 index 000000000..f9af06a9c --- /dev/null +++ b/tests/unit/test_monitor.py @@ -0,0 +1,6 @@ +import pytest + + +def test_deprecation_warning(): + with pytest.warns(DeprecationWarning): + import hdmf.monitor # noqa: F401 From d79e113748deb43874b315f58ce958643f787b8e Mon Sep 17 00:00:00 2001 From: rly Date: Fri, 7 Feb 2025 11:25:09 -0800 Subject: [PATCH 4/4] Update changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e3f480c8..4462ff604 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # HDMF Changelog +## [Unreleased] + +### Changed +- `hdmf.monitor` is unused and undocumented. It has been deprecated and will be removed in HDMF 5.0. @rly [#1245](https://github.com/hdmf-dev/hdmf/pull/1245) + ## HDMF 4.0.0 (January 22, 2025) ### Breaking changes