Skip to content

Commit

Permalink
accept np.ndarray as index (#407)
Browse files Browse the repository at this point in the history
  • Loading branch information
njzjz authored Jan 12, 2023
1 parent e6cbaab commit cfc9fd4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dpdata/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def __str__(self):

def __getitem__(self, key):
"""Returns proerty stored in System by key or by idx"""
if isinstance(key, (int, slice, list)):
if isinstance(key, (int, slice, list, np.ndarray)):
return self.sub_system(key)
return self.data[key]

Expand Down

0 comments on commit cfc9fd4

Please sign in to comment.