Remove zone descriptions, internal zones and external zones parameters from ZoningSystem init and instead include this data as columns in the dataframe. The dataframe should contain the following columns:
zone_id: mandatory zone ID integers
zone_name: optional zone names
zone_descriptions: optional zone descriptions
Then can contain any number of additional boolean columns for flagging different areas or types of zones, descriptions of these columns can be included in the zoning system metadata.
zone_id
zone_name
internal_tfn
external_tfn
north_england
south_england
1
Manchester
1
0
1
0
2
London
0
1
0
1
Add validation of the dataframe which does the following:
Copy dataframe to avoid editing it inplace
Drop any possible multilevel column names or indices which aren't needed
Normalise column names, convert to lowercase, strip end whitespace, replace spaces with underscores
Check for mandatory columns, just 'zone_id'
Check for 'zone_name' and 'zone_descriptions' columns
Check for any flag columns and make sure they're booleans e.g. 'tfn_internal', 'tfn_external'
Add 2 property methods to return the zone names and descriptions lookups (probably a Series for each with the zone ID as the index).
Add method for getting any subset of zones based on the boolean flag columns #5
Remove zone descriptions, internal zones and external zones parameters from
ZoningSystem
init and instead include this data as columns in the dataframe. The dataframe should contain the following columns:Then can contain any number of additional boolean columns for flagging different areas or types of zones, descriptions of these columns can be included in the zoning system metadata.
Add validation of the dataframe which does the following:
Add 2 property methods to return the zone names and descriptions lookups (probably a Series for each with the zone ID as the index).
Add method for getting any subset of zones based on the boolean flag columns #5