Skip to content

Commit

Permalink
Merge pull request #15 from int-brain-lab/0.5.5
Browse files Browse the repository at this point in the history
0.5.5
  • Loading branch information
oliche authored Nov 18, 2024
2 parents f3f2815 + 30ad1e6 commit f17d41c
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 15 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/iblatlas_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ jobs:
max-parallel: 4
matrix:
os: ["windows-latest", "ubuntu-latest"]
python-version: ["3.8", "3.11"]
python-version: ["3.10", "3.12"]
exclude:
- os: windows-latest
python-version: 3.8
python-version: 3.10
- os: ubuntu-latest
python-version: 3.11
python-version: 3.12
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pypi_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## [0.5.5]
### Modified
- removed instances of `np.NaN` to replace with `np.nan` for numpy 2.0 compatibility
- set python 3.10 as minimum python version

## [0.5.4]
### Modified
- `iblatlas.plots.plot_swanson_vector` option to show colorbar
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# iblatlas
Tools to manipulate hierarchical 3D representations of the mouse brain anatomy for electrophysiolgy experiments.
The tools are mainly using the the Allen CCF although some other atlases can be used.
The tools are mainly using the Allen CCF although some other atlases can be used.

**This repository uses minimal requirements, based of standard `matplotlib`, `numpy` and `scipy` libraries, to the exclusion
of more complex visualization tools such as `pyqt`.**
Expand Down
2 changes: 1 addition & 1 deletion iblatlas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,4 @@
.. [10] Allen Mouse Common Coordinate Framework Technical White Paper (October 2017 v3)
http://help.brain-map.org/download/attachments/8323525/Mouse_Common_Coordinate_Framework.pdf
"""
__version__ = '0.5.4'
__version__ = '0.5.5'
2 changes: 1 addition & 1 deletion iblatlas/atlas.py
Original file line number Diff line number Diff line change
Expand Up @@ -1493,7 +1493,7 @@ def compute_regions_volume(self, cumsum=False):
self.regions.volume = self.regions.volume * (self.res_um / 1e3) ** 3


def NeedlesAtlas(*args, **kwargs):
def NeedlesAtlas(*args, **kwargs) -> AllenAtlas:
"""
Instantiates an atlas.BrainAtlas corresponding to the Allen CCF at the given resolution
using the IBL Bregma and coordinate system. The Needles atlas defines a stretch along AP
Expand Down
4 changes: 2 additions & 2 deletions iblatlas/genomics/merfish_scrapping/01_ingest_zhuang.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def int_after_colon(text):
captured_integer = int(match.group(1))
return float(captured_integer)
else:
return np.NaN
return np.nan


def fcn_groupby_check_unique(df_cells, group, fields):
Expand Down Expand Up @@ -79,7 +79,7 @@ def reindex_missing_rows(df):
elif isinstance(missing_rec[k], int | np.uint32 | np.int32 | np.uint64 | np.int64):
missing_rec[k] = 0
elif isinstance(missing_rec[k], float | np.float32 | np.float64):
missing_rec[k] = np.NaN
missing_rec[k] = np.nan
df = df.reindex(pd.Index(np.arange(np.max(df.index) + 1), name=df.index.name), fill_value=0)
df.iloc[imiss, :] = missing_rec
return df
Expand Down
2 changes: 1 addition & 1 deletion iblatlas/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ def plot_swanson_vector(acronyms=None, values=None, ax=None, hemisphere=None, br
annotate_order='top', annotate_list=None, mask=None, mask_color='w', fontsize=10,
show_cbar=False, extend='neither', **kwargs):
"""
Function to plot scalar value per allen region on the swanson projection. Plots on a vecortised version of the
Function to plot scalar value per allen region on the swanson projection. Plots on a vectorised version of the
swanson projection
Parameters
Expand Down
2 changes: 1 addition & 1 deletion iblatlas/regions.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ def propagate_down(self, acronyms, values):
_, user_indices = ismember(user_aids, self.id)
self.compute_hierarchy()
ia, ib = ismember(self.hierarchy, user_indices)
v = np.zeros_like(ia, dtype=np.float64) * np.NaN
v = np.zeros_like(ia, dtype=np.float64) * np.nan
v[ia] = values[ib]
all_values = np.nanmedian(v, axis=0)
indices = np.where(np.any(ia, axis=0))[0]
Expand Down
6 changes: 3 additions & 3 deletions iblatlas/tests/test_atlas.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def test_rgba(self):

def test_get(self):
ctx = self.brs.get(688)
self.assertTrue(len(ctx.acronym) == 1 and ctx.acronym == 'CTX')
self.assertEqual('CTX', ctx.acronym)

def test_ancestors_descendants(self):
# here we use the same brain region as in the alyx test
Expand Down Expand Up @@ -527,7 +527,7 @@ def test_init_from_dict(self):

brain_atlas = _create_mock_atlas()
brain_atlas.compute_surface()
brain_atlas.top = brain_atlas.top * np.NaN
brain_atlas.top = brain_atlas.top * np.nan
ins = Insertion.from_dict(d, brain_atlas=brain_atlas)
# eval the entry point, should be super close
dxyz = ins.trajectory.eval_x(d['x'] / 1e6) - np.array((d['x'], d['y'], d['z'])) / 1e6
Expand Down Expand Up @@ -562,7 +562,7 @@ def test_init_from_track(self):
brain_exit = insertion.get_brain_exit(insertion.trajectory, brain_atlas)
self.assertTrue(brain_exit[2] == brain_atlas.bc.i2z(104))
# test getting no intersection with the brain surface
brain_atlas.srf_xyz *= np.NaN
brain_atlas.srf_xyz *= np.nan
with self.assertRaises(ValueError):
insertion.get_brain_entry(insertion.trajectory, brain_atlas)
self.assertIsNone(insertion.get_brain_entry(insertion.trajectory, brain_atlas, mode='none'))
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
name = "iblatlas"
description = "IBL atlas module"
readme = "README.md"
requires-python = ">=3.8"
requires-python = ">=3.10"
license = {file = "LICENSE"}
authors = [
{name = "IBL staff", email = "info@internationalbrainlab.org"},
Expand Down

0 comments on commit f17d41c

Please sign in to comment.