From b36d5533ee8c42f6d8dcbec7944999ae0fb2918d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gratien=20D=C3=A9sormeaux?= Date: Tue, 7 Jan 2025 14:35:36 +0100 Subject: [PATCH] Pass precommits --- tutorial/Fetch_forecasts.ipynb | 18 +- tutorial/Get_vigilance.ipynb | 418 ++++++++++++++++----------------- 2 files changed, 218 insertions(+), 218 deletions(-) diff --git a/tutorial/Fetch_forecasts.ipynb b/tutorial/Fetch_forecasts.ipynb index e33a144..8d93d3a 100644 --- a/tutorial/Fetch_forecasts.ipynb +++ b/tutorial/Fetch_forecasts.ipynb @@ -23,6 +23,7 @@ "outputs": [], "source": [ "import random\n", + "\n", "from meteole import AromeForecast" ] }, @@ -112,12 +113,12 @@ "metadata": {}, "outputs": [], "source": [ - "#First parameters to create a coverage_id (run and interval)\n", + "# First parameters to create a coverage_id (run and interval)\n", "df_capabilities = arome.get_capabilities()\n", "\n", - "list_run_valid = list(df_capabilities[df_capabilities['indicator']==random_indicator]['run'].unique())\n", - "list_interval_valid = list(df_capabilities[df_capabilities['indicator']==random_indicator]['interval'].unique())\n", - "list_coverage_id_valid = list(df_capabilities[df_capabilities['indicator']==random_indicator]['id'].unique())\n" + "list_run_valid = list(df_capabilities[df_capabilities[\"indicator\"] == random_indicator][\"run\"].unique())\n", + "list_interval_valid = list(df_capabilities[df_capabilities[\"indicator\"] == random_indicator][\"interval\"].unique())\n", + "list_coverage_id_valid = list(df_capabilities[df_capabilities[\"indicator\"] == random_indicator][\"id\"].unique())" ] }, { @@ -126,13 +127,12 @@ "metadata": {}, "outputs": [], "source": [ - "#Then other parameters from a coverage_id\n", + "# Then other parameters from a coverage_id\n", "description = arome.get_coverage_description(list_coverage_id_valid[0])\n", "\n", - "list_forecast_horizons_valid = description.get('forecast_horizons', [])\n", - "list_height_valid = description.get('heights', [])\n", - "list_pressure_id_valid = description.get('pressures', [])\n", - "\n" + "list_forecast_horizons_valid = description.get(\"forecast_horizons\", [])\n", + "list_height_valid = description.get(\"heights\", [])\n", + "list_pressure_id_valid = description.get(\"pressures\", [])" ] }, { diff --git a/tutorial/Get_vigilance.ipynb b/tutorial/Get_vigilance.ipynb index 69f8858..7deefe4 100644 --- a/tutorial/Get_vigilance.ipynb +++ b/tutorial/Get_vigilance.ipynb @@ -1,211 +1,211 @@ { - "cells": [ - { - "cell_type": "markdown", - "id": "7fb27b941602401d91542211134fc71a", - "metadata": {}, - "source": [ - "# Vigilance Bulletin\n", - "\n", - "This tutorial will help you access the vigilance bulletin\n", - "\n", - "For more documentation, click [here](https://donneespubliques.meteofrance.fr/?fond=produit&id_produit=305&id_rubrique=50).\n", - "\n", - "Contents:\n", - "\n", - "- Init Vigilance Class\n", - "- Access Data" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "id": "acae54e37e7d407bbb7b55eff062a284", - "metadata": {}, - "outputs": [], - "source": [ - "import pandas as pd\n", - "\n", - "from meteole import Vigilance" - ] - }, - { - "cell_type": "markdown", - "id": "9a63283cbaf04dbcab1f6479b197f3a8", - "metadata": {}, - "source": [ - "# Init Vigilance Class" - ] - }, - { - "cell_type": "markdown", - "id": "8dd0d8092fe74a7c96281538738b07e2", - "metadata": {}, - "source": [ - "**Requirements notice** : TODO Link to the documentation to have application_id" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "id": "72eea5119410473aa328ad9291626812", - "metadata": {}, - "outputs": [], - "source": [ - "APP_ID = \"\"" - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "id": "8edb47106e1a46a883d545849b8ab81b", - "metadata": {}, - "outputs": [], - "source": [ - "vigi = Vigilance(application_id=APP_ID)" - ] - }, - { - "cell_type": "markdown", - "id": "10185d26023b46108eb7d9f57d49d2b3", - "metadata": {}, - "source": [ - "# Collect Forecasted phenomenon\n", - "\n", - "Collect vigilance data from M\u00e9t\u00e9o France, including the forecasted phenomenon in df_phenomenon and the maximum intensity for each zone in df_timelaps" - ] - }, - { - "cell_type": "code", - "execution_count": 17, - "id": "8763a12b2bbd4a93a75aff182afb95dc", - "metadata": {}, - "outputs": [], - "source": [ - "df_phenomenon, df_timelaps = vigi.get_phenomenon()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "7623eae2785240b9bd12b16a66d81610", - "metadata": {}, - "outputs": [], - "source": [ - "df_phenomenon.head()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "7cdc8c89c7104fffa095e18ddfef8986", - "metadata": {}, - "outputs": [], - "source": [ - "df_timelaps.head()" - ] - }, - { - "cell_type": "markdown", - "id": "b118ea5561624da68c537baed56e602f", - "metadata": {}, - "source": [ - "# Collect text of monitoring bulletins\n", - "\n", - "Contains the text of monitoring bulletins, whether national, zonal (in the sense of defense zones) or departmental. It is issued in addition to the Vigilance card, when the meteorological situation so requires (systematically in Vigilance Orange and Red, when necessary in Vigilance Yellow)." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "938c804e27f84196a10c8828c723f798", - "metadata": {}, - "outputs": [], - "source": [ - "vigilance_bulletin = vigi.get_bulletin()" - ] - }, - { - "cell_type": "code", - "execution_count": 21, - "id": "504fb2a444614c0babb325280ed9130a", - "metadata": {}, - "outputs": [], - "source": [ - "vigilance_bulletin_df = pd.json_normalize(vigilance_bulletin)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "b43b363d81ae4b689946ece5c682cd59", - "metadata": {}, - "outputs": [], - "source": [ - "text_bloc_items_df = pd.json_normalize(vigilance_bulletin_df[\"product.text_bloc_items\"].explode())" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "8a65eabff63a45729fe45fb5ade58bdc", - "metadata": {}, - "outputs": [], - "source": [ - "text_bloc_items_df.head(10)" - ] - }, - { - "cell_type": "markdown", - "id": "c3933fab20d04ec698c2621248eb3be0", - "metadata": {}, - "source": [ - "# Map display" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "4dd4641cc4064e0191573fe9c69df29b", - "metadata": {}, - "outputs": [], - "source": [ - "vigi.get_vignette()" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "meteole_env", - "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": "undefined.undefined.undefined" - }, - "toc": { - "base_numbering": 1, - "nav_menu": {}, - "number_sections": true, - "sideBar": true, - "skip_h1_title": false, - "title_cell": "Table of Contents", - "title_sidebar": "Contents", - "toc_cell": false, - "toc_position": {}, - "toc_section_display": true, - "toc_window_display": false - } - }, - "nbformat": 4, - "nbformat_minor": 5 + "cells": [ + { + "cell_type": "markdown", + "id": "0", + "metadata": {}, + "source": [ + "# Vigilance Bulletin\n", + "\n", + "This tutorial will help you access the vigilance bulletin\n", + "\n", + "For more documentation, click [here](https://donneespubliques.meteofrance.fr/?fond=produit&id_produit=305&id_rubrique=50).\n", + "\n", + "Contents:\n", + "\n", + "- Init Vigilance Class\n", + "- Access Data" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1", + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "\n", + "from meteole import Vigilance" + ] + }, + { + "cell_type": "markdown", + "id": "2", + "metadata": {}, + "source": [ + "# Init Vigilance Class" + ] + }, + { + "cell_type": "markdown", + "id": "3", + "metadata": {}, + "source": [ + "**Requirements notice** : TODO Link to the documentation to have application_id" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4", + "metadata": {}, + "outputs": [], + "source": [ + "APP_ID = \"\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5", + "metadata": {}, + "outputs": [], + "source": [ + "vigi = Vigilance(application_id=APP_ID)" + ] + }, + { + "cell_type": "markdown", + "id": "6", + "metadata": {}, + "source": [ + "# Collect Forecasted phenomenon\n", + "\n", + "Collect vigilance data from Météo France, including the forecasted phenomenon in df_phenomenon and the maximum intensity for each zone in df_timelaps" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7", + "metadata": {}, + "outputs": [], + "source": [ + "df_phenomenon, df_timelaps = vigi.get_phenomenon()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8", + "metadata": {}, + "outputs": [], + "source": [ + "df_phenomenon.head()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "9", + "metadata": {}, + "outputs": [], + "source": [ + "df_timelaps.head()" + ] + }, + { + "cell_type": "markdown", + "id": "10", + "metadata": {}, + "source": [ + "# Collect text of monitoring bulletins\n", + "\n", + "Contains the text of monitoring bulletins, whether national, zonal (in the sense of defense zones) or departmental. It is issued in addition to the Vigilance card, when the meteorological situation so requires (systematically in Vigilance Orange and Red, when necessary in Vigilance Yellow)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "11", + "metadata": {}, + "outputs": [], + "source": [ + "vigilance_bulletin = vigi.get_bulletin()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "12", + "metadata": {}, + "outputs": [], + "source": [ + "vigilance_bulletin_df = pd.json_normalize(vigilance_bulletin)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "13", + "metadata": {}, + "outputs": [], + "source": [ + "text_bloc_items_df = pd.json_normalize(vigilance_bulletin_df[\"product.text_bloc_items\"].explode())" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "14", + "metadata": {}, + "outputs": [], + "source": [ + "text_bloc_items_df.head(10)" + ] + }, + { + "cell_type": "markdown", + "id": "15", + "metadata": {}, + "source": [ + "# Map display" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "16", + "metadata": {}, + "outputs": [], + "source": [ + "vigi.get_vignette()" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "meteole_env", + "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": "undefined.undefined.undefined" + }, + "toc": { + "base_numbering": 1, + "nav_menu": {}, + "number_sections": true, + "sideBar": true, + "skip_h1_title": false, + "title_cell": "Table of Contents", + "title_sidebar": "Contents", + "toc_cell": false, + "toc_position": {}, + "toc_section_display": true, + "toc_window_display": false + } + }, + "nbformat": 4, + "nbformat_minor": 5 }