diff --git a/flake.nix b/flake.nix index e929e5e..ebed3d4 100644 --- a/flake.nix +++ b/flake.nix @@ -38,7 +38,9 @@ unified-planning = pkgs.python3Packages.callPackage ./pkgs/development/python-modules/unified-planning { }; blenderproc = pkgs.python3Packages.callPackage ./blenderproc.nix { }; webdataset = pkgs.python3Packages.callPackage ./pkgs/development/python-modules/webdataset { }; + ansitable = pkgs.python3Packages.callPackage ./pkgs/development/python-modules/ansitable { }; megapose6d = pkgs.python3Packages.callPackage ./pkgs/development/python-modules/megapose6d { webdataset = webdataset; }; + spatialmath = pkgs.python3Packages.callPackage ./pkgs/development/python-modules/spatialmath { ansitable = ansitable; }; slic3r = pkgs.callPackage ./pkgs/misc/slic3r { }; in { @@ -90,18 +92,24 @@ image-transport cv-bridge example-interfaces - ]) ++ (with pkgs; [ nlohmann_json glog lua5_3_compat ]) ++ [ megapose6d ]; + ]) ++ (with pkgs; [ nlohmann_json glog lua5_3_compat ]); RMW_IMPLEMENTATION = "rmw_fastrtps_dynamic_cpp"; }; devShells.all = pkgs.mkShell { packages = [ mayo blender bpy pysdf fstl darknet slic3r ]; }; - devShells.bpy = pkgs.mkShell { packages = [ bpy pysdf pkgs.freecad blender ]; }; - devShells.up = + devShells.rbs-framework = let - my-python-packages = p: with p; [ unified-planning ]; - in + my-python-packages = p: with p; [ + bpy + pysdf + unified-planning + pybullet + scipy + spatialmath + ]; + in pkgs.mkShell { packages = [ (pkgs.python3.withPackages my-python-packages) ]; }; diff --git a/pkgs/development/python-modules/ansitable/default.nix b/pkgs/development/python-modules/ansitable/default.nix new file mode 100644 index 0000000..86e78a4 --- /dev/null +++ b/pkgs/development/python-modules/ansitable/default.nix @@ -0,0 +1,33 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, colored +, numpy +}: + +buildPythonPackage rec { + pname = "ansitable"; + version = "0.9.7"; + format = "setuptools"; + + src = fetchFromGitHub { + owner = "petercorke"; + repo = "ansitable"; + rev = version; + hash = "sha256-LRSdnHLcmQfwSpxnd3JjaLzpECWWnzi8aWLanu9qRUI="; + }; + + propagatedBuildInputs = [ + colored + numpy + ]; + + pythonImportsCheck = [ "ansitable" ]; + + meta = with lib; { + description = "Quick, easy and pretty display of tabular data or matrices, with optional ANSI color and borders"; + homepage = "https://github.com/petercorke/ansitable"; + license = licenses.mit; + maintainers = with maintainers; [ ]; + }; +} diff --git a/pkgs/development/python-modules/spatialmath/default.nix b/pkgs/development/python-modules/spatialmath/default.nix new file mode 100644 index 0000000..9d4101a --- /dev/null +++ b/pkgs/development/python-modules/spatialmath/default.nix @@ -0,0 +1,71 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, setuptools +, ansitable +, matplotlib +, numpy +, scipy +, typing-extensions +, coverage +, flake8 +, pytest +, pytest-timeout +, pytest-xvfb +, sympy +, sphinx +, sphinx-autodoc-typehints +, sphinx-rtd-theme +, sphinxcontrib-jsmath +}: + +buildPythonPackage rec { + pname = "spatialmath"; + version = "unstable-2023-06-07"; + format = "pyproject"; + + src = fetchFromGitHub { + owner = "petercorke"; + repo = "spatialmath-python"; + rev = "0a7761dcd563e91eb55e75d8f0b2a93198762315"; + hash = "sha256-kawe9yHX7T+Bvy7BfuKbotEjlnpynQAooBsynGJSfjo="; + }; + + nativeBuildInputs = [ + setuptools + ]; + + propagatedBuildInputs = [ + ansitable + matplotlib + numpy + scipy + typing-extensions + ]; + + passthru.optional-dependencies = { + dev = [ + coverage + flake8 + pytest + pytest-timeout + pytest-xvfb + sympy + ]; + docs = [ + sphinx + sphinx-autodoc-typehints + sphinx-rtd-theme + sphinxcontrib-jsmath + ]; + }; + + pythonImportsCheck = [ "spatialmath" ]; + + meta = with lib; { + description = "Create, manipulate and convert representations of position and orientation in 2D or 3D using Python"; + homepage = "https://github.com/petercorke/spatialmath-python"; + license = licenses.mit; + maintainers = with maintainers; [ ]; + }; +}