{ "cells": [ { "cell_type": "markdown", "id": "7dad745b", "metadata": {}, "source": [ "# List of publications\n", "This overview shows papers published by SINTEF that are relevant for SHOP." ] }, { "cell_type": "code", "execution_count": 1, "id": "96e002d3", "metadata": { "tags": [ "remove-input", "full-width" ] }, "outputs": [ { "data": { "text/html": [ "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n", "indexauthortitlejournalyearurldoiabstract\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "\n", " \n", " \n", " \n", " \n", "\n", " \n", " \n", " \n", " \n", "\n", " \n", " \n", " \n", " \n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", "\n", "\n", "Loading ITables v2.3.0 from the internet...\n", "(need help?)\n", "\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import itables as itables\n", "from itables import init_notebook_mode\n", "init_notebook_mode(all_interactive=True, connected=True)\n", "import pandas as pd\n", "from IPython.core.display import HTML\n", "import bibtexparser\n", "import yaml\n", "\n", "with open('references.bib', encoding='utf8') as bibfile:\n", " bib_list = bibtexparser.load(bibfile)\n", "table = pd.DataFrame(bib_list.entries)\n", "## Available entries\n", "# ['year', 'url', 'volume', 'title', 'pages', 'keywords', 'journal',\n", "# 'isbn', 'doi', 'author', 'ENTRYTYPE', 'ID', 'abstract', 'publisher',\n", "# 'month', 'issn', 'issue'],\n", "table = table[['author', 'title', 'journal', 'year', 'url', 'doi', 'abstract']].reset_index()\n", "with open('author-links.yml', encoding='utf8') as f:\n", " author_links = yaml.load(f, Loader=yaml.FullLoader)\n", "for index, row in table.iterrows():\n", " if not pd.isnull(row[\"url\"]):\n", " table.at[index, \"url\"] = f'Url'\n", " else:\n", " table.at[index, \"url\"] = \"\"\n", " if not pd.isnull(row[\"doi\"]):\n", " table.at[index, \"doi\"] = f'Doi'\n", " else:\n", " table.at[index, \"doi\"] = \"\"\n", " author_list = [r.strip() for r in row[\"author\"].split(\" and \")]\n", " author_string = \"\"\n", " for i,r in enumerate(author_list):\n", " if r in author_links:\n", " a = f\"\"\"{r}\"\"\"\n", " else:\n", " a = r\n", " if i == len(author_list) - 1 and len(author_list) > 1:\n", " author_string += f\", and {a}\"\n", " elif i > 0:\n", " author_string += f\", {a}\"\n", " else:\n", " author_string += a\n", " table.at[index, \"author\"] = author_string\n", "itables.show(table,\n", " dom='tlip',\n", " search={'regex': True, \"caseInsensitive\": True},\n", " column_filters='header',\n", " columns=[\n", " {\n", " 'name': '',\n", " 'className': 'dt-control',\n", " 'orderable': False,\n", " 'data': None,\n", " 'defaultContent': '',\n", " },\n", " {\n", " 'name': 'author',\n", " 'className': 'dt-body-left'\n", " },\n", " {\n", " 'name': 'title',\n", " 'className': 'dt-body-left'\n", " },\n", " {\n", " 'name': 'journal',\n", " 'className': 'dt-body-left'\n", " },\n", " {\n", " 'name': 'year',\n", " 'className': 'dt-body-left'\n", " },\n", " {\n", " 'name': 'url',\n", " 'className': 'dt-body-left'\n", " },\n", " {\n", " 'name': 'doi',\n", " 'className': 'dt-body-left'\n", " },\n", " {\n", " 'name': 'abstract',\n", " 'visible': False\n", " }\n", " ]\n", ")\n", "\n", "HTML('''''')" ] } ], "metadata": { "jupytext": { "text_representation": { "extension": ".md", "format_name": "myst", "format_version": 0.13, "jupytext_version": "1.13.8" } }, "kernelspec": { "display_name": "Python 3", "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.12.9" }, "source_map": [ 11, 16 ] }, "nbformat": 4, "nbformat_minor": 5 }