Skip to content

Commit

Permalink
fix missing module in .travis.yml, README.md, setup.py. split tests. …
Browse files Browse the repository at this point in the history
…improved filenames
  • Loading branch information
fandreuz committed Mar 30, 2021
1 parent 81f2f63 commit ad75da5
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ install:
conda create --yes -n test python="3.6";
fi
- source activate test
- pip install numpy scipy matplotlib pip nose sphinx==1.4 gpy torch
- pip install numpy scipy matplotlib pip nose sphinx==1.4 gpy torch sklearn
- pip install setuptools
- pip install coveralls
- pip install coverage
- python setup.py install

script:
script:
- coverage run test.py

after_success:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
See the [**Examples**](#examples) section below and the [**Tutorials**](tutorials/README.md) to have an idea of the potential of this package.

## Dependencies and installation
**EZyRB** requires `numpy`, `scipy`, `matplotlib`, `vtk`, `nose` (for local
**EZyRB** requires `numpy`, `scipy`, `sklearn`, `matplotlib`, `vtk`, `nose` (for local
test) and `sphinx` (to generate the documentation).The coe has been tested with
Python3.5 version, but it should be compatible with Python3. It can be
installed using `pip` or directly from the source code.
Expand Down
4 changes: 2 additions & 2 deletions ezyrb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
from .gpr import GPR
from .reducedordermodel import ReducedOrderModel
from .ann import ANN
from .kneighborsregressor import KNeighborsRegressor
from .radius_neighborsregressor import RadiusNeighborsRegressor
from .kneighbors_regressor import KNeighborsRegressor
from .radius_neighbors_regressor import RadiusNeighborsRegressor
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class NeighborsRegressor(Approximation):
"""

def __init__(self, **kwargs):
raise ValueError("This class must be extended, not used.")
raise NotImplementedError("This class must be extended, not used.")

def fit(self, points, values):
"""
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
KEYWORDS='pod interpolation reduced-basis model-order-reduction'

REQUIRED = [
'future', 'numpy', 'scipy', 'matplotlib', 'GPy'
'future', 'numpy', 'scipy', 'matplotlib', 'GPy', 'sklearn'
]

EXTRAS = {
Expand Down
3 changes: 2 additions & 1 deletion tests/test_k_neighbors_regressor.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,13 @@ def test_with_db_predict(self):
assert rom.predict([2]) == 5
assert rom.predict([3]) == 3

def test_wrong(self):
def test_wrong1(self):
# wrong number of params
with self.assertRaises(Exception):
reg = KNeighborsRegressor()
reg.fit([[1, 2], [6,], [8, 9]], [[1, 0], [20, 5], [8, 6]])

def test_wrong2(self):
# wrong number of values
with self.assertRaises(Exception):
reg = KNeighborsRegressor()
Expand Down
3 changes: 2 additions & 1 deletion tests/test_radius_neighbors_regressor.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,13 @@ def test_with_db_predict(self):
assert rom.predict([2]) == 5
assert rom.predict([3]) == 3

def test_wrong(self):
def test_wrong1(self):
# wrong number of params
with self.assertRaises(Exception):
reg = RadiusNeighborsRegressor()
reg.fit([[1, 2], [6,], [8, 9]], [[1, 0], [20, 5], [8, 6]])

def test_wrong2(self):
# wrong number of values
with self.assertRaises(Exception):
reg = RadiusNeighborsRegressor()
Expand Down

0 comments on commit ad75da5

Please sign in to comment.