minerva-ml / steppy-toolkit

Curated set of transformers that make your work with steppy faster and more effective :telescope:
MIT License
22 stars 9 forks source link

docstrings for toolkit preprocessing and unit and functional tests fo… #39

Closed bcottman closed 6 years ago

bcottman commented 6 years ago

docs

run following to generate docs cd /steppy-tookit/docs sphinx-apidoc -o generated/ ../toolkit -f clear;make clean;make html

Running Sphinx v1.8.1 making output directory... building [mo]: targets for 0 po files that are out of date building [html]: targets for 8 source files that are out of date updating environment: 8 added, 0 changed, 0 removed /Users/brucecottman/anaconda3/envs/steppy/lib/python3.6/site-packages/sklearn/ensemble/weight_boosting.py:29: DeprecationWarning: numpy.core.umath_tests is an internal NumPy module and should not be imported. It will be removed in a future NumPy release. from numpy.core.umath_tests import inner1d /Users/brucecottman/anaconda3/envs/steppy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 return f(*args, kwds) /Users/brucecottman/anaconda3/envs/steppy/lib/python3.6/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type. from ._conv import register_converters as _register_converters Using TensorFlow backend. /Users/brucecottman/anaconda3/envs/steppy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: compiletime version 3.5 of module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.6 return f(*args, *kwds) /Users/brucecottman/anaconda3/envs/steppy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 return f(args, kwds) /Users/brucecottman/anaconda3/envs/steppy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 return f(*args, **kwds) [nltk_data] Downloading package wordnet to [nltk_data] /Users/brucecottman/nltk_data... [nltk_data] Package wordnet is already up-to-date! [nltk_data] Downloading package stopwords to [nltk_data] /Users/brucecottman/nltk_data... [nltk_data] Package stopwords is already up-to-date! reading sources... [100%] index
/Users/brucecottman/Documents/PROJECTS/steppy-toolkit/toolkit/keras_transformers/contrib.py:docstring of toolkit.keras_transformers.contrib.AttentionWeightedAverage.call:4: WARNING: Inline strong start-string without end-string. looking for now-outdated files... none found pickling environment... done checking consistency... done preparing documents... done writing output... [100%] index
generating indices... genindex py-modindex writing additional pages... search copying static files... done copying extra files... done dumping search index in English (code: en) ... done dumping object inventory... done build succeeded, 1 warning.

tests

run following to invoke unit tests in subdirectory tests:

/py.test -v functional (*.inypb) tests have been moved to tests/preprocessing - end
bcottman commented 6 years ago

also did you/someone assign tmp_directory perhaps using 'py,test --fixtures ???

(steppy) Mac-Pro:tests brucecottman$ py.test -v ============================= test session starts ============================== platform darwin -- Python 3.6.5, pytest-3.5.1, py-1.5.3, pluggy-0.6.0 -- /Users/brucecottman/anaconda3/envs/steppy/bin/python cachedir: ../.pytest_cache rootdir: /Users/brucecottman/Documents/PROJECTS/steppy-toolkit, inifile: plugins: remotedata-0.2.1, openfiles-0.3.0, doctestplus-0.1.3, arraydiff-0.2 collected 27 items

