Skip to content

Commit

Permalink
Merge pull request #29 from brainglobe/fixing_tests
Browse files Browse the repository at this point in the history
Moved atlas_gen to separate package
  • Loading branch information
vigji committed Jun 1, 2020
2 parents c524330 + b355a9e commit 5df3a13
Show file tree
Hide file tree
Showing 26 changed files with 64 additions and 65 deletions.
53 changes: 22 additions & 31 deletions .travis.yml
Expand Up @@ -12,64 +12,43 @@ stages:
jobs:
include:
- stage: test
name: "Ubuntu Bionic python 3.6"
name: "Ubuntu Xenial python 3.6"
language: python
os: linux
env: MINICONDA_URL=http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
dist: bionic
dist: xenial
python: 3.6
before_install: source travis/install_unix.sh
script: bash travis/test.sh

- stage: test
name: "Ubuntu Bionic python 3.7"
language: python
os: linux
env: MINICONDA_URL=http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
dist: bionic
python: 3.7
before_install: source travis/install_unix.sh
script: bash travis/test.sh
- stage: test
name: "Ubuntu Xenial python 3.6"
name: "Ubuntu Xenial python 3.7"
language: python
os: linux
env: MINICONDA_URL=http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
dist: xenial
python: 3.6
python: 3.7
before_install: source travis/install_unix.sh
script: bash travis/test.sh

- stage: test
name: "Ubuntu Xenial python 3.7"
name: "Ubuntu Xenial python 3.8"
language: python
os: linux
env: MINICONDA_URL=http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
dist: xenial
python: 3.7
python: 3.8
before_install: source travis/install_unix.sh
script: bash travis/test.sh
- stage: test
name: "Windows Python 3.6"
language: shell
env: TRAVIS_PYTHON_VERSION=3.6
os: windows
before_install: source travis/install_windows.sh
script: bash travis/test.sh

- stage: test
name: "Windows Python 3.7"
language: shell
env: TRAVIS_PYTHON_VERSION=3.7
os: windows
before_install: source travis/install_windows.sh
script: bash travis/test.sh
- stage: test
name: "macOS Python 3.6"
os: osx
language: shell
env:
- TRAVIS_PYTHON_VERSION=3.6
- MINICONDA_URL=https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
before_install: source travis/install_unix.sh
script: bash travis/test.sh

- stage: test
name: "macOS Python 3.7"
os: osx
Expand All @@ -79,6 +58,18 @@ jobs:
- MINICONDA_URL=https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
before_install: source travis/install_unix.sh
script: bash travis/test.sh

- stage: test
name: "Lint"
language: python
os: linux
env: MINICONDA_URL=http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
dist: xenial
python: 3.7
before_install: source travis/install_unix.sh
script: bash travis/lint.sh


- stage: deploy
os: bionic
name: "Deploy Linux"
Expand Down
3 changes: 3 additions & 0 deletions MANIFEST.in
@@ -0,0 +1,3 @@
include LICENSE
include README.md
include requirements.txt
1 change: 1 addition & 0 deletions atlas_gen/__init__.py
@@ -0,0 +1 @@
from atlas_gen import mesh_utils
File renamed without changes.
File renamed without changes.
Expand Up @@ -7,12 +7,9 @@
import json
import shutil

from brainatlas_api.atlas_gen import (
save_anatomy,
save_annotation,
descriptors,
wrapup_atlas_from_dir,
)
from atlas_gen.stacks import save_anatomy, save_annotation
from atlas_gen.wrapup import wrapup_atlas_from_dir
from brainatlas_api import descriptors

# Specify information about the atlas:
RES_UM = 100
Expand Down
@@ -1,4 +1,7 @@
from fishatlas_utils import add_path_inplace, collect_all_inplace
from atlas_gen.atlas_scripts.fishatlas_utils import (
add_path_inplace,
collect_all_inplace,
)

