Skip to content

Commit 7b2bdb4

Browse files
authored
Fix tests for upgraded dependencies (#184)
1 parent 08e82ff commit 7b2bdb4

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

cebra/datasets/monkey_reaching.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,12 @@ def _load_data(
7777
"Could not import the nlb_tools package required for data loading "
7878
"the raw reaching datasets in NWB format. "
7979
"If required, you can install the dataset by running "
80-
"pip install nlb_tools or installing cebra with the [datasets] "
81-
"dependencies: pip install 'cebra[datasets]'")
80+
"pip install nlb_tools."
81+
# NOTE(stes): Install nlb_tools manually for now, also see
82+
# note in setup.cfg
83+
# or installing cebra with the [datasets] "
84+
#"dependencies: pip install 'cebra[datasets]'")
85+
)
8286

8387
def _get_info(trial_info, data):
8488
passive = []

cebra/integrations/plotly.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def _convert_cmap2colorscale(cmap: str, pl_entries: int = 11, rdigits: int = 2):
4545
"""
4646
scale = np.linspace(0, 1, pl_entries)
4747
colors = (cmap(scale)[:, :3] * 255).astype(np.uint8)
48-
pl_colorscale = [[round(s, rdigits), f"rgb{tuple(color)}"]
48+
pl_colorscale = [[float(round(s, rdigits)), f"rgb{tuple(color.tolist())}"]
4949
for s, color in zip(scale, colors)]
5050
return pl_colorscale
5151

setup.cfg

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ where =
3131
python_requires = >=3.9
3232
install_requires =
3333
joblib
34+
numpy<2.0.0
3435
literate-dataclasses
3536
scikit-learn
3637
scipy
@@ -44,7 +45,13 @@ datasets =
4445
# cebra.datasets.allen
4546
h5py
4647
pandas
47-
nlb_tools
48+
# NOTE(stes): nlb_tools currently pins pandas to <1.3.4, see here:
49+
# https://github.com/neurallatents/nlb_tools/blob/1ddc15f45b56388ff093d1396b7b87b36fa32a68/requirements.txt#L1
50+
# Since this is a fairly old pandas version, it causes additional version
51+
# conflicts with other packages. Removing nlb_tools as a required dependency for now.
52+
# The only part this package is needed is in cebra/datasets/monkey_reaching.py, where
53+
# we added a warning message to tell the user how to manually install it.
54+
#nlb_tools
4855
# additional data loading dependencies
4956
hdf5storage # for creating .mat files in new format
5057
openpyxl # for excel file format loading

0 commit comments

Comments
 (0)