{ "cells": [ { "cell_type": "markdown", "id": "1c5571822389571a", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "# BiSO\n", "\n", "Romain THOMAS 2025 \n", "DiBISO - Université Paris-Saclay" ] }, { "cell_type": "markdown", "id": "2ed5b51e-1263-48cb-9b9c-044bebc17904", "metadata": {}, "source": [ "## Load environment variables\n", "\n", "Load the environment variables from the `.env` file.\n", "\n", "Then, load the API keys and index names, and store them in a dictionary for further use." ] }, { "cell_type": "code", "execution_count": 1, "id": "b46e41f2-8de5-4947-b6f1-bfc70fab9cdf", "metadata": {}, "outputs": [], "source": [ "import os\n", "from dotenv import load_dotenv\n", "\n", "load_dotenv()\n", "\n", "scanr_config = {\n", " 'scanr_api_password' : os.getenv(\"SCANR_API_PASSWORD\"),\n", " 'scanr_api_url' : os.getenv(\"SCANR_API_URL\"),\n", " 'scanr_api_username' : os.getenv(\"SCANR_API_USERNAME\"),\n", " 'scanr_bso_index' : os.getenv(\"SCANR_BSO_INDEX\"),\n", " 'scanr_publications_index' : os.getenv(\"SCANR_PUBLICATIONS_INDEX\")\n", "}" ] }, { "cell_type": "code", "execution_count": 2, "id": "c1755d78-49b5-4326-8f5e-650681ec9a19", "metadata": { "editable": true, "nbsphinx": "hidden", "slideshow": { "slide_type": "" }, "tags": [] }, "outputs": [], "source": [ "# This cell has the metadata: \"nbsphinx\": \"hidden\" to be hidden in the sphinx documentation\n", "\n", "# Create figure directory\n", "\n", "import os\n", "\n", "os.makedirs(\"figures/biso\", exist_ok=True)" ] }, { "cell_type": "markdown", "id": "047a9c10-a83c-4e52-ab71-60ddb353ffb3", "metadata": {}, "source": [ "## ANR Projects" ] }, { "cell_type": "code", "execution_count": 3, "id": "86841ffe-deb6-467c-8e34-915488f25bfc", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "outputs": [], "source": [ "from dibisoplot.biso import AnrProjects\n", "\n", "anr_projects = AnrProjects(\n", " lab = \"SUP_SONDRA\",\n", " year = 2023,\n", ")\n", "\n", "anr_fig = anr_projects.get_figure()\n", "\n", "# anr_fig.show()" ] }, { "cell_type": "code", "execution_count": 4, "id": "70083dd9-7a8e-4163-bbc1-5981eba14ead", "metadata": { "editable": true, "nbsphinx": "hidden", "slideshow": { "slide_type": "" }, "tags": [] }, "outputs": [], "source": [ "# This cell has the metadata: \"nbsphinx\": \"hidden\" to be hidden in the sphinx documentation\n", "\n", "anr_fig.update_layout(\n", " autosize=True,\n", " margin=dict(l=20, r=20, t=20, b=20), # Reduce margins\n", " width=None, # Let the iframe control width\n", " height=None, # Let the iframe control height\n", ")\n", "anr_fig.write_html(\n", " \"figures/biso/anr_projects.html\",\n", " include_plotlyjs=\"cdn\",\n", " full_html=False,\n", " config={\"responsive\": True}\n", ")" ] }, { "cell_type": "markdown", "id": "388e3963-5bb2-4c2d-8593-762fe53b0c5b", "metadata": {}, "source": [ "