Skip to content

Commit

Permalink
Rename property for clarity and consistency
Browse files Browse the repository at this point in the history
- returned objects are not standard data asset models
  • Loading branch information
bjhardcastle committed Oct 17, 2024
1 parent 461e8ef commit fc2f232
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ dict_keys(['_id', 'acquisition', 'created', 'data_description', 'describedBy', '
# Additional functionality in namespace extensions:
>>> session.ecephys.is_sorted
True
>>> session.ecephys.sorter.kilosort2_5.data_assets[-1].name
>>> session.ecephys.sorter.kilosort2_5.sorted_data_assets[-1].name
'ecephys_676909_2023-12-13_13-43-40_sorted_2024-03-01_16-02-45'

# Objects refer to the original session, regardless of how they were created:
Expand Down
14 changes: 7 additions & 7 deletions src/aind_session/extensions/ecephys.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ class EcephysExtension(aind_session.extension.ExtensionBaseClass):
'ecephys_676909_2023-12-13_13-43-40_sorted_2023-12-17_03-16-51'
Access subsets of data assets by sorter name:
>>> session.ecephys.sorter.kilosort2_5.data_assets[0].id
>>> session.ecephys.sorter.kilosort2_5.sorted_data_assets[0].id
'1e11bdf5-b452-4fd9-bbb1-48383a9b0842'
>>> session.ecephys.sorter.kilosort2_5.data_assets[0].name
>>> session.ecephys.sorter.kilosort2_5.sorted_data_assets[0].name
'ecephys_676909_2023-12-13_13-43-40_sorted_2023-12-17_03-16-51'
Returned models are enhanced with sorting pipeline-related properties:
Expand Down Expand Up @@ -399,23 +399,23 @@ def __init__(self, ecephys: EcephysExtension, sorter_name: str) -> None:
self._sorter_name = sorter_name

@property
def data_assets(self) -> tuple[EcephysExtension.SortedDataAsset, ...]:
def sorted_data_assets(self) -> tuple[EcephysExtension.SortedDataAsset, ...]:
"""All data assets produced using the given SpikeInterface `sorter_name`
associated with the session (may be empty).
Examples
--------
>>> session = aind_session.Session('ecephys_676909_2023-12-13_13-43-40')
>>> session.ecephys.sorted_data_assets[0].id
>>> session.ecephys.sorter.kilosort2_5.sorted_data_assets[0].id
'1e11bdf5-b452-4fd9-bbb1-48383a9b0842'
>>> session.ecephys.sorted_data_assets[0].name
>>> session.ecephys.sorter.kilosort2_5.sorted_data_assets[0].name
'ecephys_676909_2023-12-13_13-43-40_sorted_2023-12-17_03-16-51'
>>> session.ecephys.sorted_data_assets[0].created
>>> session.ecephys.sorter.kilosort2_5.sorted_data_assets[0].created
1702783011
Empty if no sorted data assets are found:
>>> session = aind_session.Session('ecephys_676909_2023-12-13_13-43-39')
>>> session.ecephys.sorted_data_assets
>>> session.ecephys.sorter.kilosort2_5.sorted_data_assets
()
"""
with concurrent.futures.ThreadPoolExecutor() as executor:
Expand Down

0 comments on commit fc2f232

Please sign in to comment.