diff --git a/pkgs/development/python-modules/linearmodels/default.nix b/pkgs/development/python-modules/linearmodels/default.nix new file mode 100644 index 000000000000..c8f3b819959d --- /dev/null +++ b/pkgs/development/python-modules/linearmodels/default.nix @@ -0,0 +1,59 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + cython, + formulaic, + mypy-extensions, + numpy, + pandas, + pyhdfe, + pytestCheckHook, + scipy, + setuptools, + setuptools-scm, + statsmodels, +}: + +buildPythonPackage rec { + pname = "linearmodels"; + version = "6.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "bashtage"; + repo = "linearmodels"; + tag = "v${version}"; + hash = "sha256-oWVBsFSKnv/8AHYP5sxO6+u5+hsOw/uQlOetse5ue88="; + }; + + build-system = [ + setuptools + setuptools-scm + cython + ]; + + env.SETUPTOOLS_SCM_PRETEND_VERSION = version; + + dependencies = [ + formulaic + mypy-extensions + numpy + pandas + pyhdfe + scipy + statsmodels + ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + pythonImportsCheck = [ "linearmodels" ]; + + meta = { + description = "Models for panel data, system regression, instrumental variables and asset pricing"; + homepage = "https://bashtage.github.io/linearmodels/"; + changelog = "https://github.com/bashtage/linearmodels/releases/tag/v${version}"; + license = lib.licenses.ncsa; + maintainers = with lib.maintainers; [ jherland ]; + }; +} diff --git a/pkgs/development/python-modules/pyhdfe/default.nix b/pkgs/development/python-modules/pyhdfe/default.nix new file mode 100644 index 000000000000..6b887dceb83b --- /dev/null +++ b/pkgs/development/python-modules/pyhdfe/default.nix @@ -0,0 +1,41 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + numpy, + pytestCheckHook, + scipy, + setuptools, +}: + +buildPythonPackage rec { + pname = "pyhdfe"; + version = "0.2.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "jeffgortmaker"; + repo = "pyhdfe"; + tag = "v${version}"; + hash = "sha256-UXVQHf4Nmq/zQZtPaLba4TShhpgPUBwPM+zCEa8qaKs="; + }; + + build-system = [ setuptools ]; + + dependencies = [ + numpy + scipy + ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + pythonImportsCheck = [ "pyhdfe" ]; + + meta = { + description = "Python 3 implementation of algorithms for absorbing high dimensional fixed effects"; + homepage = "https://github.com/jeffgortmaker/pyhdfe"; + changelog = "https://github.com/jeffgortmaker/pyhdfe/releases/tag/v${version}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ jherland ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 91bf65d44fd2..0fa2df7e9269 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8440,6 +8440,8 @@ self: super: with self; { linear-operator = callPackage ../development/python-modules/linear-operator { }; + linearmodels = callPackage ../development/python-modules/linearmodels { }; + lineax = callPackage ../development/python-modules/lineax { }; linecache2 = callPackage ../development/python-modules/linecache2 { }; @@ -13140,6 +13142,8 @@ self: super: with self; { pyhcl = callPackage ../development/python-modules/pyhcl { }; + pyhdfe = callPackage ../development/python-modules/pyhdfe { }; + pyheck = callPackage ../development/python-modules/pyheck { }; pyheos = callPackage ../development/python-modules/pyheos { };