Skip to content

Commit b9a2013

Browse files
Update Unit Test Cases and Other Improvements (#249)
* Add test_get_files * Update .travis.yml * Drop Python 2 support * Minor update * Update dependency requirenments. * Update .travis.yml * Change allensdk version to 0.16.3 (#1) * Make it to be setup.cfg-only project * Make it to be setup.cfg-only project 2 * Update unit tests. * Update test cases * fix * Update parameter * Update test cases * Drop support of Python 2 * Import new test cases in __init__.py in unit_test directory * remove PYTHON_MAJOR_VERSION constant * Fix error * Update dependency * Drop Python 2 support * Update bluepyopt * Update unit tests * Update unit tests * Improved logic in url_to_path method * Update unit tests * Update unit tests * Update unit tests * Update unit tests * Update unit tests * Update unit tests * forceobj = true for jit decorator * add test_geppetto_backend * Update unit tests * Requiring Python version >= 3.5 * Clean up `__future__ import something` * Import deepcopy, and improve coding style. * Import available_backends * Make ExternalModel inherits from RunnableModel instead of Model * Fix warning * Make ExternalModel call constructor of the parent class * Improve ReducedModel, make unit test cases for it. * get pynn and pyneuroml from Github * Update unit tests * Update unit tests * Try to fix a shell command * Update unit tests * Update unit tests * Update unit tests * Delete useless code * Update address of BBP microcircuit portal. Add test cases for bbp.py * Ran bbp.ipynb * Update unit tests * Update unit tests * Update unit tests * Update unit tests * Change sciunit.settings to sciunit.config_set
1 parent cfb2f98 commit b9a2013

33 files changed

+376
-422
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ python:
66
- "3.5"
77
- "3.6"
88
- "3.7"
9+
- "3.8"
910
install:
1011
- sudo apt-get update
1112
# We do this conditionally because it saves us some downloading if the
@@ -15,7 +16,7 @@ install:
1516
- export PATH="$HOME/miniconda/bin:$PATH"
1617
- hash -r
1718
- conda config --set always_yes yes --set changeps1 no
18-
- conda update -q conda
19+
- conda update -q --all
1920
# Useful for debugging any issues with conda
2021
- conda info -a
2122
- pip install -U pip

neuronunit/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
using the SciUnit framework.
55
"""
66

7-
from __future__ import print_function
8-
from __future__ import unicode_literals
97
import os
108
import platform
119

neuronunit/bbp.py

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,13 @@
77
import requests
88
import matplotlib.pyplot as plt
99
from neo.io import IgorIO
10-
11-
try: # Python 3
12-
from io import BytesIO
13-
from urllib.request import urlopen, URLError
14-
MAJOR_VERSION = 3
15-
except ImportError: # Python 2
16-
from StringIO import StringIO
17-
from urllib2 import urlopen, URLError
18-
MAJOR_VERSION = 2
10+
from io import BytesIO
11+
from urllib.request import urlopen, URLError
1912

2013

2114
def is_bbp_up():
2215
"""Check whether the BBP microcircuit portal is up."""
23-
url = "http://microcircuits.epfl.ch/released_data/B95_folder.zip"
16+
url = "http://microcircuits.epfl.ch/data/released_data/B95.zip"
2417
request = requests.get(url)
2518
return request.status_code == 200
2619

@@ -95,12 +88,8 @@ def find_or_download_data(url):
9588
unzipped = zipped.split('.')[0] # Name when unzipped
9689
z = None
9790
if not os.path.isdir(unzipped): # If unzipped version not found
98-
if MAJOR_VERSION == 2:
99-
r = requests.get(url, stream=True)
100-
z = zipfile.ZipFile(StringIO(r.content))
101-
elif MAJOR_VERSION == 3:
102-
r = requests.get(url)
103-
z = zipfile.ZipFile(BytesIO(r.content))
91+
r = requests.get(url)
92+
z = zipfile.ZipFile(BytesIO(r.content))
10493
z.extractall(unzipped)
10594
return unzipped
10695

neuronunit/cellmodelp.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
# steady state v of a cell defined in a hoc file in the given directory.
33
# Usage: python getCellProperties /path/To/dir/with/.hoc
44

5-
try: # Python 2
6-
import cPickle
7-
except ImportError: # Python 3
8-
import _pickle as cPickle
5+
import _pickle as cPickle
96
import csv
107
import json
118
import os

neuronunit/examples/brian_multi_comp_ca2_HH.ipynb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@
129129
"\n",
130130
" def load_model(self):\n",
131131
" neuron = None\n",
132-
" from __future__ import print_function\n",
133132
" from brian2 import *\n",
134133
"\n",
135134
" from brian2.units.constants import (zero_celsius, faraday_constant as F,\n",
@@ -969,4 +968,4 @@
969968
},
970969
"nbformat": 4,
971970
"nbformat_minor": 2
972-
}
971+
}

neuronunit/models/backends/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import warnings
55

66
import sciunit.models.backends as su_backends
7-
from sciunit.utils import PLATFORM, PYTHON_MAJOR_VERSION
7+
from sciunit.utils import PLATFORM
88
from .base import Backend
99

1010
warnings.filterwarnings('ignore', message='nested set')

neuronunit/models/backends/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222

2323
# Test for NEURON support in a separate python process
2424
NEURON_SUPPORT = (os.system("python -c 'import neuron' > /dev/null 2>&1") == 0)
25-
PYNN_SUPPORT = (os.system("python -c 'import pyNN > /dev/null 2>&1") == 0)
25+
PYNN_SUPPORT = (os.system("python -c 'import pyNN' > /dev/null 2>&1") == 0)

neuronunit/models/backends/brian_multi_comp_ca2_HH.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@
110110
from types import MethodType
111111

112112
from brian2 import *
113-
from __future__ import print_function
114113

115114
from brian2.units.constants import (zero_celsius, faraday_constant as F,
116115
gas_constant as R)

neuronunit/models/backends/fhn.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
#-*- coding: utf-8 -*-
2-
from __future__ import (print_function, division,
3-
absolute_import, unicode_literals)
42
import numpy as np
53
from scipy import integrate as spint
64
from matplotlib import pyplot as plt

neuronunit/models/bindings.py

Lines changed: 0 additions & 182 deletions
This file was deleted.

0 commit comments

Comments
 (0)