preprocessing/test_scalers.py::test_df_Class_init_NoArg PASSED [ 3%] preprocessing/test_scalers.py::test_df_Class_init_WrongScaler PASSED [ 7%] preprocessing/test_scalers.py::test_df_BoxCox_instance_2d PASSED [ 11%] preprocessing/test_scalers.py::test_df_BoxCox_2d_numpy PASSED [ 14%] preprocessing/test_scalers.py::test_df_BoxCox_instance_1d PASSED [ 18%] preprocessing/test_scalers.py::test_df_BoxCox_1d_numpy PASSED [ 22%] preprocessing/test_scalers.py::test_df_BoxCox_type_error PASSED [ 25%] preprocessing/test_scalers.py::test_df_Lambert_instance_2d PASSED [ 29%] preprocessing/test_scalers.py::test_df_Lambert_2d_numpy PASSED [ 33%] preprocessing/test_scalers.py::test_df_Lambert_instance_1d PASSED [ 37%] preprocessing/test_scalers.py::test_df_Lambert_1d_numpy PASSED [ 40%] preprocessing/test_scalers.py::test_df_Lambert_type_error PASSED [ 44%] preprocessing/test_scalers.py::test_df_Lambert_zeroval_1d PASSED [ 48%] preprocessing/test_scalers.py::test_df_Lambert_negval_1d PASSED [ 51%] preprocessing/test_toDataFrame.py::test_df_Class_init_NoArg PASSED [ 55%] preprocessing/test_toDataFrame.py::test_df_2d_numpy PASSED [ 59%] preprocessing/test_toDataFrame.py::test_df_1d_numpy PASSED [ 62%] preprocessing/test_toDataFrame.py::test_df_2d_named PASSED [ 66%] preprocessing/test_toDataFrame.py::test_df_BlankList PASSED [ 70%] preprocessing/test_toDataFrame.py::test_df_3dArray_numpy PASSED [ 74%] preprocessing/test_toDataFrame.py::test_df_df PASSED [ 77%] sklearn/test_models.py::test_fit_transform[RandomForestClassifier-SklearnClassifier-predict_proba] PASSED [ 81%] sklearn/test_models.py::test_fit_transform[RandomForestRegressor-SklearnRegressor-predict] PASSED [ 85%] sklearn/test_models.py::test_fit_transform[PCA-SklearnTransformer-transform] PASSED [ 88%] sklearn/test_models.py::test_persisting_and_loading[RandomForestClassifier-SklearnClassifier] ERROR [ 92%] sklearn/test_models.py::test_persisting_and_loading[RandomForestRegressor-SklearnRegressor] ERROR [ 96%] sklearn/test_models.py::test_persisting_and_loading[PCA-SklearnTransformer] ERROR [100%]

==================================== ERRORS ==================================== ERROR at setup of test_persisting_and_loading[RandomForestClassifier-SklearnClassifier] file /Users/brucecottman/Documents/PROJECTS/steppy-toolkit/tests/sklearn/test_models.py, line 49 @pytest.mark.parametrize( "sklearn_class,steps_wrapper", [ (RandomForestClassifier, SklearnClassifier), (RandomForestRegressor, SklearnRegressor), (PCA, SklearnTransformer), ] ) def test_persisting_and_loading(X, y, tmp_directory, sklearn_class, steps_wrapper): E fixture 'tmp_directory' not found

  available fixtures: X, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_xml_attribute, record_xml_property, recwarn, tmpdir, tmpdir_factory, y
  use 'pytest --fixtures [testpath]' for help on them.

/Users/brucecottman/Documents/PROJECTS/steppy-toolkit/tests/sklearn/test_models.py:49 ERROR at setup of test_persisting_and_loading[RandomForestRegressor-SklearnRegressor] file /Users/brucecottman/Documents/PROJECTS/steppy-toolkit/tests/sklearn/test_models.py, line 49 @pytest.mark.parametrize( "sklearn_class,steps_wrapper", [ (RandomForestClassifier, SklearnClassifier), (RandomForestRegressor, SklearnRegressor), (PCA, SklearnTransformer), ] ) def test_persisting_and_loading(X, y, tmp_directory, sklearn_class, steps_wrapper): E fixture 'tmp_directory' not found

  available fixtures: X, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_xml_attribute, record_xml_property, recwarn, tmpdir, tmpdir_factory, y
  use 'pytest --fixtures [testpath]' for help on them.

/Users/brucecottman/Documents/PROJECTS/steppy-toolkit/tests/sklearn/test_models.py:49 ERROR at setup of test_persisting_andloading[PCA-SklearnTransformer] file /Users/brucecottman/Documents/PROJECTS/steppy-toolkit/tests/sklearn/test_models.py, line 49 @pytest.mark.parametrize( "sklearn_class,steps_wrapper", [ (RandomForestClassifier, SklearnClassifier), (RandomForestRegressor, SklearnRegressor), (PCA, SklearnTransformer), ] ) def test_persisting_and_loading(X, y, tmp_directory, sklearn_class, steps_wrapper): E fixture 'tmp_directory' not found

  available fixtures: X, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_xml_attribute, record_xml_property, recwarn, tmpdir, tmpdir_factory, y
  use 'pytest --fixtures [testpath]' for help on them.

/Users/brucecottman/Documents/PROJECTS/steppy-toolkit/tests/sklearn/test_models.py:49 ====================== 24 passed, 3 error in 2.75 seconds ======================

-end