7.2. copro.conflict.conflict_in_previous_year

copro.conflict.conflict_in_previous_year(config, conflict_gdf, extent_gdf, sim_year, check_neighbors=False, neighboring_matrix=None)[source]

Creates a list for each timestep with boolean information whether a conflict took place in a polygon at the previous timestep or not. If the current time step is the first (t=0), then this year is skipped and the model continues at the next time step.

Parameters
  • config (ConfigParser-object) – object containing the parsed configuration-settings of the model.

  • conflict_gdf (geodataframe) – geo-dataframe containing georeferenced information of conflict (tested with PRIO/UCDP data).

  • extent_gdf (geodataframe) – geo-dataframe containing one or more polygons with geometry information for which values are extracted.

  • sim_year (int) – year for which data is extracted.

  • check_neighbors (bool) – whether to check conflict events in neighboring polygons. Defaults to False.

  • neighboring_matrix (dataframe) – lookup-dataframe indicating which polygons are mutual neighbors. Defaults to None.

Raises
  • ValueError – raised if check_neighbors is True, but no matrix is provided.

  • AssertionError – raised if the length of output list does not match length of input geo-dataframe.

Returns

list containing 0/1 per polygon depending on conflict occurence if checkinf for conflict at t-1, and containing log-transformed number of conflict events in neighboring polygons if specified.

Return type

list