Skip to content
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
5 changes: 2 additions & 3 deletions docs/source/python/m-epidata.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ After installation the following functions are available:
* ``get_divi_data``: Downloads ICU data from German DIVI Intensivregister (DIVI).
* ``get_hospitalization_data``: Downloads data about COVID-19 hospitalizations data from Robert Koch-Institut (RKI-H).
* ``get_jh_data``: Downloads COVID-19 case data from Johns Hopkins University (JH).
* ``get_npi_data``: Loads a certain resolution of recorded NPI data from the Corona Datenplattform and extracts the counties asked for and activates the NPIs if they are incidence dependent.
* ``get_population_data``: Downloads population data for German federal states and counties from various public sources (P).
* ``get_simulation_data``: Downloads all data required for a simulation with the graph-metapopulation model which are SARS-CoV-2 case data(RKI-C), population data (P), ICU data (DIVI) and COVID-19 vaccination data from Robert Koch-Institut (RKI-V).
* ``get_testing_data``: Downloads data about SARS-CoV-2 PCR tests from Robert Koch-Institut (RKI-T).
Expand All @@ -41,14 +40,14 @@ After installation the following functions are available:
* ``transformWeatherData``: Transforms weather data.

For a detailed description of the run options and the resulting data files written
see the `epidata subfolder <memilio/epidata/README.rst>`_.
see the `epidata subfolder <https://github.com/SciCompMod/memilio/blob/main/pycode/memilio-epidata/README.rst>`_.

The downloaded data is written either to HDF5 or json files.

Additional Tools
----------------

Some additional tools for processing or analysing data can be found in `tools directory <tools/README.md>`_.
Some additional tools for processing or analysing data can be found in `tools directory <https://github.com/SciCompMod/memilio/tree/main/tools>`_.

Notes for developers
--------------------
Expand Down
2 changes: 1 addition & 1 deletion pycode/memilio-epidata/memilio/epidata/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ BAA Germany mobility_bfa_2020_dim400 number of commuter
============== ========== =================================== =================

More detailed information can be found in the
`documentation <https://scicompmod.github.io/memilio/documentation/index.html>`_ of the different functions.
`documentation <https://memilio.readthedocs.io/en/latest/python/m-epidata.html>`_ of the different functions.

Notes for developers
--------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ def get_nuts3_county_id_map():
county_table = get_official_county_table()
# delete rows with nuts3 = NaN
# take just columns with name dd.EngEng['idCounty'] and dd.EngEng['nuts3']
key_nuts3 = county_table.dropna(subset=[dd.EngEng['nuts3']])[
key_nuts3 = county_table.dropna(subset=[dd.EngEng['nuts3'], dd.EngEng['idCounty']])[
[dd.EngEng['idCounty'], dd.EngEng['nuts3']]]
# convert ID data types
key_nuts3 = key_nuts3.astype({dd.EngEng['idCounty']: int})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
from io import BytesIO
from zipfile import ZipFile
from enum import Enum
from pkg_resources import parse_version
from packaging.version import parse

import pandas as pd

Expand All @@ -66,7 +66,7 @@ class Conf:

v_level = 'Info'
show_progr = False
if parse_version(pd.__version__) < parse_version('2.2'):
if parse(pd.__version__) < parse('2.2'):
excel_engine = 'openpyxl'
else:
# calamine is faster, but cannot be used for pandas < 2.2
Expand All @@ -84,8 +84,6 @@ def __init__(self, out_folder, **kwargs):
path = os.path.join(os.path.dirname(
os.path.abspath(__file__)), 'download_config.conf')

# activate CoW for more predictable behaviour of pandas DataFrames
pd.options.mode.copy_on_write = True
# read in config file
# if no config file is given, use default values
if os.path.exists(path):
Expand Down Expand Up @@ -196,9 +194,12 @@ def download_file(

"""
if verify not in [True, False, "interactive"]:
warnings.warn('Invalid input for argument verify. Expected True, False, or'
' "interactive", got ' + str(verify) + '.'
' Proceeding with "verify=True".', category=RuntimeWarning)
warnings.warn(
'Invalid input for argument verify. Expected True, False, or'
' "interactive", got ' + str(verify) +
'.'
' Proceeding with "verify=True".',
category=RuntimeWarning)
verify = True
# send GET request as stream so the content is not downloaded at once
try:
Expand Down Expand Up @@ -438,8 +439,7 @@ def cli(what):
parser.add_argument(
'-s', '--start-date', default=start_date_default,
help='Defines start date for data download. Should have form: YYYY-mm-dd.'
'Default is ' +
str(dd.defaultDict['start_date']) +
'Default is ' + str(dd.defaultDict['start_date']) +
' (2020-04-24 for divi and 2020-01-22 for jh)',
type=lambda s: datetime.datetime.strptime(s, '%Y-%m-%d').date())
if 'end_date' in what_list:
Expand All @@ -455,8 +455,10 @@ def cli(what):
' omitting dates where no data was reported', action='store_true')
if 'moving_average' in what_list:
parser.add_argument(
'-m', '--moving-average', type=int, default=dd.defaultDict['moving_average'],
help='Compute a moving average of N days over the time series. Default is ' + str(dd.defaultDict['moving_average']))
'-m', '--moving-average', type=int, default=dd.defaultDict
['moving_average'],
help='Compute a moving average of N days over the time series. Default is '
+ str(dd.defaultDict['moving_average']))
if 'split_berlin' in what_list:
parser.add_argument(
'-b', '--split-berlin', default=dd.defaultDict['split_berlin'],
Expand Down Expand Up @@ -504,7 +506,8 @@ def cli(what):
if '--interactive' in sys.argv:
parser.add_argument(
'--interactive',
help='Interactive download (Handle warnings, passwords etc.).', action='store_true')
help='Interactive download (Handle warnings, passwords etc.).',
action='store_true')

if not {'--verbose', '-v', '-vv', '-vvv', '-vvvv', '-vvvvv', '-vvvvvv'}.isdisjoint(sys.argv):
parser.add_argument(
Expand Down
Loading
Loading