Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/43 cache downloaded data #44

Merged
merged 3 commits into from
Aug 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ignore=third_party

# Files or directories matching the regex patterns are skipped. The regex
# matches against base names, not paths.
ignore-patterns=
ignore-patterns=test_.*

# Pickle collected data for later comparisons.
persistent=no
Expand Down
201 changes: 201 additions & 0 deletions nb/download_cubefile.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "69e1d305",
"metadata": {},
"outputs": [],
"source": [
"%load_ext autoreload\n",
"%autoreload 2"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "ff9eca4f",
"metadata": {},
"outputs": [],
"source": [
"# only if you get an error from below\n",
"# from pygenesis import init_config\n",
"# init_config()"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "4a207a77",
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"\n",
"from pygenesis.data import get_data"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "6e6df177",
"metadata": {},
"outputs": [],
"source": [
"params = {\"values\": \"true\", \"metadata\": \"true\", \"additionals\": \"false\"}\n",
"data = get_data(name=\"47414BJ002\", method=\"cubefile\", **params)"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "a8bcd5b4",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>DINSG</th>\n",
" <th>WZ08N7</th>\n",
" <th>WERTE4</th>\n",
" <th>JAHR</th>\n",
" <th>UMS103</th>\n",
" <th>QUALITAET</th>\n",
" <th>GESPERRT</th>\n",
" <th>WERT-VERFAELSCHT</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>DG</td>\n",
" <td>WZ08-49-01</td>\n",
" <td>NOMINAL</td>\n",
" <td>2015</td>\n",
" <td>100.0</td>\n",
" <td>e</td>\n",
" <td>NaN</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>DG</td>\n",
" <td>WZ08-49-01</td>\n",
" <td>NOMINAL</td>\n",
" <td>2016</td>\n",
" <td>99.3</td>\n",
" <td>e</td>\n",
" <td>NaN</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>DG</td>\n",
" <td>WZ08-49-01</td>\n",
" <td>NOMINAL</td>\n",
" <td>2017</td>\n",
" <td>105.7</td>\n",
" <td>e</td>\n",
" <td>NaN</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>DG</td>\n",
" <td>WZ08-49-01</td>\n",
" <td>NOMINAL</td>\n",
" <td>2018</td>\n",
" <td>111.6</td>\n",
" <td>e</td>\n",
" <td>NaN</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>DG</td>\n",
" <td>WZ08-49-01</td>\n",
" <td>NOMINAL</td>\n",
" <td>2019</td>\n",
" <td>115.6</td>\n",
" <td>e</td>\n",
" <td>NaN</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" DINSG WZ08N7 WERTE4 JAHR UMS103 QUALITAET GESPERRT \\\n",
"0 DG WZ08-49-01 NOMINAL 2015 100.0 e NaN \n",
"1 DG WZ08-49-01 NOMINAL 2016 99.3 e NaN \n",
"2 DG WZ08-49-01 NOMINAL 2017 105.7 e NaN \n",
"3 DG WZ08-49-01 NOMINAL 2018 111.6 e NaN \n",
"4 DG WZ08-49-01 NOMINAL 2019 115.6 e NaN \n",
"\n",
" WERT-VERFAELSCHT \n",
"0 0.0 \n",
"1 0.0 \n",
"2 0.0 \n",
"3 0.0 \n",
"4 0.0 "
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data.head()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "fed610c9",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"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.9.7"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading