diff --git a/pkgs/development/python-modules/echo/default.nix b/pkgs/development/python-modules/echo/default.nix new file mode 100644 index 000000000000..af3a3d43a6d7 --- /dev/null +++ b/pkgs/development/python-modules/echo/default.nix @@ -0,0 +1,63 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pythonOlder +, setuptools +, setuptools-scm +, libxcrypt +, numpy +, qt6 +, qtpy +, pyqt6 +, pytestCheckHook +, pytest-cov +}: + +buildPythonPackage rec { + pname = "echo"; + version = "0.8.0"; + + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "glue-viz"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-0FmUA7kOFSRZXwbj8d7asujBPOjE2pFhu6TDNSGD4r0="; + }; + + nativeBuildInputs = [ setuptools setuptools-scm qt6.wrapQtAppsHook ]; + + buildInputs = lib.optionals (pythonOlder "3.9") [ + libxcrypt + ]; + + propagatedBuildInputs = [ + qt6.qtconnectivity + qt6.qtbase + qt6.qttools + pyqt6 + numpy + qtpy + ]; + + env.SETUPTOOLS_SCM_PRETEND_VERSION = version; + + # collecting ... qt.qpa.xcb: could not connect to display + # qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. + doCheck = false; + + nativeCheckInputs = [ + pytestCheckHook + pytest-cov + ]; + + pythonImportsCheck = [ "echo" ]; + + meta = with lib; { + homepage = "https://github.com/glue-viz/echo"; + description = "Callback Properties in Python"; + license = licenses.mit; + maintainers = with maintainers; [ ifurther ]; + }; +} diff --git a/pkgs/development/python-modules/fast-histogram/default.nix b/pkgs/development/python-modules/fast-histogram/default.nix new file mode 100644 index 000000000000..fd00ff5df8e2 --- /dev/null +++ b/pkgs/development/python-modules/fast-histogram/default.nix @@ -0,0 +1,54 @@ +{ lib +, buildPythonPackage +, pytestCheckHook +, fetchFromGitHub +, python +, pythonOlder +, setuptools +, setuptools-scm +, numpy +, wheel +, hypothesis +, pytest-cov +}: + +buildPythonPackage rec { + pname = "fast-histogram"; + version = "0.12"; + + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "astrofrog"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-Cz4BgbtxbUPxL2NSzvZYjbYIN4KUuliUV0bXRRtyvfM="; + }; + + nativeBuildInputs = [ + setuptools + setuptools-scm + wheel + ]; + + propagatedBuildInputs = [ numpy ]; + + nativeCheckInputs = [ + pytestCheckHook + hypothesis + pytest-cov + ]; + + pytestFlagsArray = [ "${builtins.placeholder "out"}/${python.sitePackages}" ]; + + env.SETUPTOOLS_SCM_PRETEND_VERSION = version; + + pythonImportsCheck = [ "fast_histogram" ]; + + meta = with lib; { + homepage = "https://github.com/astrofrog/fast-histogram"; + description = "Fast 1D and 2D histogram functions in Python"; + license = licenses.bsd2; + maintainers = with maintainers; [ ifurther ]; + }; +} diff --git a/pkgs/development/python-modules/glueviz/default.nix b/pkgs/development/python-modules/glueviz/default.nix new file mode 100644 index 000000000000..c6fb2859b413 --- /dev/null +++ b/pkgs/development/python-modules/glueviz/default.nix @@ -0,0 +1,87 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pythonOlder +, dill +, astropy +, numpy +, pandas +, qt6 +, pyqt6 +, pyqt-builder +, qtconsole +, setuptools +, setuptools-scm +, scipy +, ipython +, ipykernel +, h5py +, matplotlib +, xlrd +, mpl-scatter-density +, pvextractor +, openpyxl +, echo +, pytest +, pytest-flakes +, pytest-cov +}: + +buildPythonPackage rec { + pname = "glueviz"; + version = "1.14.1"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "glue-viz"; + repo = "glue"; + rev = "refs/tags/v${version}"; + sha256 = "sha256-pHUcvyDziE7l0foEz7cygMuAwggnIWzsQy9SFZCDkXA="; + }; + + buildInputs = [ pyqt-builder ]; + nativeBuildInputs = [ setuptools setuptools-scm qt6.wrapQtAppsHook ]; + propagatedBuildInputs = [ + astropy + dill + setuptools + scipy + numpy + matplotlib + pandas + pyqt6 + qtconsole + ipython + ipykernel + h5py + xlrd + mpl-scatter-density + pvextractor + openpyxl + echo + ]; + + dontConfigure = true; + + env.SETUPTOOLS_SCM_PRETEND_VERSION = version; + + # collecting ... qt.qpa.xcb: could not connect to display + # qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. + doCheck = false; + + nativeCheckInputs = [ pytest pytest-flakes pytest-cov ]; + + pythonImportsCheck = [ "glue" ]; + + preFixup = '' + makeWrapperArgs+=("''${qtWrapperArgs[@]}") + ''; + + meta = with lib; { + homepage = "https://glueviz.org"; + description = "Linked Data Visualizations Across Multiple Files"; + license = licenses.bsd3; # https://github.com/glue-viz/glue/blob/main/LICENSE + maintainers = with maintainers; [ ifurther ]; + }; +} diff --git a/pkgs/development/python-modules/mpl-scatter-density/default.nix b/pkgs/development/python-modules/mpl-scatter-density/default.nix new file mode 100644 index 000000000000..f0523c3594dc --- /dev/null +++ b/pkgs/development/python-modules/mpl-scatter-density/default.nix @@ -0,0 +1,67 @@ +{ lib +, buildPythonPackage +, pytestCheckHook +, fetchFromGitHub +, fetchpatch +, pythonOlder +, setuptools-scm +, setuptools +, fast-histogram +, matplotlib +, numpy +, wheel +, pytest-mpl +}: + +buildPythonPackage rec { + pname = "mpl-scatter-density"; + version = "0.7"; + + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "astrofrog"; + repo = pname; + rev = "refs/tags/v${version}"; + sha256 = "sha256-MMxM+iv5p9ZLcBpqa3tBBPbsMM/PTg6BXaDpGgSw+DE="; + }; + + patches = [ + # https://github.com/astrofrog/mpl-scatter-density/pull/37 + (fetchpatch { + name = "distutils-removal.patch"; + url = "https://github.com/ifurther/mpl-scatter-density/commit/6feedabe1e82da67d8eec46a80eb370d9f334251.patch"; + sha256 = "sha256-JqWlSm8mIwqjRPa+kMEaKipJyzGEO+gJK+Q045N1MXA="; + }) + ]; + + nativeBuildInputs = [ + setuptools + setuptools-scm + wheel + ]; + + propagatedBuildInputs = [ matplotlib numpy fast-histogram ]; + + env.SETUPTOOLS_SCM_PRETEND_VERSION = version; + + nativeCheckInputs = [ + pytestCheckHook + pytest-mpl + ]; + + disabledTests = [ + # AssertionError: (240, 240) != (216, 216) + # Erroneous pinning of figure DPI, sensitive to runtime environment + "test_default_dpi" + ]; + + pythonImportsCheck = [ "mpl_scatter_density" ]; + + meta = with lib; { + homepage = "https://github.com/astrofrog/mpl-scatter-density"; + description = "Fast scatter density plots for Matplotlib"; + license = licenses.bsd2; + maintainers = with maintainers; [ ifurther ]; + }; +} diff --git a/pkgs/development/python-modules/pvextractor/default.nix b/pkgs/development/python-modules/pvextractor/default.nix new file mode 100644 index 000000000000..315d0411b8e9 --- /dev/null +++ b/pkgs/development/python-modules/pvextractor/default.nix @@ -0,0 +1,61 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pythonOlder +, astropy +, qtpy +, pyqt6 +, pyqt-builder +, setuptools +, setuptools-scm +, scipy +, matplotlib +, spectral-cube +, pytestCheckHook +, pytest-astropy +}: + +buildPythonPackage rec { + pname = "pvextractor"; + version = "0.3"; + + disabled = pythonOlder "3.5"; + + src = fetchFromGitHub { + owner = "radio-astro-tools"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-HYus2Gk3hzKq+3lJLOJQ+EE6LeO+DrvqLK3NpqrUYeI="; + }; + + buildInputs = [ pyqt-builder ]; + nativeBuildInputs = [ setuptools setuptools-scm ]; + propagatedBuildInputs = [ + astropy + scipy + matplotlib + pyqt6 + qtpy + spectral-cube + ]; + + env.SETUPTOOLS_SCM_PRETEND_VERSION = version; + + # collecting ... qt.qpa.xcb: could not connect to display + # qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. + doCheck = false; + + nativeCheckInputs = [ + pytestCheckHook + pytest-astropy + ]; + + pythonImportsCheck = [ "pvextractor" ]; + + meta = with lib; { + homepage = "http://pvextractor.readthedocs.io"; + description = "Position-velocity diagram extractor"; + license = licenses.bsd3; + maintainers = with maintainers; [ ifurther ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index d90be69e9bca..77430d7d5584 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3441,6 +3441,8 @@ self: super: with self; { ecdsa = callPackage ../development/python-modules/ecdsa { }; + echo = callPackage ../development/python-modules/echo { }; + ecoaliface = callPackage ../development/python-modules/ecoaliface { }; ecos = callPackage ../development/python-modules/ecos { }; @@ -3803,6 +3805,8 @@ self: super: with self; { fastapi-mail = callPackage ../development/python-modules/fastapi-mail { }; + fast-histogram = callPackage ../development/python-modules/fast-histogram { }; + fastavro = callPackage ../development/python-modules/fastavro { }; fastbencode = callPackage ../development/python-modules/fastbencode { }; @@ -4508,6 +4512,8 @@ self: super: with self; { glom = callPackage ../development/python-modules/glom { }; + glueviz = callPackage ../development/python-modules/glueviz { }; + glymur = callPackage ../development/python-modules/glymur { }; gmpy2 = callPackage ../development/python-modules/gmpy2 { }; @@ -7074,6 +7080,8 @@ self: super: with self; { mplleaflet = callPackage ../development/python-modules/mplleaflet { }; + mpl-scatter-density = callPackage ../development/python-modules/mpl-scatter-density { }; + mpmath = callPackage ../development/python-modules/mpmath { }; mpris-server = callPackage ../development/python-modules/mpris-server { }; @@ -9696,6 +9704,8 @@ self: super: with self; { pushover-complete = callPackage ../development/python-modules/pushover-complete { }; + pvextractor = callPackage ../development/python-modules/pvextractor { }; + pvlib = callPackage ../development/python-modules/pvlib { }; pvo = callPackage ../development/python-modules/pvo { };