Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MRG] Mac builds #10

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@ jobs:
- install-gfortran
- make-unit-test

cpython38-linux:
docker:
- image: python:3.8
working_directory: ~/skoot
steps:
- install-gfortran
- make-unit-test

# For testing lint
test-linting:
docker:
Expand Down Expand Up @@ -151,6 +159,17 @@ jobs:
pythonversion: "3.7"
- deploy-to-pypi

deploy-cpython38-whl:
machine:
image: circleci/classic:latest
working_directory: ~/skoot
steps:
- checkout
- sudo-install-gfortran
- build-whl-file:
pythonversion: "3.8"
- deploy-to-pypi

# For documentation deployment. You'll need the following environment vars
# in your Circle CI settings, otherwise this will not work.
#
Expand Down Expand Up @@ -179,6 +198,8 @@ workflows:
filters: *test-filters
- cpython37-linux:
filters: *test-filters
- cpython38-linux:
filters: *test-filters
- test-linting:
filters: *test-filters

Expand Down Expand Up @@ -210,3 +231,8 @@ workflows:
filters: *deploy-filters
requires:
- deploy-doc

- deploy-cpython38-whl:
filters: *deploy-filters
requires:
- deploy-doc
6 changes: 3 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ pr:
include:
- '*'

variables:
# Read deployment variables from our secret group
- group: deploy-vars
#variables:
# # Read deployment variables from our secret group
# - group: deploy-vars

jobs:
- template: build_tools/azure/jobs.yml
4 changes: 0 additions & 4 deletions build_tools/azure/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ steps:
- script: pytest --showlocals --durations=20 --pyargs skoot
displayName: 'Running unit tests'

# Build source archive here so we don't have to in Circle
- script: python setup.py sdist
displayName: 'Building source archive'

- bash: |
if python -c "from twine.commands.check import check; check(['dist/*'])" | grep "warning"; then
echo "README will not render properly on PyPI"
Expand Down
51 changes: 8 additions & 43 deletions build_tools/azure/jobs.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,11 @@
jobs:
- job: Windows

pool:
vmImage: 'vs2017-win2016'

strategy:
maxParallel: 6
matrix:
Python35-x86:
python.version: '3.5'
architecture: 'x86'

Python35-x64:
python.version: '3.5'
architecture: 'x64'

Python36-x86:
python.version: '3.6'
architecture: 'x86'

Python36-x64:
python.version: '3.6'
architecture: 'x64'

Python37-x86:
python.version: '3.7'
architecture: 'x86'

Python37-x64:
python.version: '3.7'
architecture: 'x64'

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: '$(architecture)'
displayName: 'Setting Python version and system architecture'

- template: build_and_deploy.yml

- job: macOS

pool:
vmImage: 'macOS-10.13' # Also have the option of 10.14, if we want that
vmImage: 'macOS-latest'

strategy:
maxParallel: 3
maxParallel: 4
matrix:
Python35:
python.version: '3.5'
Expand All @@ -57,10 +16,16 @@ jobs:
Python37:
python.version: '3.7'

Python38:
python.version: '3.8'

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
displayName: 'Setting Python version'

- script: brew cask install gfortran
displayName: 'Installing Fortran'

- template: build_and_deploy.yml
1 change: 1 addition & 0 deletions build_tools/azure/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ six
joblib
patsy
pytest
setuptools>=38.6.0
wheel
twine>=1.13.0
readme_renderer[md]
3 changes: 2 additions & 1 deletion build_tools/doc/doc_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ sphinx_rtd_theme
matplotlib==2.2.0rc1
numpydoc==0.7.0
Django==1.11
image==1.5.19
image==1.5.19
six
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import sys
import skoot
from pkg_resources import parse_version
from sklearn.externals.six import u
from six import u

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down
2 changes: 1 addition & 1 deletion examples/preprocessing/ex_one_hot.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
# #############################################################################
# Show we can work with levels we've never seen before
test_row = X_test.iloc[0]
test_row.set_value("native-country", "Atlantis")
test_row.at["native-country"] = "Atlantis"
trans = encoder.transform(pd.DataFrame([test_row]))
print("\nApplied on a row with a new native-country:")
print(trans)
Expand Down
7 changes: 7 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
PYPIDIST = DISTNAME
DESCRIPTION = DOCLINES[0]

# Get the long desc
with open("README.md", "r") as fh:
LONG_DESCRIPTION = fh.read()

