oruebel / ndx-icephys-meta

NWB extensions for origanizing intracellular electrophysiology metadata
Other
6 stars 0 forks source link

Latest tests fail #77

Closed rly closed 3 years ago

rly commented 3 years ago

Using PyNWB 1.4.0 and HDMF 2.2.0, tests fail:

============================================================== short test summary info ============================================================== FAILED src/pynwb/ndx_icephys_meta/test/test_aligned_dynamic_table_container.py::TestAlignedDynamicTableContainer::test_to_dataframe - AttributeErro...

FAILED src/pynwb/ndx_icephys_meta/test/test_hierarchical_dynamic_table_mixin.py::TestHierarchicalDynamicTableMixin::test_to_denormalized_dataframe
FAILED src/pynwb/ndx_icephys_meta/test/test_hierarchical_dynamic_table_mixin.py::TestHierarchicalDynamicTableMixin::test_to_denormalized_dataframe_flat_column_index
FAILED src/pynwb/ndx_icephys_meta/test/test_hierarchical_dynamic_table_mixin.py::TestHierarchicalDynamicTableMixin::test_to_hierarchical_dataframe
FAILED src/pynwb/ndx_icephys_meta/test/test_hierarchical_dynamic_table_mixin.py::TestHierarchicalDynamicTableMixin::test_to_hierarchical_dataframe_flat_column_index
FAILED src/pynwb/ndx_icephys_meta/test/test_icephys.py::IntracellularRecordingsTableTests::test_add_row - ValueError: Shape of passed values is (3,...

FAILED src/pynwb/ndx_icephys_meta/test/test_icephys.py::IntracellularRecordingsTableTests::test_add_row_no_response - ValueError: Shape of passed v...

FAILED src/pynwb/ndx_icephys_meta/test/test_icephys.py::IntracellularRecordingsTableTests::test_add_row_no_stimulus - ValueError: Shape of passed v...

FAILED src/pynwb/ndx_icephys_meta/test/test_icephys.py::IntracellularRecordingsTableTests::test_round_trip_container_no_data - AssertionError: Data...

FAILED src/pynwb/ndx_icephys_meta/test/test_icephys.py::ICEphysFileTests::test_add_icephys_meta_full_roundtrip - ValueError: Shape of passed values...

Looks related to conversion to Pandas data frames.

rly commented 3 years ago

In the first failing test above: python -m unittest test_hierarchical_dynamic_table_mixin.TestHierarchicalDynamicTableMixin.test_to_denormalized_dataframe TypeError: unhashable type: 'list'

curr = self.table_level1.to_denormalized_dataframe(flat_column_index=False)
ref = pandas.read_hdf(path_or_buf=ref_filename,
                      key='test_to_denormalized_dataframe_table_level1')
pandas.testing.assert_frame_equal(curr, ref)

(Pdb) curr
source_table level1                           level0                     t    m
label            id   tag                tags     id                   ags  yid
0                 0  tag1        (tag1, tag2)     10                [tag1]    0
1                 0  tag1        (tag1, tag2)     11                [tag2]    1
2                 1  tag2        (tag2, tag1)     12        [[tag2, tag1]]  [2]
3                 2  tag2  (tag3, tag4, tag5)     13  [[tag3, tag4, tag5]]  [3]
(Pdb) ref
source_table level1                           level0                   t   m
label            id   tag                tags     id                 ags yid
0                 0  tag1        (tag1, tag2)     10              [tag1]   0
1                 0  tag1        (tag1, tag2)     11              [tag2]   1
2                 1  tag2        (tag2, tag1)     12        [tag2, tag1]   2
3                 2  tag2  (tag3, tag4, tag5)     13  [tag3, tag4, tag5]   3

I see two issues: 1) the names of the columns is incorrect 2) rows 2 and 3 of curr have lists of lists in the last two columns

@oruebel Do you have any ideas as to the root cause?

oruebel commented 3 years ago

Fixed in merge of the extension with PyNWB and HDMF