Skip to content

Instantly share code, notes, and snippets.

@alinaselega
Created January 23, 2020 20:02
Show Gist options
  • Save alinaselega/c74c4bcf6a5392a5e3bf98d9095fd6bf to your computer and use it in GitHub Desktop.
Save alinaselega/c74c4bcf6a5392a5e3bf98d9095fd6bf to your computer and use it in GitHub Desktop.
Reference for how to Include commit information in a notebook for reproducibility.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This notebook is a reference for how to include the current commit on the repo for reproducibility.\n",
"\n",
"One includes the commit as follows (provided the notebook is created in the right repo):"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"9407799\r\n"
]
}
],
"source": [
"!git rev-parse --short HEAD"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This is indeed the latest commit in my repo 'clones-'from-scrna', which is where this notebook is in."
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'/h/aselega/Projects/clones-from-scrna/segmentation'"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"pwd"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment