Skip to content

Commit

Permalink
update CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
mazabou committed Nov 4, 2024
1 parent 49da362 commit d3735b8
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 31 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Update workflow to use ubuntu-latest instances from github actions. ([#8](httpps://github.com/neuro-galaxy/torch_brain/pull/8))
- Simplify Dataset interface by removing the `include` dictionnary and allowing to directly load selection from a configuration file. ([#10](https://github.com/neuro-galaxy/torch_brain/pull/10))
- Sampling intervals are now represented as `Interval` objects. ([#11](https://github.com/neuro-galaxy/torch_brain/pull/11))
- `session_id` was being used for multiple purposes, and was not consistent with the data model.Replace `session_id` with `recording_id` where `recording_id` = `brainset/session`. ([#15](https://github.com/neuro-galaxy/torch_brain/pull/15))

### Fixed
62 changes: 31 additions & 31 deletions torch_brain/data/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,37 +369,37 @@ def get_session_ids(self):
r"""Returns the session ids of the dataset."""
return sorted(list(self.recording_dict.keys()))

def get_unit_ids(self):
r"""Returns the unit ids of the dataset."""
unit_ids = []
for recording_id in self._data_objects.keys():
data = copy.copy(self._data_objects[recording_id])

supported_formats = ["brainset/session/unit", "brainset/device/unit"]
unit_ids_format = self.recording_dict[recording_id]["config"].get(
"unit_ids_format", "brainset/session/unit"
)
if unit_ids_format == "brainset/session/unit":
unit_ids.extend(
[
f"{data.brainset.id}/{data.session.id}/{unit_id}"
for unit_id in data.units.id
]
)
elif unit_ids_format == "brainset/device/unit":
unit_ids.extend(
[
f"{data.brainset.id}/{data.device.id}/{unit_id}"
for unit_id in data.units.id
]
)
else:
raise ValueError(
f"unit_ids_format {unit_ids_format} is not supported. Supported formats are: {supported_formats}"
)

unit_ids = sorted(list(set(unit_ids)))
return unit_ids
# def get_unit_ids(self):
# r"""Returns the unit ids of the dataset."""
# unit_ids = []
# for recording_id in self._data_objects.keys():
# data = copy.copy(self._data_objects[recording_id])

# supported_formats = ["brainset/session/unit", "brainset/device/unit"]
# unit_ids_format = self.recording_dict[recording_id]["config"].get(
# "unit_ids_format", "brainset/session/unit"
# )
# if unit_ids_format == "brainset/session/unit":
# unit_ids.extend(
# [
# f"{data.brainset.id}/{data.session.id}/{unit_id}"
# for unit_id in data.units.id
# ]
# )
# elif unit_ids_format == "brainset/device/unit":
# unit_ids.extend(
# [
# f"{data.brainset.id}/{data.device.id}/{unit_id}"
# for unit_id in data.units.id
# ]
# )
# else:
# raise ValueError(
# f"unit_ids_format {unit_ids_format} is not supported. Supported formats are: {supported_formats}"
# )

# unit_ids = sorted(list(set(unit_ids)))
# return unit_ids

def get_unit_ids(self):
r"""Returns all unit ids in the dataset."""
Expand Down

0 comments on commit d3735b8

Please sign in to comment.