cowidev.testing.utils

cowidev.testing.utils.base

class cowidev.testing.utils.base.CountryTestBase[source]

Bases: object

_check_attributes(mapping)[source]
_postprocessing(df: DataFrame, extra_cols: list)[source]
export_datafile(df, filename=None, attach=False, reset_index=False, extra_cols=None, **kwargs)[source]
get_output_path(filename=None)[source]
load_datafile(filename=None)[source]
location: str = None
notes: str = <NA>
property output_path
pipe_merge_current(df: DataFrame)[source]
pipe_metadata(df: DataFrame) DataFrame[source]
pipe_rename_columns(df: DataFrame) DataFrame[source]
rename_columns: dict = {}
source_label: str = None
source_url: str = None
source_url_ref: str = None
units: str = None
cowidev.testing.utils.base.merge_with_current_data(df: DataFrame, filepath: str) DataFrame[source]

cowidev.testing.utils.gsheets

class cowidev.testing.utils.gsheets.TestingGSheet(credentials_file, sheet_id: str)[source]

Bases: object

_check_metadata(df: DataFrame)[source]
classmethod from_json(path: str)[source]

Load sheet from config file.

get_metadata(refresh: bool = False) DataFrame[source]

Get metadata from LOCATIONS tab.

cowidev.testing.utils.incremental

cowidev.testing.utils.incremental._check_fields(df_current: str, location: str, source_url: str, source_label: str, units: str, date, cumulative_total: Number, daily_change: Number)[source]
cowidev.testing.utils.incremental.increment(sheet_name: str, country: str, units: str, date: str, source_url: str, source_label: str, notes=None, daily_change=None, count=None)[source]

cowidev.testing.utils.utils

cowidev.testing.utils.utils.make_monotonic(df: DataFrame, max_removed_rows=10) DataFrame[source]
cowidev.testing.utils.make_monotonic(df: DataFrame, max_removed_rows=10) DataFrame[source]