Skip to content

Instantly share code, notes, and snippets.

@wd15
Last active May 23, 2022 20:10
Show Gist options
  • Save wd15/3cfcde2aaf878ba74184a9dee42efeec to your computer and use it in GitHub Desktop.
Save wd15/3cfcde2aaf878ba74184a9dee42efeec to your computer and use it in GitHub Desktop.
misc
dask-worker-space
.local

Active Learning Hacking

Repository for active learning hacks

Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#
# $ nix-shell --pure --arg withBoost false --argstr tag 20.09
#
{
tag ? "20.09",
pymksVersion ? "cf653e004848c9c68ca31a85add0d1ac8611a93f"
}:
let
pkgs = import (builtins.fetchTarball "https://github.com/NixOS/nixpkgs/archive/${tag}.tar.gz") {};
pymkssrc = builtins.fetchTarball "https://github.com/materialsinnovation/pymks/archive/${pymksVersion}.tar.gz";
pymks = pypkgs.callPackage "${pymkssrc}/default.nix" { graspi = null; };
pypkgs = pkgs.python3Packages;
extra = with pypkgs; [ black pylint flake8 ipywidgets zarr pymks h5py ];
in
(pymks.overridePythonAttrs (old: rec {
propagatedBuildInputs = old.propagatedBuildInputs;
nativeBuildInputs = propagatedBuildInputs ++ extra;
postShellHook = ''
export OMPI_MCA_plm_rsh_agent=${pkgs.openssh}/bin/ssh
SOURCE_DATE_EPOCH=$(date +%s)
export PYTHONUSERBASE=$PWD/.local
export USER_SITE=`python -c "import site; print(site.USER_SITE)"`
export PYTHONPATH=$PYTHONPATH:$USER_SITE
export PATH=$PATH:$PYTHONUSERBASE/bin
jupyter nbextension install --py widgetsnbextension --user > /dev/null 2>&1
jupyter nbextension enable widgetsnbextension --user --py > /dev/null 2>&1
pip install jupyter_contrib_nbextensions --user > /dev/null 2>&1
jupyter contrib nbextension install --user > /dev/null 2>&1
jupyter nbextension enable spellchecker/main > /dev/null 2>&1
pip install --user nbqa
pip install --user tqdm
pip install --user modAL
'';
}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment