This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import collections | |
from datajoint.table import FreeTable | |
class _RenameMap(tuple): | |
""" for internal use """ | |
pass | |
def check_dep(table, restr=None): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [[ $# -ne 2 ]] ; then | |
echo "Usage: git-split.sh original copy" | |
exit 0 | |
fi | |
git mv $1 $2 | |
git commit -n -m "Split history $1 to $2" | |
REV=`git rev-parse HEAD` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# importing the tables here is a trick to get IntelliSense to work | |
from nnfabrik.main import Fabrikant, Trainer, Dataset, Model, Seed, my_nnfabrik | |
# define nnfabrik tables here | |
my_nnfabrik("nnexplore_nnfabrik", context=locals()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datajoint as dj | |
from getpass import getpass | |
def clone_conn(conn): | |
conn_info = conn.conn_info | |
return dj.Connection(host=conn_info['host'], user=conn_info['user'], password=conn_info['passwd'], | |
init_fun=conn.init_fun, use_tls=conn_info['ssl']) | |
conn2 = clone_conn(dj.conn()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mysql = require('promise-mysql'); // use promisified version of mysql connector | |
const config = require('./config'); | |
const _ = require('lodash'); | |
const db_conn = { | |
host: config.dbHost, | |
user: config.dbUser, | |
password: config.dbPass | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cmocean | |
import numpy as np | |
# resolution of the pin wheel - gives back reolution x resolution image | |
resolution = 1000 | |
xv, yv = np.meshgrid(np.linspace(-1, 1, resolution), np.linspace(-1, 1, resolution)) | |
theta = np.arctan2(yv, xv) | |
r = np.sqrt(yv**2 + xv**2) | |
fig = plt.figure(dpi=300) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
The following is provided as a convenience utility to be able to add/drop non primary key attributes | |
to an existing DataJoint table. Both function should work as is - you can simply copy and paste them and | |
start using it without worrying about importing dependencies. | |
WARNING! These functions are NOT officially supported by DataJoint and make use of DataJoint internal logic | |
that is considered to be NOT part of the public API. These functions may cease to work or worse yet result | |
in unexpected results without any prior notice, and therefore should be used with atmost care. | |
We are working to add such "ALTER" method to DataJoint Python officially, and you can track the discussion/progress |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Modifies the "base" `docker-compose.yml` file to make use of NVIDIA GPUs as made | |
# available through `nvidia-docker`. If you execute this script without any argument, | |
# it will look for `docker-compose.yml.base` file in the current directory and | |
# creates `docker-compose.yml` with appropraite devices, volumes, etc, while | |
# incorporating existing configurations as found in `docker-compose.yml.base`. | |
# Alternatively, you can invoke the script as: | |
# $ ./nvidia-docker-compose filename | |
# which will base the creation of `docker-compose.yml` on the passed in | |
# `filename` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Configure Vundle {{{ | |
set nocompatible " be iMproved, required | |
filetype off " required | |
set runtimepath+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() " installs plugins in default location | |
" let Vundle manage Vundle | |
" Required: | |
Plugin 'VundleVim/Vundle.vim' |