Skip to content

Commit

Permalink
Fix DynamicTable and DTR get function docstring (#650)
Browse files Browse the repository at this point in the history
  • Loading branch information
rly authored Jul 20, 2021
1 parent 5ce158a commit bf9cf01
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Bug fixes
- Do not build wheels compatible with Python 2 because HDMF requires Python 3.7. @rly (#642)
- Fix documentation for `DynamicTable.get` and `DynamicTableRegion.get`. @rly (#650)

## HDMF 3.0.1 (July 7, 2021)

Expand Down
17 changes: 12 additions & 5 deletions src/hdmf/common/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -805,8 +805,8 @@ def get(self, key, default=None, df=True, index=True, **kwargs):
:param key: Key defining which elements of the table to select. This may be one of the following:
1) string with the name of the column to select
2) a tuple consisting of (str, int) where the string identifies the column to select by name
and the int selects the row
2) a tuple consisting of (int, str) where the int selects the row and the string identifies the
column to select by name
3) int, list of ints, array, or slice selecting a set of full rows in the table. If an int is used, then
scalars are returned for each column that has a single value. If a list, array, or slice is used and
df=False, then lists are returned for each column, even if the list, array, or slice resolves to a
Expand Down Expand Up @@ -1127,12 +1127,19 @@ def get(self, arg, index=False, df=True, **kwargs):
"""
Subset the DynamicTableRegion
:param arg: 1) tuple consisting of (str, int) where the string defines the column to select
and the int selects the row, 2) int or slice to select a subset of rows
:param arg: Key defining which elements of the table to select. This may be one of the following:
1) a tuple consisting of (int, str) where the int selects the row and the string identifies the
column to select by name
3) int, list of ints, array, or slice selecting a set of full rows in the table. If an int is used, then
scalars are returned for each column that has a single value. If a list, array, or slice is used and
df=False, then lists are returned for each column, even if the list, array, or slice resolves to a
single row.
:param index: Boolean indicating whether to return indices of the DTR (default False)
:param df: Boolean indicating whether to return the result as a pandas DataFrame (default True)
:return: Result from self.table[....] with the appropriate selection based on the
:return: Result from self.table[...] with the appropriate selection based on the
rows selected by this DynamicTableRegion
"""
if not df and not index:
Expand Down

0 comments on commit bf9cf01

Please sign in to comment.