Skip to content

Commit

Permalink
Minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
derailed-dash committed Dec 19, 2023
1 parent 2ab8f97 commit d734dde
Showing 1 changed file with 26 additions and 28 deletions.
54 changes: 26 additions & 28 deletions src/AoC_2023/Dazbo's_Advent_of_Code_2023.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -210,15 +210,8 @@
" file_fmt = logging.Formatter(fmt=\"%(asctime)s.%(msecs)03d:%(name)s:%(levelname)8s: %(message)s\",\n",
" datefmt='%H:%M:%S')\n",
" file_handler.setFormatter(file_fmt)\n",
" a_logger.addHandler(file_handler)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
" a_logger.addHandler(file_handler)\n",
" \n",
"def top_and_tail(data, block_size=5, include_line_numbers=True, zero_indexed=False):\n",
" \"\"\" Print a summary of a large amount of data \n",
"\n",
Expand Down Expand Up @@ -255,7 +248,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Install ffmpeg"
"## Install ffmpeg\n",
"\n",
"This is installed in order to render video output, i.e. for visualisations."
]
},
{
Expand Down Expand Up @@ -327,18 +322,8 @@
" logger.warning(\"No .env file found.\")\n",
" return False\n",
"\n",
"get_envs_from_file() # read env variables from a .env file, if we can find one"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "kSem0cT_LApT",
"tags": []
},
"outputs": [],
"source": [
"get_envs_from_file() # read env variables from a .env file, if we can find one\n",
"\n",
"if os.getenv('AOC_SESSION_COOKIE'):\n",
" logger.info('Session cookie retrieved: %s...%s', os.environ['AOC_SESSION_COOKIE'][0:6], os.environ['AOC_SESSION_COOKIE'][-6:])\n",
"else: # it's not in our environment variables, so we'll need to input the value\n",
Expand Down Expand Up @@ -6191,7 +6176,7 @@
"metadata": {},
"source": [
"---\n",
"## Day 18: title"
"## Day 18: Lavaduct Lagoon"
]
},
{
Expand Down Expand Up @@ -6578,14 +6563,27 @@
"metadata": {},
"source": [
"---\n",
"## Day 19: title"
"## Day 19: Aplenty"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 13,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/markdown": [
"#### See [Day 19](https://adventofcode.com/2023/day/19)."
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"DAY = \"19\" # replace with actual number (without leading digit)\n",
"day_link = f\"#### See [Day {DAY}](https://adventofcode.com/{YEAR}/day/{DAY}).\"\n",
Expand Down Expand Up @@ -6822,9 +6820,9 @@
"toc_visible": true
},
"kernelspec": {
"display_name": "aca_aoc",
"display_name": "ana-aoc",
"language": "python",
"name": "aca_aoc"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand Down

0 comments on commit d734dde

Please sign in to comment.