Skip to content

Commit

Permalink
Document ability to use in keyword with TdmsFile and TdmsGroup (#325)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamreeve authored Jan 26, 2024
1 parent 47d9d8c commit 67436d7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions nptdms/tdms.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ class TdmsFile(object):
tdms_file = TdmsFile.read(tdms_file_path)
group = tdms_file[group_name]
And you can check for the presence of a group with the ``in`` keyword::
contains_group = group_name in tdms_file
Iterating over a TdmsFile produces the names of groups in this file,
or you can use the groups method to directly access all groups::
Expand Down Expand Up @@ -347,6 +351,10 @@ class TdmsGroup(object):
channel = group[channel_name]
And you can check for the presence of a channel with the ``in`` keyword::
contains_channel = channel_name in group
Iterating over a TdmsGroup produces the names of channels in this group,
or you can use the channels method to directly access all channels::
Expand Down

0 comments on commit 67436d7

Please sign in to comment.