bhf_smarthealth.config#

Attributes#

ENVIRONMENT

Configure which environment the pipeline is running in to determine which IDs should be processed

DEFAULT_LOG_LEVEL

Set the level of information captured by the logger. Choose from DEBUG, INFO, WARNING, ERROR, CRITICAL. Defaults to INFO

DEFAULT_VALID_DATA_THRESHOLD

Set the acceptable (inclusive) threshold for invalid proportion of incoming data

DEFAULT_TIME_PERIOD

Time resolution that intraday data (e.g. activities, mobility, LSOA) is aggregated to. Defaults to 5 minutes

NAMESPACE

Persistent namespace for the project

INTERMEDIATE_TABLE_REGISTRY

CLEAN_TABLE_REGISTRY

Central configuration of clean output tables

DEFAULT_GPS_FILE_NAME

Specifies the file name of the raw GPS json data file to expect. Defaults to 'gps_data'

DEFAULT_GPS_CRS

The co-ordinate reference system (CRS) to map GPS latitude and longitude values to

DEFAULT_PLANAR_CRS

The planar CRS to map GPS datapoints to. Necessary for distance calculations. Defaults to the British National Grid

DEFAULT_DECIMAL_PLACES

The default number of decimal places to round to. Defaults to 3

DEFAULT_MAX_SPEED_MS

The maximum allowed instantaneous speed value derived from GPS data, in metres per second. Defaults to 36 m/s, or ~130 kph. Values above this are filtered from the data set

DEFAULT_MAX_TIME_JUMP_MINS

The maximum allowed time jump between GPS data points, in minutes. Defaults to 5 minutes. If a time jump between data points is greater than this value, the distance and speed of travel between the adjacent points is omitted from the dataset. The LSOA values corresponding to these data points will not be included in aggregate calculations

DEFAULT_REPLACE_NON_MATCHED_LSOA_VALUES

Specify placeholder values for co-ordinates that are not matched to an LSOA, i.e. are outside of England or Wales.

DEFAULT_REMOVE_GPS_COLUMNS

