From 45e6640d91e80124fc6f958307457e8ef06566e7 Mon Sep 17 00:00:00 2001 From: Valentin Boettcher Date: Wed, 8 Dec 2021 21:36:21 +0100 Subject: [PATCH] switch to poetry --- build.py | 27 +++++++ flake.lock | 168 +++++++++++++++++------------------------- flake.nix | 86 +++++++++++----------- poetry.lock | 170 +++++++++++++++++++++++++++++++++++++++++++ pyproject.toml | 29 ++++++++ requirements.txt | 4 - setup.py | 44 ----------- stocproc/__init__.py | 20 ----- stocproc/tools.py | 2 +- 9 files changed, 336 insertions(+), 214 deletions(-) create mode 100644 build.py create mode 100644 poetry.lock create mode 100644 pyproject.toml delete mode 100644 requirements.txt delete mode 100644 setup.py diff --git a/build.py b/build.py new file mode 100644 index 0000000..8f91392 --- /dev/null +++ b/build.py @@ -0,0 +1,27 @@ +from Cython.Build import cythonize +from distutils.command.build_ext import build_ext +import numpy +import os + + +def build(setup_kwargs): + """ + This function is mandatory in order to build the extensions. + """ + + extensions = ["./stocproc/stocproc_c.pyx"] + + # gcc arguments hack: enable optimizations + os.environ["CFLAGS"] = f"-O3 -I{numpy.get_include()}" + + # Build + setup_kwargs.update( + { + "ext_modules": cythonize( + extensions, + language_level=3, + compiler_directives={"linetrace": True}, + ), + "cmdclass": {"build_ext": build_ext}, + } + ) diff --git a/flake.lock b/flake.lock index 47da44e..dd5511e 100644 --- a/flake.lock +++ b/flake.lock @@ -3,15 +3,15 @@ "fcSpline": { "inputs": { "flake-utils": "flake-utils", - "mach-nix": "mach-nix", - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs", + "poetry2nix": "poetry2nix" }, "locked": { - "lastModified": 1638901147, - "narHash": "sha256-Vk6B3uYU+gAz2Vw//alCepa8Iwva6dWT002v8HX1Rrk=", + "lastModified": 1638999471, + "narHash": "sha256-9sO0Xt9ugukyWaVjhd2kgrdYtPrEIrPU6S2219O8VIg=", "owner": "vale981", "repo": "fcSpline", - "rev": "fb28080c8d48235194cf682c2628c22bfab6b555", + "rev": "991683bca9161248fff0f0bc7ac8af245cfddf48", "type": "github" }, "original": { @@ -37,11 +37,11 @@ }, "flake-utils_2": { "locked": { - "lastModified": 1601282935, - "narHash": "sha256-WQAFV6sGGQxrRs3a+/Yj9xUYvhTpukQJIcMbIi7LCJ4=", + "lastModified": 1610051610, + "narHash": "sha256-U9rPz/usA1/Aohhk7Cmc2gBrEEKRzcW4nwPWMPwja4Y=", "owner": "numtide", "repo": "flake-utils", - "rev": "588973065fce51f4763287f0fda87a174d78bf48", + "rev": "3982c9903e93927c2164caa727cd3f6a0e6d14cc", "type": "github" }, "original": { @@ -67,11 +67,11 @@ }, "flake-utils_4": { "locked": { - "lastModified": 1601282935, - "narHash": "sha256-WQAFV6sGGQxrRs3a+/Yj9xUYvhTpukQJIcMbIi7LCJ4=", + "lastModified": 1610051610, + "narHash": "sha256-U9rPz/usA1/Aohhk7Cmc2gBrEEKRzcW4nwPWMPwja4Y=", "owner": "numtide", "repo": "flake-utils", - "rev": "588973065fce51f4763287f0fda87a174d78bf48", + "rev": "3982c9903e93927c2164caa727cd3f6a0e6d14cc", "type": "github" }, "original": { @@ -80,53 +80,13 @@ "type": "github" } }, - "mach-nix": { - "inputs": { - "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs", - "pypi-deps-db": "pypi-deps-db" - }, - "locked": { - "lastModified": 1637687243, - "narHash": "sha256-Qm0hPR9ZT1EP7lRW4udAPeb4yv6D2ONcw9ayterTP18=", - "owner": "DavHau", - "repo": "mach-nix", - "rev": "31b21203a1350bff7c541e9dfdd4e07f76d874be", - "type": "github" - }, - "original": { - "owner": "DavHau", - "repo": "mach-nix", - "type": "github" - } - }, - "mach-nix_2": { - "inputs": { - "flake-utils": "flake-utils_4", - "nixpkgs": "nixpkgs_3", - "pypi-deps-db": "pypi-deps-db_2" - }, - "locked": { - "lastModified": 1637687243, - "narHash": "sha256-Qm0hPR9ZT1EP7lRW4udAPeb4yv6D2ONcw9ayterTP18=", - "owner": "DavHau", - "repo": "mach-nix", - "rev": "31b21203a1350bff7c541e9dfdd4e07f76d874be", - "type": "github" - }, - "original": { - "owner": "DavHau", - "repo": "mach-nix", - "type": "github" - } - }, "nixpkgs": { "locked": { - "lastModified": 1622797669, - "narHash": "sha256-xIyWeoYExzF0KNaKcqfxEX58fN4JTIQxTJWbsAujllc=", + "lastModified": 1638806821, + "narHash": "sha256-v2qd2Bsmzft53s43eCbN+4ocrLksRdFLyF/MAGuWuDA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1ca6b0a0cc38dbba0441202535c92841dd39d1ae", + "rev": "bc5d68306b40b8522ffb69ba6cff91898c2fbbff", "type": "github" }, "original": { @@ -136,6 +96,21 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1610729867, + "narHash": "sha256-bk/SBaBLqZX/PEqal27DMQwAHHl0dcZMp8NNksQr80s=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "04af07c659c6723a2259bb6bc00a47ec53330f20", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1638806821, "narHash": "sha256-v2qd2Bsmzft53s43eCbN+4ocrLksRdFLyF/MAGuWuDA=", @@ -150,65 +125,56 @@ "type": "indirect" } }, - "nixpkgs_3": { - "locked": { - "lastModified": 1622797669, - "narHash": "sha256-xIyWeoYExzF0KNaKcqfxEX58fN4JTIQxTJWbsAujllc=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "1ca6b0a0cc38dbba0441202535c92841dd39d1ae", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "ref": "nixos-unstable", - "type": "indirect" - } - }, "nixpkgs_4": { "locked": { - "lastModified": 1638806821, - "narHash": "sha256-v2qd2Bsmzft53s43eCbN+4ocrLksRdFLyF/MAGuWuDA=", + "lastModified": 1610729867, + "narHash": "sha256-bk/SBaBLqZX/PEqal27DMQwAHHl0dcZMp8NNksQr80s=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "bc5d68306b40b8522ffb69ba6cff91898c2fbbff", + "rev": "04af07c659c6723a2259bb6bc00a47ec53330f20", "type": "github" }, "original": { - "id": "nixpkgs", - "ref": "nixos-unstable", - "type": "indirect" - } - }, - "pypi-deps-db": { - "flake": false, - "locked": { - "lastModified": 1622970040, - "narHash": "sha256-u//RFnae/XMIhoy83G2uH2Qu/1LiUhVCdwwY1xj4Ufs=", - "owner": "DavHau", - "repo": "pypi-deps-db", - "rev": "be6591698c67a86a69c81fef72167e38d038a9fc", - "type": "github" - }, - "original": { - "owner": "DavHau", - "repo": "pypi-deps-db", + "owner": "NixOS", + "repo": "nixpkgs", "type": "github" } }, - "pypi-deps-db_2": { - "flake": false, + "poetry2nix": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_2" + }, "locked": { - "lastModified": 1622970040, - "narHash": "sha256-u//RFnae/XMIhoy83G2uH2Qu/1LiUhVCdwwY1xj4Ufs=", - "owner": "DavHau", - "repo": "pypi-deps-db", - "rev": "be6591698c67a86a69c81fef72167e38d038a9fc", + "lastModified": 1638854297, + "narHash": "sha256-mt5gMwAThp8FpcvRsKhs/y/VxLDNgH4MJJLlFbbs4gk=", + "owner": "nix-community", + "repo": "poetry2nix", + "rev": "a4b769203284c91529480adcbb4f17f04d3ff67b", "type": "github" }, "original": { - "owner": "DavHau", - "repo": "pypi-deps-db", + "owner": "nix-community", + "repo": "poetry2nix", + "type": "github" + } + }, + "poetry2nix_2": { + "inputs": { + "flake-utils": "flake-utils_4", + "nixpkgs": "nixpkgs_4" + }, + "locked": { + "lastModified": 1638854297, + "narHash": "sha256-mt5gMwAThp8FpcvRsKhs/y/VxLDNgH4MJJLlFbbs4gk=", + "owner": "nix-community", + "repo": "poetry2nix", + "rev": "a4b769203284c91529480adcbb4f17f04d3ff67b", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "poetry2nix", "type": "github" } }, @@ -216,8 +182,8 @@ "inputs": { "fcSpline": "fcSpline", "flake-utils": "flake-utils_3", - "mach-nix": "mach-nix_2", - "nixpkgs": "nixpkgs_4" + "nixpkgs": "nixpkgs_3", + "poetry2nix": "poetry2nix_2" } } }, diff --git a/flake.nix b/flake.nix index f1ede9a..9c4f3d5 100644 --- a/flake.nix +++ b/flake.nix @@ -3,56 +3,54 @@ inputs = { nixpkgs.url = "nixpkgs/nixos-unstable"; - mach-nix.url = "github:DavHau/mach-nix"; + poetry2nix.url = "github:nix-community/poetry2nix"; flake-utils.url = "github:numtide/flake-utils"; fcSpline.url = "github:vale981/fcSpline"; }; - outputs = { self, nixpkgs, flake-utils, mach-nix, fcSpline }: - let - python = "python39"; - devShell = pkgs: - pkgs.mkShell { - buildInputs = [ - (pkgs.${python}.withPackages - (ps: with ps; [ black mypy ])) - pkgs.nodePackages.pyright - ]; - }; + outputs = { self, nixpkgs, flake-utils, poetry2nix, fcSpline }: + (flake-utils.lib.eachDefaultSystem (system: + let + name = "stocproc"; + overlay = nixpkgs.lib.composeManyExtensions [ + poetry2nix.overlay - in flake-utils.lib.eachSystem ["x86_64-linux"] (system: - let - pkgs = nixpkgs.legacyPackages.${system}; - mach-nix-wrapper = import mach-nix { inherit pkgs python; }; + (final: prev: + let overrides = prev.poetry2nix.overrides.withDefaults + (self: super: { }); + in + { + ${name} = (prev.poetry2nix.mkPoetryApplication { + projectDir = ./.; + preferWheels = true; + overrides = overrides; + }); - fcSplinePkg = fcSpline.defaultPackage.${system}; + "${name}Shell" = (prev.poetry2nix.mkPoetryEnv { + projectDir = ./.; + overrides = overrides; + preferWheels = true; + editablePackageSources = { + ${name} = ./${name}; + }; + }); + }) - stocproc = (mach-nix-wrapper.buildPythonPackage rec { - src = ./.; - requirements = '' - numpy>=1.20 - scipy>=1.6 - mpmath>=1.2.0 - cython - ''; - pname = "stocproc"; - version = "1.0.1"; - propagatedBuildInputs = [fcSplinePkg]; - }); + ]; + pkgs = import nixpkgs { + inherit system; + overlays = [ overlay ]; + config.allowUnfree = true; + }; + in + rec { + packages = { + ${name} = pkgs.${name}; + }; - pythonShell = mach-nix-wrapper.mkPythonShell { - requirements = builtins.readFile ./requirements.txt; - }; - - mergeEnvs = envs: - pkgs.mkShell (builtins.foldl' (a: v: { - buildInputs = a.buildInputs ++ v.buildInputs; - nativeBuildInputs = a.nativeBuildInputs ++ v.nativeBuildInputs; - }) (pkgs.mkShell { }) envs); - - in { - devShell = mergeEnvs [ (devShell pkgs) pythonShell ]; - defaultPackage = stocproc; - packages.stocproc = stocproc; - }); + defaultPackage = packages.${name}; + devShell = pkgs."${name}Shell".env.overrideAttrs (oldAttrs: { + buildInputs = [ pkgs.poetry pkgs.black pkgs.pyright ]; + }); + })); } diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 0000000..75e498f --- /dev/null +++ b/poetry.lock @@ -0,0 +1,170 @@ +[[package]] +name = "cython" +version = "0.29.25" +description = "The Cython compiler for writing C extensions for the Python language." +category = "dev" +optional = false +python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" + +[[package]] +name = "fcspline" +version = "0.1" +description = "A fast cubic spline interpolator for real and complex data." +category = "main" +optional = false +python-versions = ">=3.9,<3.11" +develop = false + +[package.dependencies] +numpy = "^1.20.3" +scipy = "^1.7.3" + +[package.source] +type = "git" +url = "https://github.com/vale981/fcSpline" +reference = "master" +resolved_reference = "bd614e2ebd58be8338315c3b0d0999ff0afabff2" + +[[package]] +name = "mpmath" +version = "1.2.1" +description = "Python library for arbitrary-precision floating-point arithmetic" +category = "main" +optional = false +python-versions = "*" + +[package.extras] +develop = ["pytest (>=4.6)", "pycodestyle", "pytest-cov", "codecov", "wheel"] +tests = ["pytest (>=4.6)"] + +[[package]] +name = "numpy" +version = "1.21.4" +description = "NumPy is the fundamental package for array computing with Python." +category = "main" +optional = false +python-versions = ">=3.7,<3.11" + +[[package]] +name = "scipy" +version = "1.7.3" +description = "SciPy: Scientific Library for Python" +category = "main" +optional = false +python-versions = ">=3.7,<3.11" + +[package.dependencies] +numpy = ">=1.16.5,<1.23.0" + +[metadata] +lock-version = "1.1" +python-versions = ">=3.9,<3.11" +content-hash = "a43d0d8216b1df43926184346180f4b6d20fd52a77d9808a7a1120474fc9949e" + +[metadata.files] +cython = [ + {file = "Cython-0.29.25-cp27-cp27m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:08a502fe08756070276d841c830cfc37254a2383d0a5bea736ffb78eff613c88"}, + {file = "Cython-0.29.25-cp27-cp27m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:c204cb2d005a426c5c83309fd7edea335ff5c514ffa6dc72ddac92cfde170b69"}, + {file = "Cython-0.29.25-cp27-cp27mu-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:3913f6a50409ab36a5b8edbb4c3e4d441027f43150d8335e5118d34ef04c745c"}, + {file = "Cython-0.29.25-cp27-cp27mu-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:44cc749f288423182504a8fc8734070a369bf576734b9f0fafff40cd6b6e1b3e"}, + {file = "Cython-0.29.25-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:4f7b135cba0d2509890e1dcff2005585bc3d51c9f17564b70d8bc82dc7ec3a5e"}, + {file = "Cython-0.29.25-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:eb64ec369eba2207fbe618650d78d9af0455e0c1abb301ec024fa9f3e17a15cc"}, + {file = "Cython-0.29.25-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_24_i686.whl", hash = "sha256:6efb798993260532879f683dc8ce9e30fd1ec86f02c926f1238a8e6a64576321"}, + {file = "Cython-0.29.25-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:b8fc9c78262b140364ce1b28ac40ff505a47ac3fd4f86311d461df04a28b3f23"}, + {file = "Cython-0.29.25-cp35-cp35m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:3497e366ffed67454162d31bf4bd2ac3aa183dfac089eb4124966c9f98bd9c05"}, + {file = "Cython-0.29.25-cp35-cp35m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:b5b3e876e617fe2cf466d02198b76924dcda3cc162a1043226a9c181b9a662a6"}, + {file = "Cython-0.29.25-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:aa9e1fe5ee0a4f9d2430c1e0665f40b48f4b511150ca02f69e9bb49dc48d4e0e"}, + {file = "Cython-0.29.25-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:8726456c7e376410b3c631427da0a4affe1e481424436d1e3f1888cc3c0f8d2e"}, + {file = "Cython-0.29.25-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_24_i686.whl", hash = "sha256:191978e5839ca425eb78f0f60a84ad5db7a07b97e8076f9853d0d12c3ccec5d4"}, + {file = "Cython-0.29.25-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:a206a1f8ea11314e02dc01bf24f397b8f1b413bbcc0e031396caa1a126b060c2"}, + {file = "Cython-0.29.25-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:e6fa0a7cec9461c5ca687f3c4bb59cf2565afb76c60303b2dc8b280c6e112810"}, + {file = "Cython-0.29.25-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:f95433e6963164de372fc1ef01574d7419d96ce45274f296299267d874b90800"}, + {file = "Cython-0.29.25-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:4dc3d230849d61844e6b5737ee624c896f51e98c8a5d13f965b02a7e735230be"}, + {file = "Cython-0.29.25-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:3379e67113e92fef490a88eca685b07b711bb4db1ddce66af9e460673a5335cc"}, + {file = "Cython-0.29.25-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_24_i686.whl", hash = "sha256:0e9e28eb6bb19f5e25f4bf5c8f8ea7db3bc4910309fab2305e5c9c5a5223db77"}, + {file = "Cython-0.29.25-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:79d2f84a6d87d45ef580c0441b5394c4f29344e05126a8e2fb4ba4144425f3b0"}, + {file = "Cython-0.29.25-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:6759b73a9a1013cbdac71ebefa284aa50617b5b32957a54eedaa22ac2f6d48de"}, + {file = "Cython-0.29.25-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:07d5b8ce032110822dad2eb09950a98b9e255d14c2daf094be32d663790b3365"}, + {file = "Cython-0.29.25-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:5d0d97a5f661dccf2f9e14cf27fe9027f772d089fb92fdd3dd8a584d9b8a2916"}, + {file = "Cython-0.29.25-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:7b3f6e4cfcc103bccdcbc666f613d669ac378c8918629296cdf8191c0c2ec418"}, + {file = "Cython-0.29.25-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_24_i686.whl", hash = "sha256:e96857ab2dbd8a67852341001f1f2a1ef3f1939d82aea1337497a8f76a9d7f6c"}, + {file = "Cython-0.29.25-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:4ee99fab5191f403f33774fc92123291c002947338c2628b1ed42ed0017149dd"}, + {file = "Cython-0.29.25-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:d288f25e8abb43b1cfa2fe3d69b2d6236cca3ff6163d090e26c4b1e8ea80dfbf"}, + {file = "Cython-0.29.25-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:1c2f262f7d032ec0106534982609ae0148f86ba52fc747df64e645706af20926"}, + {file = "Cython-0.29.25-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:decd641167e97a3c1f973bf0bbb560d251809f6db8168c10edf94c0a1e5dec65"}, + {file = "Cython-0.29.25-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:800cbe944886320e4a4b623becb97960ae9d7d80f2d12980b83bcfb63ff47d5b"}, + {file = "Cython-0.29.25-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_24_i686.whl", hash = "sha256:3e94eb973f99c1963973a46dbd9e3974a03b8fe0af3de02dc5d65b4c6a6f9b3f"}, + {file = "Cython-0.29.25-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:64394ec94d9a0e5002f77e67ee8ceed97f25b483b18ea6aab547f4d82ca32ef6"}, + {file = "Cython-0.29.25-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:b6f397256cfab2d0f0af42659fca3232c23f5a570b6c21ed66aaac22dd95da15"}, + {file = "Cython-0.29.25-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:1825d6f2160188dfe1faa0099d30ed0e5ae56826627bf0de6dcb8dcbcf64c9bd"}, + {file = "Cython-0.29.25-py2.py3-none-any.whl", hash = "sha256:0cf7c3033349d10c5eb33ded1a78974f680e95c245a585c18a2046c67f8ed461"}, + {file = "Cython-0.29.25.tar.gz", hash = "sha256:a87cbe3756e7c464acf3e9420d8741e62d3b2eace0846cb39f664ad378aab284"}, +] +fcspline = [] +mpmath = [ + {file = "mpmath-1.2.1-py3-none-any.whl", hash = "sha256:604bc21bd22d2322a177c73bdb573994ef76e62edd595d17e00aff24b0667e5c"}, + {file = "mpmath-1.2.1.tar.gz", hash = "sha256:79ffb45cf9f4b101a807595bcb3e72e0396202e0b1d25d689134b48c4216a81a"}, +] +numpy = [ + {file = "numpy-1.21.4-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:8890b3360f345e8360133bc078d2dacc2843b6ee6059b568781b15b97acbe39f"}, + {file = "numpy-1.21.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:69077388c5a4b997442b843dbdc3a85b420fb693ec8e33020bb24d647c164fa5"}, + {file = "numpy-1.21.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e89717274b41ebd568cd7943fc9418eeb49b1785b66031bc8a7f6300463c5898"}, + {file = "numpy-1.21.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0b78ecfa070460104934e2caf51694ccd00f37d5e5dbe76f021b1b0b0d221823"}, + {file = "numpy-1.21.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:615d4e328af7204c13ae3d4df7615a13ff60a49cb0d9106fde07f541207883ca"}, + {file = "numpy-1.21.4-cp310-cp310-win_amd64.whl", hash = "sha256:1403b4e2181fc72664737d848b60e65150f272fe5a1c1cbc16145ed43884065a"}, + {file = "numpy-1.21.4-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:74b85a17528ca60cf98381a5e779fc0264b4a88b46025e6bcbe9621f46bb3e63"}, + {file = "numpy-1.21.4-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:92aafa03da8658609f59f18722b88f0a73a249101169e28415b4fa148caf7e41"}, + {file = "numpy-1.21.4-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:5d95668e727c75b3f5088ec7700e260f90ec83f488e4c0aaccb941148b2cd377"}, + {file = "numpy-1.21.4-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f5162ec777ba7138906c9c274353ece5603646c6965570d82905546579573f73"}, + {file = "numpy-1.21.4-cp37-cp37m-win32.whl", hash = "sha256:81225e58ef5fce7f1d80399575576fc5febec79a8a2742e8ef86d7b03beef49f"}, + {file = "numpy-1.21.4-cp37-cp37m-win_amd64.whl", hash = "sha256:32fe5b12061f6446adcbb32cf4060a14741f9c21e15aaee59a207b6ce6423469"}, + {file = "numpy-1.21.4-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:c449eb870616a7b62e097982c622d2577b3dbc800aaf8689254ec6e0197cbf1e"}, + {file = "numpy-1.21.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:2e4ed57f45f0aa38beca2a03b6532e70e548faf2debbeb3291cfc9b315d9be8f"}, + {file = "numpy-1.21.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:1247ef28387b7bb7f21caf2dbe4767f4f4175df44d30604d42ad9bd701ebb31f"}, + {file = "numpy-1.21.4-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:34f3456f530ae8b44231c63082c8899fe9c983fd9b108c997c4b1c8c2d435333"}, + {file = "numpy-1.21.4-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:4c9c23158b87ed0e70d9a50c67e5c0b3f75bcf2581a8e34668d4e9d7474d76c6"}, + {file = "numpy-1.21.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e4799be6a2d7d3c33699a6f77201836ac975b2e1b98c2a07f66a38f499cb50ce"}, + {file = "numpy-1.21.4-cp38-cp38-win32.whl", hash = "sha256:bc988afcea53e6156546e5b2885b7efab089570783d9d82caf1cfd323b0bb3dd"}, + {file = "numpy-1.21.4-cp38-cp38-win_amd64.whl", hash = "sha256:170b2a0805c6891ca78c1d96ee72e4c3ed1ae0a992c75444b6ab20ff038ba2cd"}, + {file = "numpy-1.21.4-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:fde96af889262e85aa033f8ee1d3241e32bf36228318a61f1ace579df4e8170d"}, + {file = "numpy-1.21.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:c885bfc07f77e8fee3dc879152ba993732601f1f11de248d4f357f0ffea6a6d4"}, + {file = "numpy-1.21.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:9e6f5f50d1eff2f2f752b3089a118aee1ea0da63d56c44f3865681009b0af162"}, + {file = "numpy-1.21.4-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:ad010846cdffe7ec27e3f933397f8a8d6c801a48634f419e3d075db27acf5880"}, + {file = "numpy-1.21.4-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:c74c699b122918a6c4611285cc2cad4a3aafdb135c22a16ec483340ef97d573c"}, + {file = "numpy-1.21.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9864424631775b0c052f3bd98bc2712d131b3e2cd95d1c0c68b91709170890b0"}, + {file = "numpy-1.21.4-cp39-cp39-win32.whl", hash = "sha256:b1e2312f5b8843a3e4e8224b2b48fe16119617b8fc0a54df8f50098721b5bed2"}, + {file = "numpy-1.21.4-cp39-cp39-win_amd64.whl", hash = "sha256:e3c3e990274444031482a31280bf48674441e0a5b55ddb168f3a6db3e0c38ec8"}, + {file = "numpy-1.21.4-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:a3deb31bc84f2b42584b8c4001c85d1934dbfb4030827110bc36bfd11509b7bf"}, + {file = "numpy-1.21.4.zip", hash = "sha256:e6c76a87633aa3fa16614b61ccedfae45b91df2767cf097aa9c933932a7ed1e0"}, +] +scipy = [ + {file = "scipy-1.7.3-1-cp310-cp310-macosx_12_0_arm64.whl", hash = "sha256:c9e04d7e9b03a8a6ac2045f7c5ef741be86727d8f49c45db45f244bdd2bcff17"}, + {file = "scipy-1.7.3-1-cp38-cp38-macosx_12_0_arm64.whl", hash = "sha256:b0e0aeb061a1d7dcd2ed59ea57ee56c9b23dd60100825f98238c06ee5cc4467e"}, + {file = "scipy-1.7.3-1-cp39-cp39-macosx_12_0_arm64.whl", hash = "sha256:b78a35c5c74d336f42f44106174b9851c783184a85a3fe3e68857259b37b9ffb"}, + {file = "scipy-1.7.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:173308efba2270dcd61cd45a30dfded6ec0085b4b6eb33b5eb11ab443005e088"}, + {file = "scipy-1.7.3-cp310-cp310-macosx_12_0_arm64.whl", hash = "sha256:21b66200cf44b1c3e86495e3a436fc7a26608f92b8d43d344457c54f1c024cbc"}, + {file = "scipy-1.7.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ceebc3c4f6a109777c0053dfa0282fddb8893eddfb0d598574acfb734a926168"}, + {file = "scipy-1.7.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f7eaea089345a35130bc9a39b89ec1ff69c208efa97b3f8b25ea5d4c41d88094"}, + {file = "scipy-1.7.3-cp310-cp310-win_amd64.whl", hash = "sha256:304dfaa7146cffdb75fbf6bb7c190fd7688795389ad060b970269c8576d038e9"}, + {file = "scipy-1.7.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:033ce76ed4e9f62923e1f8124f7e2b0800db533828c853b402c7eec6e9465d80"}, + {file = "scipy-1.7.3-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:4d242d13206ca4302d83d8a6388c9dfce49fc48fdd3c20efad89ba12f785bf9e"}, + {file = "scipy-1.7.3-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:8499d9dd1459dc0d0fe68db0832c3d5fc1361ae8e13d05e6849b358dc3f2c279"}, + {file = "scipy-1.7.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ca36e7d9430f7481fc7d11e015ae16fbd5575615a8e9060538104778be84addf"}, + {file = "scipy-1.7.3-cp37-cp37m-win32.whl", hash = "sha256:e2c036492e673aad1b7b0d0ccdc0cb30a968353d2c4bf92ac8e73509e1bf212c"}, + {file = "scipy-1.7.3-cp37-cp37m-win_amd64.whl", hash = "sha256:866ada14a95b083dd727a845a764cf95dd13ba3dc69a16b99038001b05439709"}, + {file = "scipy-1.7.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:65bd52bf55f9a1071398557394203d881384d27b9c2cad7df9a027170aeaef93"}, + {file = "scipy-1.7.3-cp38-cp38-macosx_12_0_arm64.whl", hash = "sha256:f99d206db1f1ae735a8192ab93bd6028f3a42f6fa08467d37a14eb96c9dd34a3"}, + {file = "scipy-1.7.3-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:5f2cfc359379c56b3a41b17ebd024109b2049f878badc1e454f31418c3a18436"}, + {file = "scipy-1.7.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:eb7ae2c4dbdb3c9247e07acc532f91077ae6dbc40ad5bd5dca0bb5a176ee9bda"}, + {file = "scipy-1.7.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:95c2d250074cfa76715d58830579c64dff7354484b284c2b8b87e5a38321672c"}, + {file = "scipy-1.7.3-cp38-cp38-win32.whl", hash = "sha256:87069cf875f0262a6e3187ab0f419f5b4280d3dcf4811ef9613c605f6e4dca95"}, + {file = "scipy-1.7.3-cp38-cp38-win_amd64.whl", hash = "sha256:7edd9a311299a61e9919ea4192dd477395b50c014cdc1a1ac572d7c27e2207fa"}, + {file = "scipy-1.7.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:eef93a446114ac0193a7b714ce67659db80caf940f3232bad63f4c7a81bc18df"}, + {file = "scipy-1.7.3-cp39-cp39-macosx_12_0_arm64.whl", hash = "sha256:eb326658f9b73c07081300daba90a8746543b5ea177184daed26528273157294"}, + {file = "scipy-1.7.3-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:93378f3d14fff07572392ce6a6a2ceb3a1f237733bd6dcb9eb6a2b29b0d19085"}, + {file = "scipy-1.7.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:edad1cf5b2ce1912c4d8ddad20e11d333165552aba262c882e28c78bbc09dbf6"}, + {file = "scipy-1.7.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5d1cc2c19afe3b5a546ede7e6a44ce1ff52e443d12b231823268019f608b9b12"}, + {file = "scipy-1.7.3-cp39-cp39-win32.whl", hash = "sha256:2c56b820d304dffcadbbb6cbfbc2e2c79ee46ea291db17e288e73cd3c64fefa9"}, + {file = "scipy-1.7.3-cp39-cp39-win_amd64.whl", hash = "sha256:3f78181a153fa21c018d346f595edd648344751d7f03ab94b398be2ad083ed3e"}, + {file = "scipy-1.7.3.tar.gz", hash = "sha256:ab5875facfdef77e0a47d5fd39ea178b58e60e454a4c85aa1e52fcb80db7babf"}, +] diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..9a6fe86 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,29 @@ +[tool.poetry] +description = "Generate continuous time stationary stochastic processes from a given auto correlation function." +name = "stocproc" +version = "1.0.1" +authors = ["Richard Hartmann "] +license = "BSD (3 clause)" +classifiers = [ +"Operating System :: OS Independent", +"License :: OSI Approved :: BSD License", +"Topic :: Utilities", +"Intended Audience :: Researcher" +] +repository = "https://github.com/cimatosa/stocproc" +build = 'build.py' + +[tool.poetry.dependencies] +python = ">=3.9,<3.11" +numpy = "^1.20.3" +scipy = "^1.7.3" +mpmath = "^1.2.1" +fcSpline = { git = "https://github.com/vale981/fcSpline" } + +[tool.poetry.dev-dependencies] +setuptools = "^59.5.0" +Cython = "^0.29.25" + +[build-system] +requires = ["poetry>=0.12", "cython", "setuptools", "numpy"] +build-backend = "poetry.core.masonry.api" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index d6be02d..0000000 --- a/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -numpy>=1.20 -scipy>=1.6 -mpmath>=1.2.0 -cython diff --git a/setup.py b/setup.py deleted file mode 100644 index 9ebadae..0000000 --- a/setup.py +++ /dev/null @@ -1,44 +0,0 @@ -from setuptools import setup -from Cython.Build import cythonize -import numpy as np - -author = u"Richard Hartmann" -authors = [author] -description = "Generate continuous time stationary stochastic processes from a given auto correlation function." -name = "stocproc" -version = "1.0.1" - -if __name__ == "__main__": - setup( - name=name, - author=author, - author_email="richard.hartmann@tu-dresden.de", - url="https://github.com/cimatosa/stocproc", - version=version, - packages=[name], - package_dir={name: name}, - license="BSD (3 clause)", - description=description, - long_description=description, - keywords=["stationary", "stochastic", "process", "random"], - classifiers=[ - "Programming Language :: Python :: 3.4", - "Programming Language :: Python :: 3.5", - "License :: OSI Approved :: BSD License", - "Topic :: Utilities", - "Intended Audience :: Researcher", - ], - platforms=["ALL"], - setup_requires=["cython>=0.29"], - install_requires=[ - "fcSpline>=0.1", - "numpy>=1.20", - "scipy>=1.6", - "mpmath>=1.2.0", - ], - dependency_links=[ - "https://raw.githubusercontent.com/cimatosa/fcSpline/master/egg/fcSpline-0.1-py3.4-linux-x86_64.egg" - ], - ext_modules=cythonize(["stocproc/stocproc_c.pyx"]), - include_dirs=[np.get_include()], - ) diff --git a/stocproc/__init__.py b/stocproc/__init__.py index a226d7a..5beb428 100644 --- a/stocproc/__init__.py +++ b/stocproc/__init__.py @@ -1,23 +1,3 @@ -__MAJOR__ = 1 -__MINOR__ = 0 -__PATCH__ = 0 - - -def version(): - """semantic version string with format 'MAJOR.MINOR' (https://semver.org/)""" - return "{}.{}".format(__MAJOR__, __MINOR__) - - -def version_full(): - """semantic version string with format 'MAJOR.MINOR.PATCH' (https://semver.org/)""" - return "{}.{}.{}".format(__MAJOR__, __MINOR__, __PATCH__) - - -import sys - -if sys.version_info.major < 3: - raise SystemError("no support for Python 2") - from .stocproc import logging_setup from .stocproc import StocProc # for typing from .stocproc import StocProc_FFT diff --git a/stocproc/tools.py b/stocproc/tools.py index 340d9bf..ab7dbee 100644 --- a/stocproc/tools.py +++ b/stocproc/tools.py @@ -2,7 +2,7 @@ from scipy.integrate import quad from scipy.optimize import bisect from functools import partial -from .stocproc_c import auto_correlation as auto_correlation_c +#from .stocproc_c import auto_correlation as auto_correlation_c import sys import os from warnings import warn