metawards.InputFiles¶
-
class
metawards.
InputFiles
(work: str = None, play: str = None, identifier: str = None, identifier2: str = None, weekend: str = None, work_size: str = None, play_size: str = None, position: str = None, coordinates: str = None, lookup: str = None, lookup_columns: Dict[str, int] = None, seed: str = None, nodes_to_track: str = None, uv: str = None, _filename: str = None, _model_name: str = None, _model_path: str = None, _model_version: str = None, _authors: str = None, _contacts: str = None, _references: str = None, _repository: str = None, _repository_version: str = None, _repository_branch: str = None)[source]¶ This class holds all of the input files that must be loaded from METAWARDSDATA to construct the network of wards and links between them
Load using the InputFiles.load function e.g.
Examples
>>> infiles = InputFiles.load("2011Data") >>> print(infiles) Model 2011Data version March 29 2020 repository: https://github.com/metawards/MetaWardsData repository_branch: master repository_version: 0.2.0 etc.
-
__init__
(work: str = None, play: str = None, identifier: str = None, identifier2: str = None, weekend: str = None, work_size: str = None, play_size: str = None, position: str = None, coordinates: str = None, lookup: str = None, lookup_columns: Dict[str, int] = None, seed: str = None, nodes_to_track: str = None, uv: str = None, _filename: str = None, _model_name: str = None, _model_path: str = None, _model_version: str = None, _authors: str = None, _contacts: str = None, _references: str = None, _repository: str = None, _repository_version: str = None, _repository_branch: str = None) → None¶
Methods
__init__
(work, play, identifier, …)load
(model, repository, folder, description, …)Load the parameters associated with the passed model. model_name
()Return the name of this model model_path
()Return the path to the directory containing this model model_version
()Return the version of the data in this model Attributes
coordinates
Coordinates-system used for the positions. identifier
File from which to read all of the ward names identifier2
File from which to read all of the secondary ward IDs, (Communities, Counties, Districts, UA’s etc) lookup
File to look up metadata about the wards (e.g. lookup_columns
Which columns in this file have the data nodes_to_track
File from which to read the list of nodes to track play
File from which to read the play matrix of links play_size
File from which to read the size of the population in the play file position
File from which to read the positions (locations) of the wards (the centre of the bounding boxes) seed
File from which to read the values to seed the wards uv
UV file weekend
File from which to read the weekend matrix of links work
File from which to read the work matrix of links work_size
File from which to read the size of the population in the work file -
coordinates
= None¶ Coordinates-system used for the positions. Should be ‘x/y’ or ‘lat/long’
-
identifier
= None¶ File from which to read all of the ward names
-
identifier2
= None¶ File from which to read all of the secondary ward IDs, (Communities, Counties, Districts, UA’s etc)
-
static
load
(model: str = '2011Data', repository: str = '/home/runner/GitHub/MetaWardsData', folder: str = 'model_data', description: str = 'description.json', filename: str = None)[source]¶ Load the parameters associated with the passed model. This will look for the parameters specified in the json file called f”{repository}/{folder}/{model}/{description}”
By default this will load the 2011Data parameters from $HOME/GitHub/model_data/2011Data/description.json
Alternatively you can provide the full path to the description json file usng the ‘filename’ argument. All files within this description will be searched for using the directory that contains that file as a base
Parameters: - model (str) – The name of the model data to load. This is the name that will be searched for in the METAWARDSDATA model_data directory
- repository (str) – The location of the cloned METAWARDSDATA repository
- folder (str) – The name of the folder within the METAWARDSDATA repository that contains the model data
- filename (str) – The name of the file to load the model data from - this directly loads this file without searching through the METAWARDSDATA repository
Returns: input_files – The constructed and validated set of input files
Return type:
-
lookup
= None¶ File to look up metadata about the wards (e.g. their names)
-
lookup_columns
= None¶ Which columns in this file have the data
-
nodes_to_track
= None¶ File from which to read the list of nodes to track
-
play
= None¶ File from which to read the play matrix of links
-
play_size
= None¶ File from which to read the size of the population in the play file
-
position
= None¶ File from which to read the positions (locations) of the wards (the centre of the bounding boxes)
-
seed
= None¶ File from which to read the values to seed the wards
-
uv
= None¶ UV file
-
weekend
= None¶ File from which to read the weekend matrix of links
-
work
= None¶ File from which to read the work matrix of links
-
work_size
= None¶ File from which to read the size of the population in the work file
-