The default columns to remove from the processed GPS dataframe. Defaults to ['lat', 'long, 'geometry', 'index_right']. The first three must be removed to remove the highly-sensitive GPS data, whilst the 'index_right' is a superfluous field generated during data joining

DEFAULT_RENAME_GPS_COLUMNS

Defines the column names in the output tables

DEFAULT_GPS_OUTPUT_COLUMNS

Defines the output files and their columns

DEFAULT_GPS_AGG_DICT

The Python dictionary of columns to aggregate, and the calculations to perform for each column

DEFAULT_HR_MIN

DEFAULT_HR_MAX

The minimum and maximum (inclusive) limit for Heart Rate (beats per minute) included in filtered aggregate calculations

DEFAULT_FB_INTRADAY_AGG_DICT

The Python dictionary of columns to aggregate, and the calculations to perform for each column

DEFAULT_FB_INTRADAY_COLUMN_OVERRIDES

A Dictionary of aggregation column names to override (keys) and their replacement names (values)

DEFAULT_FB_INTRADAY_AGG_SETTINGS

The time periods to aggregate the Fitbit intraday activities to. Facilitates the generation of additional Daily Summary data derived from the intraday raw data

DEFAULT_AHAH_TIME_PERIOD

The time period to aggregate LSOA data into to join with environmental measures. Defaults to 1 hour

DEFAULT_AHAH_AGG_DICT

The Python dictionary of columns to aggregate, and the calculations to perform for each column

DEFAULT_RENAME_AHAH_COLUMNS

Defines the column names in the output tables

DEFAULT_AHAH_MERGE_COL

The column used to merge reference AHAH data with the aggregated LSOA data. Defaults to ["modal_LSOA21CD"]

DEFAULT_REMOVE_AHAH_COLUMNS

The default columns to remove from the Environmental data table. Removes sensitive data and joining artefacts

DEFAULT_AHAH_FIELDS

Defines the AHAH data fields available in the output Environmental data table

DEFAULT_HA_WORKOUT_UNITS

Module Contents#

bhf_smarthealth.config.ENVIRONMENT#

Configure which environment the pipeline is running in to determine which IDs should be processed

bhf_smarthealth.config.DEFAULT_LOG_LEVEL = 20#

Set the level of information captured by the logger. Choose from DEBUG, INFO, WARNING, ERROR, CRITICAL. Defaults to INFO

bhf_smarthealth.config.DEFAULT_VALID_DATA_THRESHOLD = 0.0#

Set the acceptable (inclusive) threshold for invalid proportion of incoming data

bhf_smarthealth.config.DEFAULT_TIME_PERIOD = '5min'#

Time resolution that intraday data (e.g. activities, mobility, LSOA) is aggregated to. Defaults to 5 minutes

bhf_smarthealth.config.NAMESPACE#

Persistent namespace for the project

bhf_smarthealth.config.INTERMEDIATE_TABLE_REGISTRY#
bhf_smarthealth.config.CLEAN_TABLE_REGISTRY#

Central configuration of clean output tables

bhf_smarthealth.config.DEFAULT_GPS_FILE_NAME = 'gps_data'#

Specifies the file name of the raw GPS json data file to expect. Defaults to ‘gps_data’

bhf_smarthealth.config.DEFAULT_GPS_CRS = 'EPSG:4326'#

The co-ordinate reference system (CRS) to map GPS latitude and longitude values to

bhf_smarthealth.config.DEFAULT_PLANAR_CRS = 'EPSG:27700'#

The planar CRS to map GPS datapoints to. Necessary for distance calculations. Defaults to the British National Grid

bhf_smarthealth.config.DEFAULT_DECIMAL_PLACES = 3#

The default number of decimal places to round to. Defaults to 3

bhf_smarthealth.config.DEFAULT_MAX_SPEED_MS = 36#

The maximum allowed instantaneous speed value derived from GPS data, in metres per second. Defaults to 36 m/s, or ~130 kph. Values above this are filtered from the data set

bhf_smarthealth.config.DEFAULT_MAX_TIME_JUMP_MINS = 5#

The maximum allowed time jump between GPS data points, in minutes. Defaults to 5 minutes. If a time jump between data points is greater than this value, the distance and speed of travel between the adjacent points is omitted from the dataset. The LSOA values corresponding to these data points will not be included in aggregate calculations

bhf_smarthealth.config.DEFAULT_REPLACE_NON_MATCHED_LSOA_VALUES#

Specify placeholder values for co-ordinates that are not matched to an LSOA, i.e. are outside of England or Wales.

bhf_smarthealth.config.DEFAULT_REMOVE_GPS_COLUMNS = ['lat', 'long', 'geometry', 'index_right']#

The default columns to remove from the processed GPS dataframe. Defaults to [‘lat’, ‘long, ‘geometry’, ‘index_right’]. The first three must be removed to remove the highly-sensitive GPS data, whilst the ‘index_right’ is a superfluous field generated during data joining

bhf_smarthealth.config.DEFAULT_RENAME_GPS_COLUMNS = ['n_samples', 'dist_travelled', 'mean_speed', 'latest_LSOA21NM', 'latest_LSOA21CD', 'n_unique_LSOAs']#

Defines the column names in the output tables

bhf_smarthealth.config.DEFAULT_GPS_OUTPUT_COLUMNS#

Defines the output files and their columns

bhf_smarthealth.config.DEFAULT_GPS_AGG_DICT#

The Python dictionary of columns to aggregate, and the calculations to perform for each column

bhf_smarthealth.config.DEFAULT_HR_MIN = 0#
bhf_smarthealth.config.DEFAULT_HR_MAX = 320#

The minimum and maximum (inclusive) limit for Heart Rate (beats per minute) included in filtered aggregate calculations

bhf_smarthealth.config.DEFAULT_FB_INTRADAY_AGG_DICT#

The Python dictionary of columns to aggregate, and the calculations to perform for each column

bhf_smarthealth.config.DEFAULT_FB_INTRADAY_COLUMN_OVERRIDES#

A Dictionary of aggregation column names to override (keys) and their replacement names (values)

bhf_smarthealth.config.DEFAULT_FB_INTRADAY_AGG_SETTINGS#

The time periods to aggregate the Fitbit intraday activities to. Facilitates the generation of additional Daily Summary data derived from the intraday raw data

bhf_smarthealth.config.DEFAULT_AHAH_TIME_PERIOD = '1h'#

The time period to aggregate LSOA data into to join with environmental measures. Defaults to 1 hour

bhf_smarthealth.config.DEFAULT_AHAH_AGG_DICT#

The Python dictionary of columns to aggregate, and the calculations to perform for each column

bhf_smarthealth.config.DEFAULT_RENAME_AHAH_COLUMNS = ['env_n_samples', 'modal_LSOA21CD', 'modal_LSOA21NM']#

Defines the column names in the output tables

bhf_smarthealth.config.DEFAULT_AHAH_MERGE_COL = ['modal_LSOA21CD']#

The column used to merge reference AHAH data with the aggregated LSOA data. Defaults to [“modal_LSOA21CD”]

bhf_smarthealth.config.DEFAULT_REMOVE_AHAH_COLUMNS = ['LSOA21CD', 'modal_LSOA21CD', 'modal_LSOA21NM']#

The default columns to remove from the Environmental data table. Removes sensitive data and joining artefacts

bhf_smarthealth.config.DEFAULT_AHAH_FIELDS = ['LSOA21CD', 'ah4blue', 'ah4dent', 'ah4gp', 'ah4hosp', 'ah4phar', 'ah4gpas', 'ah4no2', 'ah4so2',...#

Defines the AHAH data fields available in the output Environmental data table

bhf_smarthealth.config.DEFAULT_HA_WORKOUT_UNITS#