This file contains 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/bash | |
# assuming that config.yml, the unit file and this are in ~/arvados/tmp. | |
mv ~/arvados/tmp/config.yml ~/arvados/ | |
# Create environment file with config-path setting. | |
echo ARVADOS_CONFIG=/home/$USER/arvados/config.yml >> ~/arvados/environment | |
# crunch-dispatch-slurm service unit file goes here | |
mkdir -p ~/.config/systemd/user/ |
This file contains 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 numpy as np | |
import matplotlib.pyplot as plt | |
from matplotlib.patches import Ellipse | |
import matplotlib.transforms as transforms | |
def confidence_ellipse(x, y, ax, n_std=3.0, facecolor='none', **kwargs): | |
""" | |
Create a plot of the covariance confidence ellipse of `x` and `y` | |
See how and why this works: https://carstenschelp.github.io/2018/09/14/Plot_Confidence_Ellipse_001.html |
This file contains 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 numpy as np | |
from numpy import cos, sin | |
import matplotlib.pyplot as plt | |
""" | |
Looking at the covariance ellipse as a Lissajous figure. | |
In this gist: https://gist.github.com/CarstenSchelp/b992645537660bda692f218b562d0712 | |
I plot a 2-D covariance ellipse by | |
- normalizing the covariance matrix to contain only two ones, on the diagonal, and a pearson coefficient |
This file contains 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 arctan2 funtion returns an angle between -PI and +PI (radians) | |
# If you need a range from zero to 2PI, this is how the | |
# arctan2 result can be converted. | |
# Zero still means "aligned with the 'x' axis" | |
# And the angle is still to be interpreted counter-clockwise. | |
import numpy as np | |
def arctan2_2pi(y, x): | |
return -1 * ( |
This file contains 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
''' | |
A simple interactive file selection class based on IPython "Selection" widget. | |
Navigates through directories and displays all files that match the "file_pattern" | |
parameter. | |
''' | |
import ipywidgets as widgets | |
import glob | |
import os | |
class FileSelection: |
This file contains 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
''' | |
Convert .net-style ticks to posix or python datetime. | |
.net ticks (like in C#) are 100 nanosecond counts | |
starting from january 1st in year 0001 | |
This one is not very thorougly tested but worked for me when I needed it. | |
''' | |
import datetime | |
_epoch = datetime.date(1970, 1 , 1) | |
_dotnet_minvalue = datetime.date(1, 1, 1) |
This file contains 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 numpy as np | |
class OnlineCovariance: | |
""" | |
A class to calculate the mean and the covariance matrix | |
of the incrementally added data. | |
The implementation is fully vectorized, which means that | |
no for-loops or indices are involved when processing | |
vectors and matrices. | |
This gist attempts to cleanly implement and extend this |
This file contains 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 numpy as np | |
import matplotlib.pyplot as plt | |
from matplotlib.patches import Ellipse | |
import matplotlib.transforms as transforms | |
def confidence_ellipse(x, y, ax, n_std=3.0, facecolor='none', **kwargs): | |
""" | |
Create a plot of the covariance confidence ellipse of `x` and `y` | |
See how and why this works: https://carstenschelp.github.io/2018/09/14/Plot_Confidence_Ellipse_001.html |