from pathlib import Path
import tempfile
Expand Down
File renamed without changes.
Expand Up @@ -12,12 +12,12 @@
from brainatlas_api.atlas_gen import (
save_anatomy,
save_annotation,
descriptors,
wrapup_atlas_from_dir,
volume_utils,
mesh_utils,
get_structure_children,
)
from atlas_gen import mesh_utils
from brainatlas_api import descriptors
from brainatlas_api.structures.structure_tree import StructureTree


Expand Down
Expand Up @@ -16,11 +16,11 @@
from brainio.brainio import load_any
from allensdk.core.reference_space_cache import ReferenceSpaceCache

from brainatlas_api.atlas_gen.volume_utils import (
from atlas_gen.volume_utils import (
extract_volume_surface,
load_labelled_volume,
)
from brainatlas_api.atlas_gen.metadata_utils import create_metadata_files
from atlas_gen.metadata_utils import create_metadata_files


paxinos_allen_directory = Path(
Expand Down
@@ -1,8 +1,8 @@
from brainatlas_api.atlas_gen.volume_utils import (
from atlas_gen.volume_utils import (
extract_volume_surface,
load_labelled_volume,
)
from brainatlas_api.atlas_gen.metadata_utils import create_metadata_files
from atlas_gen.metadata_utils import create_metadata_files
from brainio.brainio import load_any


Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion brainatlas_api/atlas_gen/stacks.py → atlas_gen/stacks.py
@@ -1,5 +1,5 @@
import tifffile
from brainatlas_api.atlas_gen import descriptors
from brainatlas_api import descriptors


def write_stack(stack, filename):
Expand Down
File renamed without changes.
@@ -1,6 +1,4 @@
from brainatlas_api.atlas_gen.descriptors import (
STRUCTURE_TEMPLATE as STEMPLATE,
)
from brainatlas_api.descriptors import STRUCTURE_TEMPLATE as STEMPLATE
from brainatlas_api.structures.structure_tree import StructureTree


Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion brainatlas_api/atlas_gen/wrapup.py → atlas_gen/wrapup.py
Expand Up @@ -3,7 +3,7 @@
from brainatlas_api.utils import read_tiff, read_json
from .metadata import generate_metadata_dict
from .structures import check_struct_consistency
from . import descriptors
from brainatlas_api import descriptors
import tarfile
import shutil

Expand Down
10 changes: 0 additions & 10 deletions brainatlas_api/atlas_gen/__init__.py

This file was deleted.

2 changes: 1 addition & 1 deletion brainatlas_api/core.py
Expand Up @@ -4,7 +4,7 @@
from brainatlas_api.utils import read_json, read_tiff, make_hemispheres_stack
from brainatlas_api.structures.structure_tree import StructureTree
from brainatlas_api.obj_utils import read_obj
from brainatlas_api.atlas_gen.descriptors import (
from brainatlas_api.descriptors import (
METADATA_FILENAME,
STRUCTURES_FILENAME,
REFERENCE_FILENAME,
Expand Down
File renamed without changes.
6 changes: 6 additions & 0 deletions requirements.txt
@@ -0,0 +1,6 @@
tqdm
numpy
tifffile
treelib
pandas
requests
5 changes: 3 additions & 2 deletions setup.py
@@ -1,7 +1,7 @@
from setuptools import setup, find_namespace_packages

requirements = ["tqdm", "numpy", "tifffile", "treelib", "pandas"]

with open("requirements.txt") as f:
requirements = f.read().splitlines()

setup(
name="brainatlas-api",
Expand Down Expand Up @@ -41,6 +41,7 @@
"Programming Language :: Python",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
],
Expand Down
6 changes: 6 additions & 0 deletions travis/lint.sh
@@ -0,0 +1,6 @@

pip install black
pip install flake8

flake8
black ./ -l 79 --target-version py37 --check
9 changes: 6 additions & 3 deletions travis/test.sh
@@ -1,4 +1,7 @@
pip install -e .[dev]
pip install -r requirements.txt --no-cache-dir

pip install pytest
pip install pytest-cov

conda info -a
black ./ -l 79 --target-version py37 --check
pytest --cov=brainatlas_api
pytest --cov=brainatlas_api

0 comments on commit 5df3a13

Please sign in to comment.