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

[enum] Add lower() to linktype in lt setter and fe creation to support old strings #400

Merged
merged 1 commit into from May 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions nixio/feature.py
Expand Up @@ -34,6 +34,8 @@ def link_type(self):

@link_type.setter
def link_type(self, lt):
if isinstance(lt, string_types):
lt = lt.lower()
lt = LinkType(lt)
self._h5group.set_attr("link_type", lt.value)
if self._parent._parent._parent.time_auto_update:
Expand Down
3 changes: 3 additions & 0 deletions nixio/tag.py
Expand Up @@ -9,6 +9,7 @@
import warnings

import numpy as np
from six import string_types

from .entity import Entity
from .source_link_container import SourceLinkContainer
Expand Down Expand Up @@ -98,6 +99,8 @@ def create_feature(self, data, link_type):
:returns: The created feature object.
:rtype: Feature
"""
if isinstance(link_type, string_types):
link_type = link_type.lower()
link_type = LinkType(link_type)
features = self._h5group.open_group("features")
feat = Feature._create_new(self, features, data, link_type)
Expand Down