Skip to content

Commit

Permalink
feat: First working version of Bayes3D in Ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
srounce committed Jul 9, 2024
1 parent 66ff185 commit 9c31e28
Show file tree
Hide file tree
Showing 9 changed files with 90 additions and 70 deletions.
16 changes: 8 additions & 8 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 9 additions & 11 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";

nixpkgs.url = "github:zimbatm/nixpkgs?ref=jax-fixes";
nixpkgs.url = "github:NixOS/nixpkgs?ref=d8724afca4565614164dd81345f6137c4c6eab21";
nixpkgs-llvm-10.url = "github:NixOS/nixpkgs?rev=222c1940fafeda4dea161858ffe6ebfc853d3db5";

genjax.url = "github:probcomp/genjax?ref=v0.1.1";
Expand Down Expand Up @@ -134,30 +134,28 @@
inherit packages;

legacyPackages.python3Packages =
(pkgs.python3Packages.overrideScope pythonOverrides).overrideScope (super: superPython:
(pkgs.python311Packages.overrideScope pythonOverrides).overrideScope (super: superPython:
loadPackages super.callPackage ./pkgs/python-modules
);

devShells.default = pkgs.mkShell {
packages = with pkgs; [
packages = [
self'.legacyPackages.python3Packages.python-lsp-server
(python3.withPackages (ps: with self'.legacyPackages.python3Packages; [
jupyter
bayes3d
jax
scipy
pyransac3d
(self'.legacyPackages.python3Packages.python.withPackages (p: [
self'.legacyPackages.python3Packages.bayes3d
self'.legacyPackages.python3Packages.jax
p.jupyter
p.scipy
]))
];

shellHook = ''
export EXTRA_LDFLAGS="-L/lib -L${pkgs.linuxPackages.nvidia_x11}/lib"
export EXTRA_CCFLAGS="-I/usr/include"
export CUDA_PATH=${pkgs.cudatoolkit_11}
export B3D_ASSETS_PATH="${bayes3d.src}/assets"
export B3D_ASSET_PATH="${bayes3d.src}/assets"
jupyter notebook
exit
'';
};
};
Expand Down
Empty file added notebooks/assets/.gitkeep
Empty file.
74 changes: 48 additions & 26 deletions notebooks/demo.ipynb

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion pkgs/python-modules/distinctipy/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{ fetchPypi
, python3Packages
, buildPythonPackage
, setuptools
, numpy
Expand Down
29 changes: 13 additions & 16 deletions pkgs/python-modules/open3d/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{ stdenv
, lib
, pkgs
, python3Packages
, fetchPypi
, fetchurl

Expand All @@ -10,9 +9,21 @@
, zip

, autoPatchelfHook
, python
, tensorflow-bin
, libusb
, cudaPackages_11
, buildPythonPackage
, ipywidgets
, matplotlib
, numpy
, pandas
, plyfile
, pytorchWithCuda
, pyyaml
, scikitlearn
, scipy
, tqdm

, libGL
, libglvnd
Expand All @@ -24,20 +35,6 @@
, runCommand
}:
let
inherit (python3Packages)
buildPythonPackage
ipywidgets
matplotlib
numpy
pandas
plyfile
pytorchWithCuda
pyyaml
scikitlearn
scipy
tqdm
;

libllvm-wrapped =
let
libllvm = llvmPackages_10.libllvm.lib;
Expand Down Expand Up @@ -141,7 +138,7 @@ let
};
};

pyVersion = lib.versions.majorMinor python3Packages.python.version;
pyVersion = lib.versions.majorMinor python.version;
srcInputs = prebuiltSrcs."${pyVersion}-${stdenv.system}" or (throw "open3d-bin for Python version '${pyVersion}' is not supported on '${stdenv.system}'");

src = fetchPypi rec {
Expand Down
4 changes: 2 additions & 2 deletions pkgs/python-modules/parsable/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
fetchPypi,
python3Packages
buildPythonPackage
}:
python3Packages.buildPythonPackage rec {
buildPythonPackage rec {
pname = "parsable";
version = "0.3.1";
format = "setuptools";
Expand Down
7 changes: 4 additions & 3 deletions pkgs/python-modules/pymetis/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{ fetchPypi
, python3Packages
, buildPythonPackage
, pybind11
}:
python3Packages.buildPythonPackage rec {
buildPythonPackage rec {
pname = "PyMetis";
version = "2023.1.1";
format = "setuptools";
Expand All @@ -14,6 +15,6 @@ python3Packages.buildPythonPackage rec {
doCheck = false;

nativeBuildInputs = [
python3Packages.pybind11
pybind11
];
}
9 changes: 6 additions & 3 deletions pkgs/python-modules/pyransac3d/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{ fetchFromGitHub
, python3
, buildPythonPackage
, setuptools
, wheel
, numpy
}:
# TODO: upstream me
buildPythonPackage rec {
Expand All @@ -16,11 +19,11 @@ buildPythonPackage rec {
};

nativeBuildInputs = [
python3.pkgs.setuptools
python3.pkgs.wheel
setuptools
wheel
];

propagatedBuildInputs = with python3.pkgs; [
propagatedBuildInputs = [
numpy
];

Expand Down

0 comments on commit 9c31e28

Please sign in to comment.