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

Build system updated to setuptools. #9

Open
wants to merge 3 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
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include README.md
2 changes: 1 addition & 1 deletion distl/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from . import distl as _distl
from .distl import DistributionCollection, from_dict, from_json, from_file, get_random_seed, _has_astropy, _units, __version__, version # , sample_from_dists, sample_ppf_from_dists, logp_from_dists, sample_func_from_dists, plot_func_from_dists,
from .distl import DistributionCollection, from_dict, from_json, from_file, get_random_seed, _has_astropy, __version__, version # , sample_from_dists, sample_ppf_from_dists, logp_from_dists, sample_func_from_dists, plot_func_from_dists,
import numpy as _np
from .distl import BaseDistlObject, BaseDistribution, BaseAroundGenerator # for isinstance checking
import json as _json
Expand Down
12 changes: 6 additions & 6 deletions distl/distl.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import random as _random
import string as _string
from collections import OrderedDict
from distutils.version import StrictVersion
from packaging.version import parse

from . import stats_custom as _stats_custom

Expand Down Expand Up @@ -5685,7 +5685,7 @@ def __init__(self, samples, weights=None, bw_method=None, unit=None,
weights = weights[~nans]

super(Samples, self).__init__(unit, label, label_latex, wrap_at,
_stats.gaussian_kde, ('samples', 'bw_method') if StrictVersion(_scipy_version) < StrictVersion("1.2.0") else ('samples', 'bw_method', 'weights'),
_stats.gaussian_kde, ('samples', 'bw_method') if parse(_scipy_version) < parse("1.2.0") else ('samples', 'bw_method', 'weights'),
samples=samples, weights=weights,
bw_method=bw_method,
uniqueid=uniqueid)
Expand Down Expand Up @@ -5734,7 +5734,7 @@ def weights(self, value):
if value is None:
self._weights = None
else:
if StrictVersion(_scipy_version) < StrictVersion("1.2.0"):
if parse(_scipy_version) < parse("1.2.0"):
raise ImportError("weights for Samples requires scipy 1.2+")
self._weights = is_1d_array(value)
self._dist_constructor_object_clear_cache()
Expand Down Expand Up @@ -7545,7 +7545,7 @@ def __init__(self, samples, weights=None, bw_method=None, units=None,
# NOTE: the passed samples need to be transposed, so see the override
# in dist_constructor_args
super(MVSamples, self).__init__(units, labels, labels_latex, wrap_ats,
_stats.gaussian_kde, ('samples', 'bw_method') if StrictVersion(_scipy_version) < StrictVersion("1.2.0") else ('samples', 'bw_method', 'weights'),
_stats.gaussian_kde, ('samples', 'bw_method') if parse(_scipy_version) < parse("1.2.0") else ('samples', 'bw_method', 'weights'),
samples=samples, weights=weights, bw_method=bw_method,
uniqueid=uniqueid)

Expand Down Expand Up @@ -7573,7 +7573,7 @@ def weights(self, value):
if value is None:
self._weights = None
else:
if StrictVersion(_scipy_version) < StrictVersion("1.2.0"):
if parse(_scipy_version) < parse("1.2.0"):
raise ImportError("weights for Samples requires scipy 1.2+")
self._weights = is_1d_array(value)
self._dist_constructor_object_clear_cache()
Expand Down Expand Up @@ -7997,7 +7997,7 @@ def dist_constructor_func(self):

@property
def dist_constructor_argnames(self):
return ('samples', 'bw_method') if StrictVersion(_scipy_version) < StrictVersion("1.2.0") else ('samples', 'bw_method', 'weights')
return ('samples', 'bw_method') if parse(_scipy_version) < parse("1.2.0") else ('samples', 'bw_method', 'weights')

@property
def samples(self):
Expand Down
50 changes: 50 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[project]
name = "distl"
version = "0.3.1"
description = "Simple Distributions: math operations, serializing, covariances"
readme = "README.md"
requires-python = ">=3.7"
license = { text = "GPL-3.0-or-later" }
authors = [
{ name = "Kyle Conroy", email = "[email protected]" },
]
maintainers = [
{ name = "Kyle Conroy", email = "[email protected]" },
]
keywords = [
"science",
"mathematics",
"statistics",
]
classifiers = [
"Development Status :: 1 - Planning",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.6",
"Topic :: Scientific/Engineering",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
"numpy",
"scipy"
]

[project.optional-dependencies]
test = [
"pytest"
]

[project.urls]
repository = "https://github.com/kecnry/distl"

[build-system]
requires = ["setuptools", "numpy", "wheel"]
build-backend = "setuptools.build_meta"

[tool.setuptools]
packages = [
"distl"
]
30 changes: 0 additions & 30 deletions setup.py

This file was deleted.