Skip to content

Commit

Permalink
Add new atlas (#133)
Browse files Browse the repository at this point in the history
* Add new atlas

* update pre-commit

* require explicit use of Optional

* update tox

* update tox
  • Loading branch information
adamltyson authored Jan 6, 2023
1 parent 5835887 commit dbecd16
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 28 deletions.
9 changes: 5 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,18 @@ repos:
# bump2version produces whitespace in setup.cfg, so exclude to
# not inferfere with versioning
exclude: setup.cfg
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
- repo: https://github.com/pycqa/flake8
rev: 5.0.4
hooks:
- id: flake8
- repo: https://github.com/psf/black
rev: 22.3.0
rev: 22.10.0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.961
rev: v0.990
hooks:
- id: mypy
additional_dependencies:
- types-setuptools
- types-requests
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ A number of atlases are in development, but those available currently are:
* [Waxholm Space atlas of the Sprague Dawley rat brain](https://doi.org/10.1016/j.neuroimage.2014.04.001) at 39 micron resolution
* [3D Edge-Aware Refined Atlases Derived from the Allen Developing Mouse Brain Atlases](https://doi.org/10.7554/eLife.61408) (E13, E15, E18, P4, P14, P28 & P56)
* [Princeton Mouse Brain Atlas](https://brainmaps.princeton.edu/2020/09/princeton-mouse-brain-atlas-links) at 20 micron resolution
* [Kim Lab Developmental CCF (P56)](https://data.mendeley.com/datasets/2svx788ddf/1) at 10 micron resolution with 8 reference images - STP, LSFM (iDISCO) and MRI (a0, adc, dwo, fa, MTR, T2)

## Installation
BG-AtlasAPI works with Python >3.6, and can be installed from PyPI with:
Expand Down
6 changes: 4 additions & 2 deletions bg_atlasapi/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import configparser
import json
import logging
from typing import Callable
from typing import Callable, Optional

import requests
import tifffile
Expand Down Expand Up @@ -130,7 +130,9 @@ def check_internet_connection(


def retrieve_over_http(
url, output_file_path, fn_update: Callable[[int, int], None] = None
url,
output_file_path,
fn_update: Optional[Callable[[int, int], None]] = None,
):
"""Download file from remote location, with progress bar.
Expand Down
3 changes: 0 additions & 3 deletions tests/test_list_atlases.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ def test_get_downloaded_atlases():
# Check that example is listed:
assert "example_mouse_100um" in available_atlases

# Check that all listed ar valid atlas names:
assert all([len(a.split("_")) == 3 for a in available_atlases])


def test_get_local_atlas_version():
v = get_local_atlas_version("example_mouse_100um")
Expand Down
23 changes: 4 additions & 19 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,30 +1,15 @@
# For more information about tox, see https://tox.readthedocs.io/en/latest/
[tox]
envlist = py{38,39,310}-{linux,windows}
envlist = py{37,38,39,310}

[gh-actions]
python =
3.7: py37
3.8: py38
3.9: py39
3.10: py310

[gh-actions:env]
PLATFORM =
ubuntu-latest: linux
windows-latest: windows

[testenv]
platform =
macos: darwin
linux: linux
windows: win32
passenv =
CI
GITHUB_ACTIONS
DISPLAY XAUTHORITY
NUMPY_EXPERIMENTAL_ARRAY_FUNCTION
PYVISTA_OFF_SCREEN
deps =
pytest # https://docs.pytest.org/en/latest/contents.html
pytest-cov # https://pytest-cov.readthedocs.io/en/latest/
extras =
dev
commands = pytest -v --color=yes --cov=bg_atlasapi --cov-report=xml

0 comments on commit dbecd16

Please sign in to comment.