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

Fixed some issues with channel names #8

Merged
merged 2 commits into from
May 22, 2017
Merged

Fixed some issues with channel names #8

merged 2 commits into from
May 22, 2017

Conversation

morbult
Copy link
Contributor

@morbult morbult commented May 20, 2017

Warnings are issued if there are douplicate channel names when accessing with data_file[channel_name] or when calling channel_dict().
For example, try the test file with data_file[''] and data_file.channel_dict(1).

The change at line 660 is so that data_file.channel_names and data_file.channel_name(g, c) give the same names. Before data_file.channel_names had 'None' for missing channel names, now it's ''.

The change in getitem is to make data_file[''] work. Now I use the dict _name_to_indices instead of channel_search() to map from channel name to group and channel inidices.

Warnings are issued if there are douplicate channel names when accessing with data_file[channel_name] or when calling channel_dict().
For example, try the test file with data_file[''] and data_file.channel_dict(1).

The change at line 660 is so that data_file.channel_names and data_file.channel_name(g, c) give the same names. Before data_file.channel_names had 'None' for missing channel names, now it's ''.

The change in __getitem__ is to make data_file[''] work. Now I use the dict _name_to_indices instead of channel_search() to map from channel name to group and channel inidices.
In several tdm files I've tested, there are more "block" tags than "tdm_channel" tags, which made `assert(len(blocks) == len(channel_names))` to fail. This might be i dirty fix to that problem, but I don't have a better idea right now.

What I noted with those tdm file was that the few extra "block" tags are always the last ones, they always have valueType="eInt16Usi", and their id is always linked to a "flags" tag instead of a "double_sequence" or "long_sequence" tag.
@domna domna merged commit 32db953 into domna:dev May 22, 2017
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.

2 participants