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

Fix to_hierarchical_dataframe with VectorIndex data columns #666

Merged
merged 8 commits into from
Nov 23, 2021

Conversation

oruebel
Copy link
Contributor

@oruebel oruebel commented Aug 23, 2021

Motivation

Fix #665

Add check in to_hierarchical_dataframe to convert list and np.ndarray objects in the index to tuples. Since list and np.ndarray are not hashable this leads to a TypeError when creating the pandas.MultiIndex. By converting these items to tuples we can avoid this problem. This issue occurs if a hierarchical table contains VectorIndex columns as part of regular data columns, rather than indexed DynamicTableRegion columns which are resolved separately.

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 a review from rly August 23, 2021 07:33
@codecov
Copy link

codecov bot commented Aug 23, 2021

Codecov Report

Merging #666 (e2e950b) into dev (56851ed) will increase coverage by 0.11%.
The diff coverage is 100.00%.

❗ Current head e2e950b differs from pull request most recent head 2a99016. Consider uploading reports for the commit 2a99016 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #666      +/-   ##
==========================================
+ Coverage   86.44%   86.55%   +0.11%     
==========================================
  Files          42       42              
  Lines        8562     8484      -78     
  Branches     1850     1847       -3     
==========================================
- Hits         7401     7343      -58     
+ Misses        832      806      -26     
- Partials      329      335       +6     
Impacted Files Coverage Δ
src/hdmf/common/hierarchicaltable.py 100.00% <100.00%> (ø)
src/hdmf/build/objectmapper.py 91.87% <0.00%> (-0.50%) ⬇️
src/hdmf/container.py 89.98% <0.00%> (-0.06%) ⬇️
src/hdmf/data_utils.py 88.92% <0.00%> (-0.04%) ⬇️
src/hdmf/backends/hdf5/h5tools.py 82.05% <0.00%> (-0.02%) ⬇️
src/hdmf/utils.py 96.44% <0.00%> (-0.02%) ⬇️
src/hdmf/spec/namespace.py 87.57% <0.00%> (ø)
src/hdmf/common/__init__.py 75.83% <0.00%> (ø)
src/hdmf/common/resources.py 89.77% <0.00%> (+6.24%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 56851ed...2a99016. Read the comment docs.

@oruebel oruebel merged commit e5f7237 into dev Nov 23, 2021
@oruebel oruebel deleted the fix/to_hdf_with_vectorindex branch November 23, 2021 00:26
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.

Indexed column breaks generation of icephys hierarchical dataframe
2 participants