-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fe1b1d3
commit bdb4af1
Showing
6 changed files
with
212 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
from gap_statistic.optimalK import OptimalK | ||
__version__ = '1.6.0' | ||
|
||
__version__ = "1.6.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,49 +6,65 @@ | |
from setuptools_rust import RustExtension, Binding | ||
except ImportError: | ||
import subprocess | ||
errno = subprocess.call([sys.executable, '-m', 'pip', 'install', 'setuptools-rust>=0.9.2']) | ||
|
||
errno = subprocess.call( | ||
[sys.executable, "-m", "pip", "install", "setuptools-rust>=0.9.2"] | ||
) | ||
if errno: | ||
print("Please install the 'setuptools-rust>=0.9.2' package") | ||
raise SystemExit(errno) | ||
else: | ||
from setuptools_rust import RustExtension, Binding | ||
|
||
install_requires = ["numpy", "pandas", "scipy"] | ||
|
||
setup_requires = [ | ||
"setuptools-rust>=0.9.2", | ||
"pytest-runner", | ||
"pytest", | ||
"scikit-learn", | ||
"joblib", | ||
"scipy", | ||
"pandas", | ||
] | ||
tests_require = ["scikit-learn", "pytest", "joblib", "black", "click"] | ||
|
||
setup(name='gap-stat', | ||
version=__version__, | ||
author='Miles Granger', | ||
maintainer='Miles Granger', | ||
author_email='[email protected]', | ||
maintainer_email='[email protected]', | ||
keywords='kmeans unsupervised learning machine-learning clustering', | ||
description='Python implementation of the gap statistic with Rust optimizations.', | ||
long_description='Uses the gap statistic method by Tibshirani, Walther, Hastie to suggest n_clusters.', | ||
packages=['gap_statistic'], | ||
rust_extensions=[ | ||
RustExtension('gap_statistic.rust.gapstat', 'Cargo.toml', binding=Binding.PyO3) | ||
], | ||
license='BSD', | ||
url='https://github.com/milesgranger/gap_statistic', | ||
zip_safe=False, | ||
setup_requires=['setuptools-rust>=0.9.2', 'pytest-runner', 'pytest', 'scikit-learn', 'joblib', 'scipy', 'pandas'], | ||
install_requires=['numpy', 'pandas', 'scipy'], | ||
tests_require=['scikit-learn', 'pytest', 'joblib'], | ||
test_suite='tests', | ||
include_package_data=True, | ||
classifiers=[ | ||
'Development Status :: 5 - Production/Stable', | ||
'Intended Audience :: Developers', | ||
'Intended Audience :: Financial and Insurance Industry', | ||
'Intended Audience :: Information Technology', | ||
'Intended Audience :: Science/Research', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 3.5', | ||
'Programming Language :: Python :: 3.6', | ||
'Programming Language :: Python :: 3 :: Only', | ||
'Programming Language :: Rust', | ||
'Operating System :: Microsoft :: Windows', | ||
'Operating System :: POSIX', | ||
'Operating System :: Unix', | ||
'Operating System :: MacOS :: MacOS X', | ||
], | ||
) | ||
setup( | ||
name="gap-stat", | ||
version=__version__, | ||
author="Miles Granger", | ||
maintainer="Miles Granger", | ||
author_email="[email protected]", | ||
maintainer_email="[email protected]", | ||
keywords="kmeans unsupervised learning machine-learning clustering", | ||
description="Python implementation of the gap statistic with Rust optimizations.", | ||
long_description="Uses the gap statistic method by Tibshirani, Walther, Hastie to suggest n_clusters.", | ||
packages=["gap_statistic"], | ||
rust_extensions=[ | ||
RustExtension("gap_statistic.rust.gapstat", "Cargo.toml", binding=Binding.PyO3) | ||
], | ||
license="BSD", | ||
url="https://github.com/milesgranger/gap_statistic", | ||
zip_safe=False, | ||
setup_requires=setup_requires, | ||
install_requires=install_requires, | ||
tests_require=tests_require, | ||
test_suite="tests", | ||
include_package_data=True, | ||
classifiers=[ | ||
"Development Status :: 5 - Production/Stable", | ||
"Intended Audience :: Developers", | ||
"Intended Audience :: Financial and Insurance Industry", | ||
"Intended Audience :: Information Technology", | ||
"Intended Audience :: Science/Research", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3.5", | ||
"Programming Language :: Python :: 3.6", | ||
"Programming Language :: Python :: 3 :: Only", | ||
"Programming Language :: Rust", | ||
"Operating System :: Microsoft :: Windows", | ||
"Operating System :: POSIX", | ||
"Operating System :: Unix", | ||
"Operating System :: MacOS :: MacOS X", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import os | ||
|
||
import pytest | ||
|
||
|
||
@pytest.mark.skipif( | ||
os.environ.get("AGENT_OS") == "Windows_NT", | ||
reason="Black formatting fails on Azure Windows builds.", | ||
) | ||
def test_formatting(): | ||
""" | ||
Ensure project adheres to black style | ||
""" | ||
import black | ||
from click.testing import CliRunner | ||
|
||
print(os.environ) | ||
|
||
proj_path = os.path.join(os.path.dirname(__file__), "..", "gap_statistic") | ||
tests_path = os.path.join(os.path.dirname(__file__), "..", "tests") | ||
setuppy = os.path.join(os.path.dirname(__file__), "..", "setup.py") | ||
|
||
runner = CliRunner() | ||
resp = runner.invoke(black.main, ["--check", "-v", proj_path, tests_path, setuppy]) | ||
assert resp.exit_code == 0, "Would still reformat one or more files:\n{}".format( | ||
resp.output | ||
) |
Oops, something went wrong.