recopytex/templates/tpl_evaluation.ipynb

103 lines
2.1 KiB
Plaintext

{
"cells": [
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"from IPython.display import Markdown as md\n",
"from IPython.display import DisplayHandle\n",
"import pandas as pd\n",
"from pathlib import Path\n",
"from datetime import datetime"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"tags": [
"parameters"
]
},
"outputs": [],
"source": [
"tribe = \"308\"\n",
"assessment = \"161114_dm2\"\n",
"csv_file = Path(f\"./sheets/{tribe}/{assessment}.csv\")"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
"split_ass = assessment.split(\"_\")\n",
"if len(split_ass) > 1:\n",
" date, *assessment = assessment.split(\"_\")\n",
" date = datetime.strptime(date, \"%y%m%d\")\n",
" assessment = ' '.join(assessment)\n",
"else:\n",
" date = None\n",
" assessment = split_ass[0]"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"data": {
"text/markdown": [
"# dm2 (14/11/2016) pour 308"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"if date is None:\n",
" display(md(f\"# {assessment} pour {tribe}\"))\n",
"else:\n",
" display(md(f\"# {assessment} ({date:%d/%m/%Y}) pour {tribe}\"))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"celltoolbar": "Tags",
"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.7.4"
}
},
"nbformat": 4,
"nbformat_minor": 2
}