Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support nwb_version as a fixed-length string #1669

Merged
merged 4 commits into from
Mar 17, 2023
Merged

Conversation

oruebel
Copy link
Contributor

@oruebel oruebel commented Mar 16, 2023

Motivation

Fix #1668

In #1612 we added support to do version checks on NWB HDF5 files to improve error reporting. The new nwb_version function implictly assumed that the attribute was written as a variable-lenght string. This leads to errors for NWB files that may use fixed-length strings instead (see #1668 for detail). This PR updated the NWBHDF5IO.new_version property to make sure the resulting bytes object is being decoded to a string in case that the attribute was written as a fixed-length bytes.

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 flake8 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.

@oruebel oruebel requested review from mavaylon1 and rly March 16, 2023 23:56
@oruebel oruebel added the priority: high impacts proper operation or use of feature important to most users label Mar 16, 2023
@oruebel oruebel added this to the Next Release milestone Mar 16, 2023
@oruebel oruebel added the category: bug errors in the code or code behavior label Mar 16, 2023
@codecov
Copy link

codecov bot commented Mar 16, 2023

Codecov Report

Merging #1669 (65aebc4) into dev (bdb94a7) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##              dev    #1669   +/-   ##
=======================================
  Coverage   91.99%   91.99%           
=======================================
  Files          26       26           
  Lines        2585     2587    +2     
  Branches      496      497    +1     
=======================================
+ Hits         2378     2380    +2     
  Misses        132      132           
  Partials       75       75           
Flag Coverage Δ
integration 71.55% <100.00%> (+0.02%) ⬆️
unit 83.61% <0.00%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/pynwb/__init__.py 78.94% <100.00%> (+0.28%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

src/pynwb/__init__.py Outdated Show resolved Hide resolved
@oruebel oruebel merged commit 3e16eb3 into dev Mar 17, 2023
@oruebel oruebel deleted the fix/nwbversion_fixed_string branch March 17, 2023 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: bug errors in the code or code behavior priority: high impacts proper operation or use of feature important to most users
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Error on parsing nwb_version attribute
2 participants