Skip to content

Conversation

@t-b
Copy link
Collaborator

@t-b t-b commented Aug 19, 2025

@t-b t-b self-assigned this Aug 19, 2025
@t-b t-b force-pushed the fix-and-silence-warnings branch 3 times, most recently from eddfe48 to 9a9929f Compare August 27, 2025 13:48
@t-b t-b mentioned this pull request Aug 27, 2025
3 tasks
t-b added 12 commits September 7, 2025 12:33
This fixes the warning:

  /home/thomas/devel/ipfx/ipfx/bin/make_stimulus_ontology.py:26: DeprecationWarning: invalid escape sequence \d
    m = re.search("(.*)\d{6}$", scode)
The whole purpose of the tests is to trigger that case.
This avoids warnings. The additional dependency is already required by
pynwb.
This ignores the following and similiar warnings:

tests/dataset/test_mies_nwb_data.py: 2 warnings
  /home/thomas/.venvs/ipfx-3.9/lib/python3.9/site-packages/hdmf/build/objectmapper.py:267: DtypeConversionWarning: Spec 'CurrentClampSeries/sweep_number': Value with data type int64 is being converted to data type uint64 (min specification: uint32).
    warnings.warn(full_warning_msg, DtypeConversionWarning)

tests/attach_metadata/test_nwb2_sink.py: 10 warnings
tests/dataset/test_ephys_nwb_data.py: 6 warnings
tests/dataset/test_hbg_nwb_data.py: 3 warnings
tests/dataset/test_mies_nwb_data.py: 2 warnings
  /home/thomas/.venvs/ipfx-3.9/lib/python3.9/site-packages/hdmf/build/objectmapper.py:267: DtypeConversionWarning: Spec 'SweepTable/sweep_number': Value with data type int64 is being converted to data type uint64 (min specification: uint32).
    warnings.warn(full_warning_msg, DtypeConversionWarning)

tests/dataset/test_ephys_nwb_data.py: 6 warnings
tests/dataset/test_hbg_nwb_data.py: 3 warnings
tests/dataset/test_mies_nwb_data.py: 2 warnings
  /home/thomas/.venvs/ipfx-3.9/lib/python3.9/site-packages/hdmf/build/objectmapper.py:267: DtypeConversionWarning: Spec 'CurrentClampStimulusSeries/sweep_number': Value with data type int64 is being converted to data type uint64 (min specification: uint32).
    warnings.warn(full_warning_msg, DtypeConversionWarning)

Both int64 and uint64 are big enough for our number of sweeps. In addition
this test is using existing files so even fixing/upgrading IPNWB would not
solve the issue.
This fixes the following warnings:

  /home/thomas/.venvs/ipfx-3.9/lib/python3.9/site-packages/pynwb/base.py:87: DeprecationWarning: get_data_interface is deprecated and will be removed in PyNWB 4.0. Use get instead.
    warn('get_data_interface is deprecated and will be removed in PyNWB 4.0. Use get instead.', DeprecationWarning)

tests/test_mies_nwb_pipeline_output.py: 127 warnings
  /home/thomas/.venvs/ipfx-3.9/lib/python3.9/site-packages/pynwb/base.py:82: DeprecationWarning: add_data_interface is deprecated and will be removed in PyNWB 4.0. Use add instead.
    warn('add_data_interface is deprecated and will be removed in PyNWB 4.0. Use add instead.', DeprecationWarning)
pynwb 3.1.2 does currently always output a warning about a missing .nwb
ending in path even if path was not passed at all and is None.

This will be fixed in [1], ignore the warning until we require that
version.

We also drop the path argument to NWBHDF5IO as that is not needed.

[1]: NeurodataWithoutBorders/pynwb#2130
…_filtering

This test uses existing files so even fixing/upgrading IPNWB would not
solve the issue.
…ering

This test uses existing files so even fixing/upgrading IPNWB would not
solve the issue.
@t-b t-b force-pushed the fix-and-silence-warnings branch from 9a9929f to 05c14d1 Compare September 7, 2025 10:34
@t-b t-b requested a review from gouwens September 7, 2025 10:34
@t-b t-b assigned gouwens and unassigned t-b Sep 7, 2025
@t-b t-b marked this pull request as ready for review September 7, 2025 10:35
@t-b
Copy link
Collaborator Author

t-b commented Sep 9, 2025

@gouwens Ready for review!

Copy link
Collaborator

@gouwens gouwens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It all looks good to me. I realized there was a way to avoid triggering one of the warnings by filtering out bad points first in the dv/dt calculation, so I fixed the underlying code and removed the filter (and pushed the commit).

@t-b
Copy link
Collaborator Author

t-b commented Sep 10, 2025

It all looks good to me. I realized there was a way to avoid triggering one of the warnings by filtering out bad points first in the dv/dt calculation, so I fixed the underlying code and removed the filter (and pushed the commit).

Perfect. That's even better than ignoring the warning.

@t-b t-b merged commit 745e4a3 into master Sep 10, 2025
12 checks passed
@t-b t-b deleted the fix-and-silence-warnings branch September 10, 2025 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix easy warnings in tests and ignore the rest

3 participants