MAINTAINER = 'Taylor G. Smith'
MAINTAINER_GIT = 'tgsmith61591'
MAINTAINER_EMAIL = 'taylor.smith@alkaline-ml.com'
Expand Down Expand Up @@ -188,6 +192,8 @@ def do_setup():
maintainer=MAINTAINER,
maintainer_email=MAINTAINER_EMAIL,
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
long_description_content_type='text/markdown',
license=LICENSE,
version=VERSION,
classifiers=[
Expand All @@ -196,6 +202,7 @@ def do_setup():
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Topic :: Software Development',
'Topic :: Scientific/Engineering',
'Operating System :: POSIX',
Expand Down
14 changes: 6 additions & 8 deletions skoot/_build_utils/system_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@
import warnings

import numpy as np
import numpy.distutils.system_info

from numpy.distutils.system_info import (system_info,
numpy_info,
NotFoundError,
BlasNotFoundError,
LapackNotFoundError,
AtlasNotFoundError,
Expand All @@ -16,10 +13,9 @@
dict_append,
get_info as old_get_info)

from scipy._lib._version import NumpyVersion
from scipy._lib._pep440 import parse


if NumpyVersion(np.__version__) >= "1.15.0.dev":
if parse(np.__version__) >= parse("1.15.0.dev"):
# For new enough numpy.distutils, the ACCELERATE=None environment
# variable in the top-level setup.py is enough, so no need to
# customize BLAS detection.
Expand All @@ -35,6 +31,7 @@ def get_info(name, notfound_action=0):
return old_get_info(name, notfound_action)
return cls().get_info(notfound_action)


#
# The following is copypaste from numpy.distutils.system_info, with
# OSX Accelerate-related parts removed.
Expand Down Expand Up @@ -75,7 +72,7 @@ def calc_info(self):
if atlas_info:
l = atlas_info.get('define_macros', [])
if ('ATLAS_WITH_LAPACK_ATLAS', None) in l \
or ('ATLAS_WITHOUT_LAPACK', None) in l:
or ('ATLAS_WITHOUT_LAPACK', None) in l:
need_lapack = 1
info = atlas_info

Expand All @@ -87,7 +84,7 @@ def calc_info(self):

if need_lapack:
lapack_info = get_info('lapack')
#lapack_info = {} ## uncomment for testing
# lapack_info = {} ## uncomment for testing
if lapack_info:
dict_append(info, **lapack_info)
else:
Expand All @@ -113,6 +110,7 @@ def calc_info(self):
self.set_info(**info)
return


class blas_opt_info(system_info):

notfounderror = BlasNotFoundError
Expand Down
8 changes: 4 additions & 4 deletions skoot/decomposition/tests/test_decompose.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ def test_selective_pca():

# the "other" names, and their corresponding matrix
comp_column_names = names[1:]
compare_cols = original[comp_column_names].as_matrix()
compare_cols = original[comp_column_names].to_numpy()

# now fit PCA on the first column only
transformer = SelectivePCA(cols=cols, n_components=0.85,
trans_col_name="PC").fit(original)
transformed = transformer.transform(original)

# get the untouched columns to compare. These should be equal!!
untouched_cols = transformed[comp_column_names].as_matrix()
untouched_cols = transformed[comp_column_names].to_numpy()
assert_array_almost_equal(compare_cols, untouched_cols)

# make sure the component is present in the columns
Expand Down Expand Up @@ -60,13 +60,13 @@ def test_selective_tsvd():
cols = names[:2]

comp_column_names = names[2:]
compare_cols = original[comp_column_names].as_matrix()
compare_cols = original[comp_column_names].to_numpy()

transformer = SelectiveTruncatedSVD(cols=cols, n_components=1,
trans_col_name="Concept").fit(original)
transformed = transformer.transform(original)

untouched_cols = transformed[comp_column_names].as_matrix()
untouched_cols = transformed[comp_column_names].to_numpy()
assert_array_almost_equal(compare_cols, untouched_cols)

assert 'Concept1' in transformed.columns
Expand Down
2 changes: 1 addition & 1 deletion skoot/feature_extraction/tests/test_interact.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def test_interaction_corners():
for i, j in zip(X_trans.columns.tolist(),
expected_names)]) # assert col names equal

assert_array_equal(X_trans.as_matrix(), np.array([
assert_array_equal(X_trans.to_numpy(), np.array([
[0, 1, 0, 1, 0],
[0, 0, 1, 1, 0],
[0, 0, 0, 1, 0],
Expand Down
2 changes: 1 addition & 1 deletion skoot/feature_selection/combos.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def fit(self, X, y=None):
drops = []

# Generate sub matrix for qr decomposition
x = X[cols].as_matrix()
x = X[cols].to_numpy()
cols = np.array(cols) # so we can use boolean masking

# do subroutines
Expand Down
2 changes: 1 addition & 1 deletion skoot/preprocessing/tests/test_encode.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def test_dummy_encoder_ignore():

# get a test sample, make it different
test_sample = iris.iloc[0].copy()
test_sample.set_value("species", 99)
test_sample.at["species"] = 99

# show this does not break
df = pd.DataFrame([test_sample])
Expand Down