Skip to content

Commit

Permalink
Update fikalist
Browse files Browse the repository at this point in the history
  • Loading branch information
cescalara committed Sep 29, 2019
1 parent 55fa9ec commit 9da7e62
Show file tree
Hide file tree
Showing 2 changed files with 126 additions and 97 deletions.
211 changes: 114 additions & 97 deletions fikalist.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 1,
"metadata": {
"ExecuteTime": {
"end_time": "2019-04-08T18:06:12.380986Z",
"start_time": "2019-04-08T18:06:12.112992Z"
"end_time": "2019-09-29T18:31:18.794591Z",
"start_time": "2019-09-29T18:31:18.389346Z"
}
},
"outputs": [],
Expand Down Expand Up @@ -48,8 +48,8 @@
"execution_count": 25,
"metadata": {
"ExecuteTime": {
"end_time": "2019-04-08T18:09:52.288468Z",
"start_time": "2019-04-08T18:09:52.280848Z"
"end_time": "2019-09-29T18:43:06.313149Z",
"start_time": "2019-09-29T18:43:06.301170Z"
}
},
"outputs": [
Expand Down Expand Up @@ -106,26 +106,40 @@
"execution_count": 26,
"metadata": {
"ExecuteTime": {
"end_time": "2019-04-08T18:09:53.072721Z",
"start_time": "2019-04-08T18:09:53.069015Z"
"end_time": "2019-09-29T18:43:07.062790Z",
"start_time": "2019-09-29T18:43:07.053502Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Alex is not in the list of providers...\n"
"Welcome, Rabia!\n",
"Welcome, Fredrik!\n",
"Welcome, Mattias!\n",
"Welcome, Marcus!\n",
"Welcome, Manojit!\n",
"Farewell, Christer!\n",
"Farewell, Linda!\n",
"Farewell, Rupal!\n",
"Farewell, Francesca!\n",
"Farewell, Björn!\n",
"Linda is not in the list of providers...\n"
]
}
],
"source": [
"# update by adding and removing people, use lists if you like.\n",
"# I think everyone is the same right now...\n",
"#fikalist.providers.add('Giulia')\n",
"fikalist.providers.add(['Rabia', 'Fredrik']) # new PhD student/Engineer!\n",
"fikalist.providers.add(['Mattias', 'Marcus', 'Manojit']) # Theory people!\n",
"fikalist.providers.remove(['Christer', 'Linda', 'Rupal'])\n",
"\n",
"# Remove myself and Bjorn as we will do next week\n",
"fikalist.providers.remove(['Francesca', 'Björn'])\n",
"\n",
"# FikaList even handles your errors\n",
"fikalist.providers.remove('Bjorn')"
"fikalist.providers.remove('Linda')"
]
},
{
Expand All @@ -144,14 +158,17 @@
"execution_count": 27,
"metadata": {
"ExecuteTime": {
"end_time": "2019-04-08T18:09:53.971471Z",
"start_time": "2019-04-08T18:09:53.968462Z"
"end_time": "2019-09-29T18:43:07.913411Z",
"start_time": "2019-09-29T18:43:07.909582Z"
}
},
"outputs": [],
"source": [
"# Example of how to bump up someone who has just arrived\n",
"#fikalist.constraints.add('Giulia', 'just arrived')\n",
"#fikalist.constraints.add('Francesca', 'just arrived')\n",
"\n",
"# bump up Bengt as he skipped last time!\n",
"fikalist.constraints.add('Bengt', 'just arrived')\n",
"\n",
"# Rakhee and Nirmal live together, so they should have the same fika date\n",
"fikalist.constraints.add(['Rakhee', 'Nirmal'], 'together')"
Expand All @@ -173,44 +190,44 @@
"execution_count": 28,
"metadata": {
"ExecuteTime": {
"end_time": "2019-04-08T18:09:54.803575Z",
"start_time": "2019-04-08T18:09:54.800737Z"
"end_time": "2019-09-29T18:43:08.656824Z",
"start_time": "2019-09-29T18:43:08.653525Z"
}
},
"outputs": [],
"source": [
"from datetime import date, timedelta\n",
"\n",
"# specify the desired start date \n",
"start_date = date(2019, 4, 15)"
"start_date = date(2019, 10, 6)"
]
},
{
"cell_type": "code",
"execution_count": 29,
"metadata": {
"ExecuteTime": {
"end_time": "2019-04-08T18:09:55.571949Z",
"start_time": "2019-04-08T18:09:55.449688Z"
"end_time": "2019-09-29T18:43:09.265803Z",
"start_time": "2019-09-29T18:43:09.150497Z"
}
},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style>\n",
" .dataframe thead tr:only-child th {\n",
" text-align: right;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: left;\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
Expand All @@ -224,99 +241,99 @@
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>17</td>\n",
" <td>26/04/2019</td>\n",
" <td>Zeynep</td>\n",
" <td>Björn</td>\n",
" <td>0</td>\n",
" <td>41</td>\n",
" <td>11/10/2019</td>\n",
" <td>Dennis</td>\n",
" <td>Fredrik</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>18</td>\n",
" <td>03/05/2019</td>\n",
" <td>Navpreet</td>\n",
" <td>Dennis</td>\n",
" <td>1</td>\n",
" <td>42</td>\n",
" <td>18/10/2019</td>\n",
" <td>Vlasta</td>\n",
" <td>Giulia</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>19</td>\n",
" <td>10/05/2019</td>\n",
" <td>Nirmal</td>\n",
" <td>Rakhee</td>\n",
" <td>2</td>\n",
" <td>43</td>\n",
" <td>25/10/2019</td>\n",
" <td>Marcus</td>\n",
" <td>Filip</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>20</td>\n",
" <td>17/05/2019</td>\n",
" <td>Jonas</td>\n",
" <td>Mark</td>\n",
" <td>3</td>\n",
" <td>44</td>\n",
" <td>01/11/2019</td>\n",
" <td>Nirmal</td>\n",
" <td>Rakhee</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>21</td>\n",
" <td>24/05/2019</td>\n",
" <td>Francesca</td>\n",
" <td>Linda</td>\n",
" <td>4</td>\n",
" <td>45</td>\n",
" <td>08/11/2019</td>\n",
" <td>Josefin</td>\n",
" <td>Mattias</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>24</td>\n",
" <td>14/06/2019</td>\n",
" <td>Rupal</td>\n",
" <td>5</td>\n",
" <td>46</td>\n",
" <td>15/11/2019</td>\n",
" <td>Zeynep</td>\n",
" <td>Felix</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>36</td>\n",
" <td>06/09/2019</td>\n",
" <td>Thedi</td>\n",
" <td>Giulia</td>\n",
" <td>6</td>\n",
" <td>47</td>\n",
" <td>22/11/2019</td>\n",
" <td>Navpreet</td>\n",
" <td>Rabia</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>37</td>\n",
" <td>13/09/2019</td>\n",
" <td>Filip</td>\n",
" <td>Christian</td>\n",
" <td>7</td>\n",
" <td>48</td>\n",
" <td>29/11/2019</td>\n",
" <td>Bengt</td>\n",
" <td>Mark</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>38</td>\n",
" <td>20/09/2019</td>\n",
" <td>Christer</td>\n",
" <td>Vlasta</td>\n",
" <td>8</td>\n",
" <td>49</td>\n",
" <td>06/12/2019</td>\n",
" <td>Manojit</td>\n",
" <td>Jonas</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>39</td>\n",
" <td>27/09/2019</td>\n",
" <td>Josefin</td>\n",
" <td>Exjobbare</td>\n",
" <td>9</td>\n",
" <td>50</td>\n",
" <td>13/12/2019</td>\n",
" <td>Thedi</td>\n",
" <td>Moszi</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <td>40</td>\n",
" <td>04/10/2019</td>\n",
" <td>Moszi</td>\n",
" <td>Bengt</td>\n",
" <td>10</td>\n",
" <td>3</td>\n",
" <td>17/01/2020</td>\n",
" <td>Christian</td>\n",
" <td>Exjobbare</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Week Friday Person 1 Person 2\n",
"0 17 26/04/2019 Zeynep Björn\n",
"1 18 03/05/2019 Navpreet Dennis\n",
"2 19 10/05/2019 Nirmal Rakhee\n",
"3 20 17/05/2019 Jonas Mark\n",
"4 21 24/05/2019 Francesca Linda\n",
"5 24 14/06/2019 Rupal Felix\n",
"6 36 06/09/2019 Thedi Giulia\n",
"7 37 13/09/2019 Filip Christian\n",
"8 38 20/09/2019 Christer Vlasta\n",
"9 39 27/09/2019 Josefin Exjobbare\n",
"10 40 04/10/2019 Moszi Bengt"
"0 41 11/10/2019 Dennis Fredrik\n",
"1 42 18/10/2019 Vlasta Giulia\n",
"2 43 25/10/2019 Marcus Filip\n",
"3 44 01/11/2019 Nirmal Rakhee\n",
"4 45 08/11/2019 Josefin Mattias\n",
"5 46 15/11/2019 Zeynep Felix\n",
"6 47 22/11/2019 Navpreet Rabia\n",
"7 48 29/11/2019 Bengt Mark\n",
"8 49 06/12/2019 Manojit Jonas\n",
"9 50 13/12/2019 Thedi Moszi\n",
"10 3 17/01/2020 Christian Exjobbare"
]
},
"metadata": {},
Expand All @@ -328,7 +345,7 @@
"fikalist.generate(start_date=start_date)\n",
"\n",
"# show the generated list\n",
"fikalist.show()\n",
"df = fikalist.show()\n",
"# fikalist.print()"
]
},
Expand All @@ -347,16 +364,16 @@
},
{
"cell_type": "code",
"execution_count": 30,
"execution_count": 31,
"metadata": {
"ExecuteTime": {
"end_time": "2019-04-08T18:13:25.623832Z",
"start_time": "2019-04-08T18:13:25.617260Z"
"end_time": "2019-09-29T18:44:46.337695Z",
"start_time": "2019-09-29T18:44:46.331368Z"
}
},
"outputs": [],
"source": [
"output_filename = 'old_fikalists/spring19.fika'\n",
"output_filename = 'old_fikalists/autumn19.fika'\n",
"fikalist.save(output_filename)"
]
}
Expand All @@ -377,7 +394,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.4"
"version": "3.7.3"
}
},
"nbformat": 4,
Expand Down
12 changes: 12 additions & 0 deletions old_fikalists/autumn19.fika
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Week Friday Person 1 Person 2
41 11/10/2019 Dennis Fredrik
42 18/10/2019 Vlasta Giulia
43 25/10/2019 Marcus Filip
44 01/11/2019 Nirmal Rakhee
45 08/11/2019 Josefin Mattias
46 15/11/2019 Zeynep Felix
47 22/11/2019 Navpreet Rabia
48 29/11/2019 Bengt Mark
49 06/12/2019 Manojit Jonas
50 13/12/2019 Thedi Moszi
3 17/01/2020 Christian Exjobbare

0 comments on commit 9da7e62

Please sign in to comment.