Skip to content

Commit

Permalink
more ruff happiness
Browse files Browse the repository at this point in the history
  • Loading branch information
grg2rsr committed Dec 4, 2024
1 parent 8af0428 commit 376d091
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/iblphotometry/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,15 @@ def from_raw_neurophotometrics_file_to_ibl_df(

return df


def from_raw_neurophotometrics_file(
path: str | Path,
drop_first=True,
validate=True,
) -> dict:
df = from_raw_neurophotometrics_file_to_ibl_df(path, drop_first=drop_first, validate=validate)
df = from_raw_neurophotometrics_file_to_ibl_df(
path, drop_first=drop_first, validate=validate
)
data_columns = [col for col in df.columns if col.startswith('G')]
read_config = dict(
data_columns=data_columns,
Expand Down
11 changes: 7 additions & 4 deletions src/iblphotometry_tests/test_loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,20 @@ def test_from_array(self):
# for neurophotometrics hardware
def test_from_raw_neurophotometrics_file(self):
# the single direct version
raw_dfs_a = fpio.from_raw_neurophotometrics_file(self.paths['raw_neurophotometrics_csv'])

raw_dfs_a = fpio.from_raw_neurophotometrics_file(
self.paths['raw_neurophotometrics_csv']
)

# the chained version
df = fpio.from_raw_neurophotometrics_file_to_ibl_df(self.paths['raw_neurophotometrics_csv'])
df = fpio.from_raw_neurophotometrics_file_to_ibl_df(
self.paths['raw_neurophotometrics_csv']
)
raw_dfs_b = fpio.from_ibl_dataframe(df)

# check if they are the same
assert raw_dfs_a.keys() == raw_dfs_b.keys()
for key in raw_dfs_a.keys():
pd.testing.assert_frame_equal(raw_dfs_a[key], raw_dfs_b[key])


# from pqt files as they are returned from ONE by .load_dataset()
def test_from_ibl_pqt(self):
Expand Down

0 comments on commit 376d091

Please sign in to comment.