diff --git a/docs/jupyter_notebooks/e1_pull_DWD_historical_to_all_output_formats.ipynb b/docs/jupyter_notebooks/e1_pull_DWD_historical_to_all_output_formats.ipynb index 322944f..cbdc069 100644 --- a/docs/jupyter_notebooks/e1_pull_DWD_historical_to_all_output_formats.ipynb +++ b/docs/jupyter_notebooks/e1_pull_DWD_historical_to_all_output_formats.ipynb @@ -1,131 +1,131 @@ { - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": "# AixWeather Tutorial\n" - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": "This example is a step-by-step guide to pull historical weather data from the DWD open access database\nand convert it to different output formats.\nThus showing all possible steps on how to use AixWeather.\nTo run the tool for other weather data sources, just change the project class.\nThe rest of the code is streamlined and will remain the same.\n" - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": "Enable logging, this is just to get more feedback through the terminal\n" - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": "import logging\nlogging.basicConfig(level=\"DEBUG\")\n" - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": "Choose the project class according to the desired weather data origin.\nCheck the project classes file or the API documentation to see which classes are available.\n" - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": "from aixweather.project_class import ProjectClassDWDHistorical\n" - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": "Step 0: Initiate the project class which contains or creates all variables and functions.\nFor this, we use the datetime module to specify dates.\n" - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": "import datetime as dt\nDWD_pull_project = ProjectClassDWDHistorical(\n start=dt.datetime(2022, 1, 1),\n end=dt.datetime(2023, 1, 1),\n station=15000,\n # specify whether nan-values should be filled when exporting\n fillna=True,\n # define results path if desired\n abs_result_folder_path=None,\n)\n" - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": "Step 1: Import historical weather from the DWD open access database\n" - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": "DWD_pull_project.import_data()\nprint(\n f\"\\nHow the imported data looks like:\\n{DWD_pull_project.imported_data.head()}\\n\"\n)\n" - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": "Step 2: Convert this imported data to the core format\n" - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": "DWD_pull_project.data_2_core_data()\nprint(f\"\\nHow the core data looks like:\\n{DWD_pull_project.core_data.head()}\\n\")\n" - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": "You may optionally also use data quality check utils, like:\n" - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": "from aixweather.data_quality_checks import plot_heatmap_missing_values\n" - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": "Plot data quality\n" - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": "plot = plot_heatmap_missing_values(DWD_pull_project.core_data)\nplot.show()\n" - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": "Step 3: Convert this core data to an output data format of your choice\n" - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": "DWD_pull_project.core_2_csv()\nDWD_pull_project.core_2_json()\nDWD_pull_project.core_2_pickle()\nDWD_pull_project.core_2_mos()\nDWD_pull_project.core_2_epw()\n" - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "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": "3.6.4" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": "# AixWeather Tutorial\n" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "This example is a step-by-step guide to pull historical weather data from the DWD open access database\nand convert it to different output formats.\nThus showing all possible steps on how to use AixWeather.\nTo run the tool for other weather data sources, just change the project class.\nThe rest of the code is streamlined and will remain the same.\n" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "Enable logging, this is just to get more feedback through the terminal\n" + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": "import logging\nlogging.basicConfig(level=\"DEBUG\")\n" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "Choose the project class according to the desired weather data origin.\nCheck the project classes file or the API documentation to see which classes are available.\n" + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": "from aixweather.project_class import ProjectClassDWDHistorical\n" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "Step 0: Initiate the project class which contains or creates all variables and functions.\nFor this, we use the datetime module to specify dates.\n" + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": "import datetime as dt\nDWD_pull_project = ProjectClassDWDHistorical(\n start=dt.datetime(2022, 1, 1),\n end=dt.datetime(2023, 1, 1),\n station=15000,\n # specify whether nan-values should be filled when exporting\n fillna=True,\n # define results path if desired\n abs_result_folder_path=None,\n)\n" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "Step 1: Import historical weather from the DWD open access database\n" + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": "DWD_pull_project.import_data()\nprint(\n f\"\\nHow the imported data looks like:\\n{DWD_pull_project.imported_data.head()}\\n\"\n)\n" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "Step 2: Convert this imported data to the core format\n" + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": "DWD_pull_project.data_2_core_data()\nprint(f\"\\nHow the core data looks like:\\n{DWD_pull_project.core_data.head()}\\n\")\n" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "You may optionally also use data quality check utils, like:\n" + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": "from aixweather.data_quality_checks import plot_heatmap_missing_values\n" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "Plot data quality\n" + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": "plot = plot_heatmap_missing_values(DWD_pull_project.core_data)\nplot.show()\n" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "Step 3: Convert this core data to an output data format of your choice\n" + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": "DWD_pull_project.core_2_csv()\nDWD_pull_project.core_2_json()\nDWD_pull_project.core_2_pickle()\nDWD_pull_project.core_2_mos()\nDWD_pull_project.core_2_epw()\n" + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "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": "3.6.4" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} \ No newline at end of file