sapor 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (326) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/bin/create_installation_package.sh +1 -1
  4. data/bin/install.sh +1 -1
  5. data/bin/sapor.rb +1 -1
  6. data/bin/sapor.sh +1 -1
  7. data/data/hu/hungary-2014.txt +1 -1
  8. data/data/hu/hungary_2014_screen_scraper.rb +1 -1
  9. data/data/hu/hungary_2014_to_psv.rb +2 -2
  10. data/data/ie/2016-04-28_general-election-2016-candidate-details-csv_en.csv +552 -0
  11. data/data/ie/ireland_2016_to_psv.rb +138 -0
  12. data/data/no/2020-01-01_partifordeling_1_st_2017.csv +335 -0
  13. data/data/no/norway_2017_to_psv.rb +61 -0
  14. data/data/pl/poland_2015_to_psv.rb +2 -2
  15. data/data/pl/poland_2015_to_psv_with_ko_and_rsw.rb +2 -2
  16. data/data/pl/poland_2015_to_psv_with_ko_konf_kp_l_and_zp.rb +2 -2
  17. data/data/pl/poland_2015_to_psv_with_ko_sld_and_wi.rb +2 -2
  18. data/data/pl/poland_2015_to_psv_with_sld.rb +2 -2
  19. data/data/pl/poland_2015_to_psv_with_sld_and_wi.rb +2 -2
  20. data/data/uk/united_kingdom_2015_to_psv.rb +2 -2
  21. data/data/uk/united_kingdom_2017_to_psv.rb +2 -2
  22. data/data/uk/united_kingdom_2017_to_psv_with_brexit_and_chuk.rb +2 -2
  23. data/data/uk/united_kingdom_2017_to_psv_with_tig.rb +2 -2
  24. data/lib/sapor.rb +3 -3
  25. data/lib/sapor/binomials_cache.rb +1 -1
  26. data/lib/sapor/combinations_distribution.rb +1 -1
  27. data/lib/sapor/denominators.rb +1 -1
  28. data/lib/sapor/dichotomies.rb +1 -1
  29. data/lib/sapor/dichotomy.rb +1 -1
  30. data/lib/sapor/first_past_the_post.rb +1 -1
  31. data/lib/sapor/largest_remainder.rb +1 -1
  32. data/lib/sapor/log4r_logger.rb +1 -1
  33. data/lib/sapor/log_facade.rb +1 -1
  34. data/lib/sapor/many_past_the_post.rb +113 -0
  35. data/lib/sapor/multi_district_leveled_proportional.rb +1 -1
  36. data/lib/sapor/multi_district_proportional.rb +1 -1
  37. data/lib/sapor/multi_district_variable_threshold_proportional.rb +1 -1
  38. data/lib/sapor/number_formatter.rb +1 -1
  39. data/lib/sapor/options.rb +1 -1
  40. data/lib/sapor/poll.rb +12 -14
  41. data/lib/sapor/polychotomy.rb +1 -1
  42. data/lib/sapor/pseudorandom_multirange_enumerator.rb +1 -1
  43. data/lib/sapor/referendum_polychotomy.rb +1 -1
  44. data/lib/sapor/regional_data/area.rb +28 -10
  45. data/lib/sapor/regional_data/austria.rb +1 -1
  46. data/lib/sapor/regional_data/belgium-brussels-2014.psv +1 -1
  47. data/lib/sapor/regional_data/belgium-brussels-20190526.psv +1 -1
  48. data/lib/sapor/regional_data/belgium-flanders-2014.psv +1 -1
  49. data/lib/sapor/regional_data/belgium-flanders-20190526.psv +1 -1
  50. data/lib/sapor/regional_data/belgium-wallonia-2014.psv +1 -1
  51. data/lib/sapor/regional_data/belgium-wallonia-20190526.psv +1 -1
  52. data/lib/sapor/regional_data/belgium.rb +1 -1
  53. data/lib/sapor/regional_data/belgium_brussels.rb +1 -1
  54. data/lib/sapor/regional_data/belgium_flanders.rb +1 -1
  55. data/lib/sapor/regional_data/belgium_wallonia.rb +1 -1
  56. data/lib/sapor/regional_data/catalonia-2012-2015.psv +1 -1
  57. data/lib/sapor/regional_data/catalonia-2012.psv +1 -1
  58. data/lib/sapor/regional_data/catalonia-2015-jxcat.psv +1 -1
  59. data/lib/sapor/regional_data/catalonia-2015-no-jxsi.psv +1 -1
  60. data/lib/sapor/regional_data/catalonia-2015.psv +1 -1
  61. data/lib/sapor/regional_data/catalonia-20171221-with-vox.psv +67 -0
  62. data/lib/sapor/regional_data/catalonia-20171221.psv +61 -0
  63. data/lib/sapor/regional_data/catalonia.rb +57 -29
  64. data/lib/sapor/regional_data/denmark-20150618-with-e-and-p.psv +1 -1
  65. data/lib/sapor/regional_data/denmark-20150618-with-e.psv +1 -1
  66. data/lib/sapor/regional_data/denmark-20150618-with-p.psv +1 -1
  67. data/lib/sapor/regional_data/denmark-20150618.psv +1 -1
  68. data/lib/sapor/regional_data/denmark.rb +1 -1
  69. data/lib/sapor/regional_data/denmark_with_e.rb +1 -1
  70. data/lib/sapor/regional_data/denmark_with_e_and_p.rb +1 -1
  71. data/lib/sapor/regional_data/denmark_with_p.rb +1 -1
  72. data/lib/sapor/regional_data/estonia.rb +1 -1
  73. data/lib/sapor/regional_data/european-union-great-britain-20140522-brexit-chuk.psv +1 -1
  74. data/lib/sapor/regional_data/european-union-great-britain-20140522.psv +1 -1
  75. data/lib/sapor/regional_data/european-union-great-britain-20190523.psv +1 -1
  76. data/lib/sapor/regional_data/european-union-ireland-2014-ia-ri-sd.psv +1 -1
  77. data/lib/sapor/regional_data/european-union-ireland-2014-ia-sd.psv +1 -1
  78. data/lib/sapor/regional_data/european-union-ireland-2014-ia.psv +1 -1
  79. data/lib/sapor/regional_data/european-union-ireland-2014-sd.psv +1 -1
  80. data/lib/sapor/regional_data/european-union-ireland-2014.psv +1 -1
  81. data/lib/sapor/regional_data/european-union-ireland-20190524-ia.psv +1 -1
  82. data/lib/sapor/regional_data/european-union-ireland-20190524.psv +1 -1
  83. data/lib/sapor/regional_data/european_union_27_austria.rb +1 -1
  84. data/lib/sapor/regional_data/european_union_27_croatia.rb +4 -2
  85. data/lib/sapor/regional_data/european_union_27_denmark.rb +1 -1
  86. data/lib/sapor/regional_data/european_union_27_estonia.rb +1 -1
  87. data/lib/sapor/regional_data/european_union_27_finland.rb +1 -1
  88. data/lib/sapor/regional_data/european_union_27_france.rb +1 -1
  89. data/lib/sapor/regional_data/european_union_27_ireland.rb +1 -1
  90. data/lib/sapor/regional_data/european_union_27_ireland_with_ia.rb +1 -1
  91. data/lib/sapor/regional_data/european_union_27_italy.rb +1 -1
  92. data/lib/sapor/regional_data/european_union_27_netherlands.rb +1 -1
  93. data/lib/sapor/regional_data/european_union_27_poland.rb +1 -1
  94. data/lib/sapor/regional_data/european_union_27_romania.rb +1 -1
  95. data/lib/sapor/regional_data/european_union_27_slovakia.rb +1 -1
  96. data/lib/sapor/regional_data/european_union_27_spain.rb +1 -1
  97. data/lib/sapor/regional_data/european_union_27_sweden.rb +1 -1
  98. data/lib/sapor/regional_data/european_union_austria.rb +1 -1
  99. data/lib/sapor/regional_data/european_union_bulgaria.rb +1 -1
  100. data/lib/sapor/regional_data/european_union_croatia.rb +4 -2
  101. data/lib/sapor/regional_data/european_union_cyprus.rb +1 -1
  102. data/lib/sapor/regional_data/european_union_czech_republic.rb +1 -1
  103. data/lib/sapor/regional_data/european_union_denmark.rb +1 -1
  104. data/lib/sapor/regional_data/european_union_estonia.rb +1 -1
  105. data/lib/sapor/regional_data/european_union_finland.rb +1 -1
  106. data/lib/sapor/regional_data/european_union_flanders.rb +1 -1
  107. data/lib/sapor/regional_data/european_union_france.rb +1 -1
  108. data/lib/sapor/regional_data/european_union_french_community_of_belgium.rb +1 -1
  109. data/lib/sapor/regional_data/european_union_germany.rb +1 -1
  110. data/lib/sapor/regional_data/european_union_great_britain.rb +1 -1
  111. data/lib/sapor/regional_data/european_union_greece.rb +1 -1
  112. data/lib/sapor/regional_data/european_union_hungary.rb +1 -1
  113. data/lib/sapor/regional_data/european_union_ireland.rb +1 -1
  114. data/lib/sapor/regional_data/european_union_ireland_with_ia.rb +1 -1
  115. data/lib/sapor/regional_data/european_union_italy.rb +1 -1
  116. data/lib/sapor/regional_data/european_union_latvia.rb +1 -1
  117. data/lib/sapor/regional_data/european_union_lithuania.rb +1 -1
  118. data/lib/sapor/regional_data/european_union_luxembourg.rb +1 -1
  119. data/lib/sapor/regional_data/european_union_malta.rb +1 -1
  120. data/lib/sapor/regional_data/european_union_netherlands.rb +1 -1
  121. data/lib/sapor/regional_data/european_union_northern_ireland.rb +1 -1
  122. data/lib/sapor/regional_data/european_union_poland.rb +1 -1
  123. data/lib/sapor/regional_data/european_union_portugal.rb +1 -1
  124. data/lib/sapor/regional_data/european_union_romania.rb +1 -1
  125. data/lib/sapor/regional_data/european_union_slovakia.rb +1 -1
  126. data/lib/sapor/regional_data/european_union_slovenia.rb +1 -1
  127. data/lib/sapor/regional_data/european_union_spain.rb +1 -1
  128. data/lib/sapor/regional_data/european_union_sweden.rb +1 -1
  129. data/lib/sapor/regional_data/finland-20150419-with-sin.psv +1 -1
  130. data/lib/sapor/regional_data/finland-20150419.psv +1 -1
  131. data/lib/sapor/regional_data/finland.rb +1 -1
  132. data/lib/sapor/regional_data/finland_with_sin.rb +1 -1
  133. data/lib/sapor/regional_data/flanders-2014.psv +1 -1
  134. data/lib/sapor/regional_data/flanders-20190526.psv +1 -1
  135. data/lib/sapor/regional_data/flanders.rb +1 -1
  136. data/lib/sapor/regional_data/france.rb +1 -1
  137. data/lib/sapor/regional_data/greece.rb +1 -1
  138. data/lib/sapor/regional_data/hungary-2014.psv +1 -1
  139. data/lib/sapor/regional_data/hungary.rb +1 -1
  140. data/lib/sapor/regional_data/iceland-20161029-midflokkurinn.psv +1 -1
  141. data/lib/sapor/regional_data/iceland-20161029.psv +1 -1
  142. data/lib/sapor/regional_data/iceland-20171028-with-j.psv +94 -0
  143. data/lib/sapor/regional_data/iceland-20171028.psv +1 -1
  144. data/lib/sapor/regional_data/iceland.rb +32 -16
  145. data/lib/sapor/regional_data/ireland-20160226-2020-candidates.psv +322 -0
  146. data/lib/sapor/regional_data/ireland-20160226-2020.psv +344 -0
  147. data/lib/sapor/regional_data/ireland-20160226.psv +348 -0
  148. data/lib/sapor/regional_data/ireland.rb +165 -0
  149. data/lib/sapor/regional_data/latvia-20141004-kpv-p-par.psv +1 -1
  150. data/lib/sapor/regional_data/latvia-20141004-kpv-par.psv +1 -1
  151. data/lib/sapor/regional_data/latvia-20141004-kpv.psv +1 -1
  152. data/lib/sapor/regional_data/latvia-20141004.psv +1 -1
  153. data/lib/sapor/regional_data/latvia-20181006.psv +1 -1
  154. data/lib/sapor/regional_data/latvia.rb +1 -1
  155. data/lib/sapor/regional_data/luxembourg-20131020.psv +1 -1
  156. data/lib/sapor/regional_data/luxembourg-20181014.psv +1 -1
  157. data/lib/sapor/regional_data/luxembourg.rb +1 -1
  158. data/lib/sapor/regional_data/netherlands.rb +1 -1
  159. data/lib/sapor/regional_data/norway-20170911.psv +331 -0
  160. data/lib/sapor/regional_data/norway.rb +44 -339
  161. data/lib/sapor/regional_data/norwegian_municipality.rb +1 -1
  162. data/lib/sapor/regional_data/poland-20151025-with-ko-and-l-without-n-po-r-and-zl.psv +1 -1
  163. data/lib/sapor/regional_data/poland-20151025-with-ko-konf-kp-l-and-zp-without-k-k15-n-pis-po-psl-r-and-zl.psv +1 -1
  164. data/lib/sapor/regional_data/poland-20151025-with-ko-sld-and-wi-without-n-po-and-zl.psv +1 -1
  165. data/lib/sapor/regional_data/poland-20151025-with-sld-and-wi-without-zl.psv +1 -1
  166. data/lib/sapor/regional_data/poland-20151025-with-sld-without-zl.psv +1 -1
  167. data/lib/sapor/regional_data/poland-20151025.psv +1 -1
  168. data/lib/sapor/regional_data/poland.rb +1 -1
  169. data/lib/sapor/regional_data/poland_with_ko_and_l_without_n_po_r_and_zl.rb +1 -1
  170. data/lib/sapor/regional_data/poland_with_ko_konf_kp_l_and_zp_without_k_k15_n_pis_po_psl_r_and_zl.rb +1 -1
  171. data/lib/sapor/regional_data/poland_with_ko_sld_and_wi_without_n_po_and_zl.rb +1 -1
  172. data/lib/sapor/regional_data/poland_with_sld_and_wi_without_zl.rb +1 -1
  173. data/lib/sapor/regional_data/poland_with_sld_without_zl.rb +1 -1
  174. data/lib/sapor/regional_data/portugal-20151004-with-a-and-ch-without-paf.psv +1 -1
  175. data/lib/sapor/regional_data/portugal-20151004-with-a-and-il-without-paf.psv +1 -1
  176. data/lib/sapor/regional_data/portugal-20151004-with-a-ch-and-il-without-paf.psv +1 -1
  177. data/lib/sapor/regional_data/portugal-20151004-with-a-without-paf.psv +1 -1
  178. data/lib/sapor/regional_data/portugal-20151004-with-ch-and-il-without-paf.psv +1 -1
  179. data/lib/sapor/regional_data/portugal-20151004-without-paf.psv +1 -1
  180. data/lib/sapor/regional_data/portugal-20151004.psv +1 -1
  181. data/lib/sapor/regional_data/portugal.rb +1 -1
  182. data/lib/sapor/regional_data/portugal_with_a_and_ch_without_paf.rb +1 -1
  183. data/lib/sapor/regional_data/portugal_with_a_and_il_without_paf.rb +1 -1
  184. data/lib/sapor/regional_data/portugal_with_a_ch_and_il_without_paf.rb +1 -1
  185. data/lib/sapor/regional_data/portugal_with_a_without_paf.rb +1 -1
  186. data/lib/sapor/regional_data/portugal_with_ch_and_il_without_paf.rb +1 -1
  187. data/lib/sapor/regional_data/portugal_without_paf.rb +1 -1
  188. data/lib/sapor/regional_data/slovakia.rb +1 -1
  189. data/lib/sapor/regional_data/slovenia.rb +1 -1
  190. data/lib/sapor/regional_data/spain-20160626.psv +1 -1
  191. data/lib/sapor/regional_data/spain.rb +1 -1
  192. data/lib/sapor/regional_data/sweden.rb +1 -1
  193. data/lib/sapor/regional_data/sweden_20140914.rb +1 -1
  194. data/lib/sapor/regional_data/united_kingdom-2015.psv +1 -1
  195. data/lib/sapor/regional_data/united_kingdom-20170608-brexit-chuk.psv +1 -1
  196. data/lib/sapor/regional_data/united_kingdom-20170608-brexit.psv +1 -1
  197. data/lib/sapor/regional_data/united_kingdom-20170608-tig.psv +1 -1
  198. data/lib/sapor/regional_data/united_kingdom-20170608.psv +1 -1
  199. data/lib/sapor/regional_data/united_kingdom.rb +1 -1
  200. data/lib/sapor/regional_data/united_kingdom_with_brexit.rb +1 -1
  201. data/lib/sapor/regional_data/united_kingdom_with_brexit_and_chuk.rb +1 -1
  202. data/lib/sapor/regional_data/united_kingdom_with_tig.rb +1 -1
  203. data/lib/sapor/regional_data/utopia.rb +1 -1
  204. data/lib/sapor/regional_data/wallonia-2014.psv +1 -1
  205. data/lib/sapor/regional_data/wallonia-20190526.psv +1 -1
  206. data/lib/sapor/regional_data/wallonia.rb +1 -1
  207. data/lib/sapor/representatives_polychotomy.rb +1 -1
  208. data/lib/sapor/single_district_proportional.rb +1 -1
  209. data/sapor.gemspec +2 -2
  210. data/spec/integration/area_spec.rb +1 -1
  211. data/spec/integration/poll_spec.rb +1 -1
  212. data/spec/spec_helper.rb +1 -1
  213. data/spec/unit/area_spec.rb +1 -1
  214. data/spec/unit/austria_spec.rb +1 -1
  215. data/spec/unit/belgium_brussels_spec.rb +1 -1
  216. data/spec/unit/belgium_flanders_spec.rb +1 -1
  217. data/spec/unit/belgium_spec.rb +1 -1
  218. data/spec/unit/belgium_wallonia_spec.rb +1 -1
  219. data/spec/unit/binomials_cache_spec.rb +1 -1
  220. data/spec/unit/catalonia_spec.rb +13 -26
  221. data/spec/unit/catalonia_with_vox_spec.rb +62 -0
  222. data/spec/unit/combinations_distribution_spec.rb +1 -1
  223. data/spec/unit/denmark_spec.rb +1 -1
  224. data/spec/unit/denmark_with_e_and_p_spec.rb +1 -1
  225. data/spec/unit/denmark_with_e_spec.rb +1 -1
  226. data/spec/unit/denmark_with_p_spec.rb +1 -1
  227. data/spec/unit/denominators_spec.rb +1 -1
  228. data/spec/unit/dichotomies_spec.rb +1 -1
  229. data/spec/unit/dichotomy_spec.rb +1 -1
  230. data/spec/unit/estonia_spec.rb +1 -1
  231. data/spec/unit/european_union_27_austria_spec.rb +1 -1
  232. data/spec/unit/european_union_27_croatia_spec.rb +1 -1
  233. data/spec/unit/european_union_27_denmark_spec.rb +1 -1
  234. data/spec/unit/european_union_27_estonia_spec.rb +1 -1
  235. data/spec/unit/european_union_27_finland_spec.rb +1 -1
  236. data/spec/unit/european_union_27_france_spec.rb +1 -1
  237. data/spec/unit/european_union_27_ireland_spec.rb +1 -1
  238. data/spec/unit/european_union_27_ireland_with_ia_spec.rb +1 -1
  239. data/spec/unit/european_union_27_italy_spec.rb +1 -1
  240. data/spec/unit/european_union_27_netherlands_spec.rb +1 -1
  241. data/spec/unit/european_union_27_poland_spec.rb +1 -1
  242. data/spec/unit/european_union_27_romania_spec.rb +1 -1
  243. data/spec/unit/european_union_27_slovakia_spec.rb +1 -1
  244. data/spec/unit/european_union_27_spain_spec.rb +1 -1
  245. data/spec/unit/european_union_27_sweden_spec.rb +1 -1
  246. data/spec/unit/european_union_austria_spec.rb +1 -1
  247. data/spec/unit/european_union_bulgaria_spec.rb +1 -1
  248. data/spec/unit/european_union_croatia_spec.rb +1 -1
  249. data/spec/unit/european_union_cyprus_spec.rb +1 -1
  250. data/spec/unit/european_union_czech_republic_spec.rb +1 -1
  251. data/spec/unit/european_union_denmark_spec.rb +1 -1
  252. data/spec/unit/european_union_estonia_spec.rb +1 -1
  253. data/spec/unit/european_union_finland_spec.rb +1 -1
  254. data/spec/unit/european_union_flanders_spec.rb +1 -1
  255. data/spec/unit/european_union_france_spec.rb +1 -1
  256. data/spec/unit/european_union_french_community_of_belgium_spec.rb +1 -1
  257. data/spec/unit/european_union_germany_spec.rb +1 -1
  258. data/spec/unit/european_union_great_britain_spec.rb +1 -1
  259. data/spec/unit/european_union_greece_spec.rb +1 -1
  260. data/spec/unit/european_union_hungary_spec.rb +1 -1
  261. data/spec/unit/european_union_ireland_spec.rb +1 -1
  262. data/spec/unit/european_union_ireland_with_ia_spec.rb +1 -1
  263. data/spec/unit/european_union_italy_spec.rb +1 -1
  264. data/spec/unit/european_union_latvia_spec.rb +1 -1
  265. data/spec/unit/european_union_lithuania_spec.rb +1 -1
  266. data/spec/unit/european_union_luxembourg_spec.rb +1 -1
  267. data/spec/unit/european_union_malta_spec.rb +1 -1
  268. data/spec/unit/european_union_netherlands_spec.rb +1 -1
  269. data/spec/unit/european_union_northern_ireland_spec.rb +1 -1
  270. data/spec/unit/european_union_poland_spec.rb +1 -1
  271. data/spec/unit/european_union_portugal_spec.rb +1 -1
  272. data/spec/unit/european_union_romania_spec.rb +1 -1
  273. data/spec/unit/european_union_slovakia_spec.rb +1 -1
  274. data/spec/unit/european_union_slovenia_spec.rb +1 -1
  275. data/spec/unit/european_union_spain_spec.rb +1 -1
  276. data/spec/unit/european_union_sweden_spec.rb +1 -1
  277. data/spec/unit/finland_spec.rb +1 -1
  278. data/spec/unit/finland_with_sin_spec.rb +1 -1
  279. data/spec/unit/first_past_the_post_spec.rb +1 -1
  280. data/spec/unit/flanders_spec.rb +1 -1
  281. data/spec/unit/france_spec.rb +1 -1
  282. data/spec/unit/greece_spec.rb +1 -1
  283. data/spec/unit/hungary_spec.rb +1 -1
  284. data/spec/unit/iceland_spec.rb +1 -1
  285. data/spec/unit/iceland_with_j_spec.rb +58 -0
  286. data/spec/unit/ireland_2016_spec.rb +62 -0
  287. data/spec/unit/ireland_spec.rb +62 -0
  288. data/spec/unit/largest_remainder_spec.rb +1 -1
  289. data/spec/unit/latvia_spec.rb +1 -1
  290. data/spec/unit/luxembourg_spec.rb +1 -1
  291. data/spec/unit/multi_district_leveled_proportional_spec.rb +1 -1
  292. data/spec/unit/multi_district_proportional_spec.rb +1 -1
  293. data/spec/unit/netherlands_spec.rb +1 -1
  294. data/spec/unit/norway_spec.rb +26 -21
  295. data/spec/unit/norwegian_municipality_spec.rb +1 -1
  296. data/spec/unit/number_formatter_spec.rb +1 -1
  297. data/spec/unit/poland_spec.rb +1 -1
  298. data/spec/unit/poland_with_ko_and_l_without_n_po_r_and_zl_spec.rb +1 -1
  299. data/spec/unit/poland_with_ko_konf_kp_l_and_zp_without_k_k15_n_pis_po_psl_r_and_zl_spec.rb +1 -1
  300. data/spec/unit/poland_with_ko_sld_and_wi_without_n_po_and_zl_spec.rb +1 -1
  301. data/spec/unit/poland_with_sld_and_wi_without_zl_spec.rb +1 -1
  302. data/spec/unit/poland_with_sld_without_zl_spec.rb +1 -1
  303. data/spec/unit/poll_spec.rb +1 -1
  304. data/spec/unit/portugal_spec.rb +1 -1
  305. data/spec/unit/portugal_with_a_and_ch_without_paf_spec.rb +1 -1
  306. data/spec/unit/portugal_with_a_and_il_without_paf_spec.rb +1 -1
  307. data/spec/unit/portugal_with_a_ch_and_il_without_paf_spec.rb +1 -1
  308. data/spec/unit/portugal_with_a_without_paf_spec.rb +1 -1
  309. data/spec/unit/portugal_with_ch_and_il_without_paf_spec.rb +1 -1
  310. data/spec/unit/portugal_without_paf_spec.rb +1 -1
  311. data/spec/unit/pseudorandom_multirange_enumerator_spec.rb +1 -1
  312. data/spec/unit/referendum_polychotomy_spec.rb +1 -1
  313. data/spec/unit/representatives_polychotomy_spec.rb +1 -1
  314. data/spec/unit/slovakia_spec.rb +1 -1
  315. data/spec/unit/slovenia_spec.rb +1 -1
  316. data/spec/unit/spain_spec.rb +1 -1
  317. data/spec/unit/sweden_20140914_spec.rb +1 -1
  318. data/spec/unit/sweden_spec.rb +1 -1
  319. data/spec/unit/united_kingdom_spec.rb +1 -1
  320. data/spec/unit/united_kingdom_with_brexit_and_chuk_spec.rb +1 -1
  321. data/spec/unit/united_kingdom_with_brexit_spec.rb +1 -1
  322. data/spec/unit/united_kingdom_with_tig_spec.rb +1 -1
  323. data/spec/unit/wallonia_spec.rb +1 -1
  324. metadata +23 -4
  325. data/lib/sapor/regional_data/catalonia-jxcat.rb +0 -109
  326. data/lib/sapor/regional_data/catalonia-no-jxsi.rb +0 -96
@@ -0,0 +1,348 @@
1
+ # Statistical Analysis of Polling Results (SAPoR)
2
+ # Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
3
+ #
4
+ # This file is part of SAPoR.
5
+ #
6
+ # SAPoR is free software: you can redistribute it and/or modify it under the
7
+ # terms of the GNU General Public License as published by the Free Software
8
+ # Foundation, either version 3 of the License, or (at your option) any later
9
+ # version.
10
+ #
11
+ # SAPoR is distributed in the hope that it will be useful, but WITHOUT ANY
12
+ # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13
+ # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14
+ #
15
+ # You can find a copy of the GNU General Public License in /doc/gpl.txt
16
+ #
17
+ Carlow–Kilkenny | Fianna Fáil | 28267 | 3
18
+ Carlow–Kilkenny | Fine Gael | 19147 | 3
19
+ Carlow–Kilkenny | Green Party/Comhaontas Glas | 2621 | 1
20
+ Carlow–Kilkenny | Independent | 1698 | 3
21
+ Carlow–Kilkenny | Labour Party | 4391 | 1
22
+ Carlow–Kilkenny | Renua Ireland | 2483 | 1
23
+ Carlow–Kilkenny | Sinn Féin | 8700 | 1
24
+ Carlow–Kilkenny | Solidarity–People Before Profit | 2702 | 2
25
+ Cavan–Monaghan | Direct Democracy Ireland | 754 | 2
26
+ Cavan–Monaghan | Fianna Fáil | 17952 | 3
27
+ Cavan–Monaghan | Fine Gael | 18957 | 2
28
+ Cavan–Monaghan | Green Party/Comhaontas Glas | 1251 | 1
29
+ Cavan–Monaghan | Independent | 4610 | 5
30
+ Cavan–Monaghan | Sinn Féin | 16126 | 2
31
+ Clare | Fianna Fáil | 17580 | 3
32
+ Clare | Fine Gael | 14707 | 3
33
+ Clare | Fís Nua | 1154 | 1
34
+ Clare | Green Party/Comhaontas Glas | 1700 | 1
35
+ Clare | Independent | 13171 | 6
36
+ Clare | Labour Party | 4472 | 1
37
+ Clare | Sinn Féin | 4216 | 1
38
+ Cork East | Fianna Fáil | 12858 | 2
39
+ Cork East | Fine Gael | 15038 | 3
40
+ Cork East | Green Party/Comhaontas Glas | 806 | 1
41
+ Cork East | Independent | 5168 | 4
42
+ Cork East | Labour Party | 6949 | 1
43
+ Cork East | Renua Ireland | 3244 | 1
44
+ Cork East | Sinn Féin | 5358 | 1
45
+ Cork East | Social Democrats | 1386 | 1
46
+ Cork East | Solidarity–People Before Profit | 1999 | 1
47
+ Cork North-Central | Fianna Fáil | 14286 | 1
48
+ Cork North-Central | Fine Gael | 9105 | 2
49
+ Cork North-Central | Green Party/Comhaontas Glas | 1693 | 1
50
+ Cork North-Central | Independent | 1783 | 4
51
+ Cork North-Central | Labour Party | 3723 | 1
52
+ Cork North-Central | Renua Ireland | 1120 | 1
53
+ Cork North-Central | Sinn Féin | 10004 | 2
54
+ Cork North-Central | Solidarity–People Before Profit | 8041 | 1
55
+ Cork North-Central | Workers’ Party | 1419 | 1
56
+ Cork North-West | Communist Party of Ireland | 185 | 1
57
+ Cork North-West | Fianna Fáil | 16256 | 2
58
+ Cork North-West | Fine Gael | 15106 | 2
59
+ Cork North-West | Green Party/Comhaontas Glas | 1354 | 1
60
+ Cork North-West | Independent | 9251 | 5
61
+ Cork North-West | Renua Ireland | 1568 | 1
62
+ Cork North-West | Sinn Féin | 3238 | 1
63
+ Cork South-Central | Fianna Fáil | 23141 | 2
64
+ Cork South-Central | Fine Gael | 14384 | 2
65
+ Cork South-Central | Green Party/Comhaontas Glas | 2064 | 1
66
+ Cork South-Central | Independent | 4071 | 5
67
+ Cork South-Central | Labour Party | 2417 | 1
68
+ Cork South-Central | Renua Ireland | 887 | 1
69
+ Cork South-Central | Sinn Féin | 6986 | 1
70
+ Cork South-Central | Solidarity–People Before Profit | 1732 | 2
71
+ Cork South-West | Catholic Democrats | 686 | 1
72
+ Cork South-West | Fianna Fáil | 8482 | 1
73
+ Cork South-West | Fine Gael | 13803 | 2
74
+ Cork South-West | Green Party/Comhaontas Glas | 752 | 1
75
+ Cork South-West | Independent | 12844 | 4
76
+ Cork South-West | Labour Party | 3035 | 1
77
+ Cork South-West | Sinn Féin | 3656 | 1
78
+ Donegal | Fianna Fáil | 22731 | 2
79
+ Donegal | Fine Gael | 11243 | 2
80
+ Donegal | Fís Nua | 70 | 1
81
+ Donegal | Green Party/Comhaontas Glas | 428 | 1
82
+ Donegal | Independent | 18653 | 7
83
+ Donegal | Sinn Féin | 20178 | 3
84
+ Dublin Bay North | Fianna Fáil | 11367 | 2
85
+ Dublin Bay North | Fine Gael | 14517 | 3
86
+ Dublin Bay North | Green Party/Comhaontas Glas | 1024 | 1
87
+ Dublin Bay North | Independent | 13401 | 6
88
+ Dublin Bay North | Independents 4 Change | 5361 | 1
89
+ Dublin Bay North | Labour Party | 5675 | 1
90
+ Dublin Bay North | Renua Ireland | 3205 | 1
91
+ Dublin Bay North | Sinn Féin | 8566 | 2
92
+ Dublin Bay North | Social Democrats | 3864 | 1
93
+ Dublin Bay North | Solidarity–People Before Profit | 6645 | 2
94
+ Dublin Bay South | Fianna Fáil | 4575 | 1
95
+ Dublin Bay South | Fine Gael | 11966 | 2
96
+ Dublin Bay South | Green Party/Comhaontas Glas | 4529 | 1
97
+ Dublin Bay South | Independent | 2045 | 5
98
+ Dublin Bay South | Labour Party | 4205 | 1
99
+ Dublin Bay South | Renua Ireland | 4229 | 1
100
+ Dublin Bay South | Sinn Féin | 3774 | 1
101
+ Dublin Bay South | Social Democrats | 2652 | 1
102
+ Dublin Bay South | Solidarity–People Before Profit | 1728 | 1
103
+ Dublin Central | Direct Democracy Ireland | 62 | 1
104
+ Dublin Central | Fianna Fáil | 2508 | 1
105
+ Dublin Central | Fine Gael | 3226 | 1
106
+ Dublin Central | Green Party/Comhaontas Glas | 644 | 1
107
+ Dublin Central | Independent | 5723 | 5
108
+ Dublin Central | Labour Party | 2092 | 1
109
+ Dublin Central | Renua Ireland | 330 | 1
110
+ Dublin Central | Sinn Féin | 5770 | 1
111
+ Dublin Central | Social Democrats | 2307 | 1
112
+ Dublin Central | Solidarity–People Before Profit | 721 | 1
113
+ Dublin Central | Workers’ Party | 303 | 1
114
+ Dublin Fingal | Fianna Fáil | 14185 | 2
115
+ Dublin Fingal | Fine Gael | 12180 | 2
116
+ Dublin Fingal | Green Party/Comhaontas Glas | 2783 | 1
117
+ Dublin Fingal | Independent | 3953 | 4
118
+ Dublin Fingal | Independents 4 Change | 11892 | 2
119
+ Dublin Fingal | Labour Party | 6009 | 1
120
+ Dublin Fingal | Renua Ireland | 2091 | 1
121
+ Dublin Fingal | Sinn Féin | 5228 | 1
122
+ Dublin Fingal | Solidarity–People Before Profit | 2067 | 1
123
+ Dublin Mid-West | Direct Democracy Ireland | 167 | 1
124
+ Dublin Mid-West | Fianna Fáil | 6971 | 1
125
+ Dublin Mid-West | Fine Gael | 11365 | 2
126
+ Dublin Mid-West | Green Party/Comhaontas Glas | 388 | 1
127
+ Dublin Mid-West | Independent | 4521 | 5
128
+ Dublin Mid-West | Labour Party | 2146 | 1
129
+ Dublin Mid-West | Sinn Féin | 9782 | 1
130
+ Dublin Mid-West | Social Democrats | 2633 | 1
131
+ Dublin Mid-West | Solidarity–People Before Profit | 4629 | 1
132
+ Dublin Mid-West | Workers’ Party | 502 | 1
133
+ Dublin North-West | Direct Democracy Ireland | 158 | 1
134
+ Dublin North-West | Fianna Fáil | 4750 | 1
135
+ Dublin North-West | Fine Gael | 4642 | 1
136
+ Dublin North-West | Green Party/Comhaontas Glas | 915 | 1
137
+ Dublin North-West | Independent | 1120 | 1
138
+ Dublin North-West | Labour Party | 2750 | 1
139
+ Dublin North-West | Sinn Féin | 10008 | 2
140
+ Dublin North-West | Social Democrats | 10540 | 1
141
+ Dublin North-West | Solidarity–People Before Profit | 1434 | 1
142
+ Dublin North-West | Workers’ Party | 692 | 1
143
+ Dublin Rathdown | Fianna Fáil | 4220 | 1
144
+ Dublin Rathdown | Fine Gael | 12573 | 2
145
+ Dublin Rathdown | Green Party/Comhaontas Glas | 4122 | 1
146
+ Dublin Rathdown | Independent | 12223 | 2
147
+ Dublin Rathdown | Labour Party | 4048 | 1
148
+ Dublin Rathdown | Renua Ireland | 1055 | 1
149
+ Dublin Rathdown | Sinn Féin | 2858 | 1
150
+ Dublin South-Central | Direct Democracy Ireland | 407 | 1
151
+ Dublin South-Central | Fianna Fáil | 5441 | 1
152
+ Dublin South-Central | Fine Gael | 6130 | 1
153
+ Dublin South-Central | Green Party/Comhaontas Glas | 1410 | 1
154
+ Dublin South-Central | Independent | 2305 | 2
155
+ Dublin South-Central | Independents 4 Change | 6195 | 1
156
+ Dublin South-Central | Labour Party | 3297 | 1
157
+ Dublin South-Central | Renua Ireland | 893 | 1
158
+ Dublin South-Central | Sinn Féin | 9971 | 2
159
+ Dublin South-Central | Social Democrats | 2434 | 1
160
+ Dublin South-Central | Solidarity–People Before Profit | 4374 | 1
161
+ Dublin South-West | Direct Democracy Ireland | 359 | 1
162
+ Dublin South-West | Fianna Fáil | 9647 | 1
163
+ Dublin South-West | Fine Gael | 14746 | 3
164
+ Dublin South-West | Green Party/Comhaontas Glas | 1297 | 1
165
+ Dublin South-West | Independent | 12102 | 8
166
+ Dublin South-West | Labour Party | 4378 | 2
167
+ Dublin South-West | Renua Ireland | 2906 | 1
168
+ Dublin South-West | Sinn Féin | 9590 | 2
169
+ Dublin South-West | Solidarity–People Before Profit | 12246 | 2
170
+ Dublin West | Fianna Fáil | 6917 | 1
171
+ Dublin West | Fine Gael | 9321 | 2
172
+ Dublin West | Green Party/Comhaontas Glas | 1730 | 1
173
+ Dublin West | Independent | 4308 | 3
174
+ Dublin West | Labour Party | 6445 | 1
175
+ Dublin West | Renua Ireland | 677 | 1
176
+ Dublin West | Sinn Féin | 6034 | 1
177
+ Dublin West | Solidarity–People Before Profit | 6520 | 1
178
+ Dún Laoghaire | Direct Democracy Ireland | 213 | 1
179
+ Dún Laoghaire | Fianna Fáil | 11143 | 2
180
+ Dún Laoghaire | Fine Gael | 21306 | 2
181
+ Dún Laoghaire | Green Party/Comhaontas Glas | 3478 | 1
182
+ Dún Laoghaire | Independent | 3152 | 1
183
+ Dún Laoghaire | Labour Party | 5192 | 1
184
+ Dún Laoghaire | Renua Ireland | 1812 | 1
185
+ Dún Laoghaire | Sinn Féin | 3167 | 1
186
+ Dún Laoghaire | Solidarity–People Before Profit | 9775 | 1
187
+ Galway East | Direct Democracy Ireland | 489 | 1
188
+ Galway East | Fianna Fáil | 12364 | 2
189
+ Galway East | Fine Gael | 13597 | 2
190
+ Galway East | Green Party/Comhaontas Glas | 769 | 1
191
+ Galway East | Independent | 10805 | 2
192
+ Galway East | Labour Party | 4531 | 1
193
+ Galway East | Sinn Féin | 2683 | 1
194
+ Galway West | Direct Democracy Ireland | 152 | 1
195
+ Galway West | Fianna Fáil | 15629 | 3
196
+ Galway West | Fine Gael | 15437 | 3
197
+ Galway West | Green Party/Comhaontas Glas | 1588 | 1
198
+ Galway West | Independent | 17024 | 7
199
+ Galway West | Labour Party | 3220 | 1
200
+ Galway West | Renua Ireland | 994 | 1
201
+ Galway West | Sinn Féin | 5755 | 1
202
+ Galway West | Social Democrats | 3455 | 1
203
+ Galway West | Solidarity–People Before Profit | 1017 | 1
204
+ Kerry | Fianna Fáil | 12504 | 2
205
+ Kerry | Fine Gael | 16939 | 3
206
+ Kerry | Green Party/Comhaontas Glas | 1011 | 1
207
+ Kerry | Independent | 32851 | 6
208
+ Kerry | Labour Party | 4813 | 1
209
+ Kerry | Renua Ireland | 716 | 1
210
+ Kerry | Sinn Féin | 9458 | 1
211
+ Kerry | Solidarity–People Before Profit | 981 | 1
212
+ Kildare North | Fianna Fáil | 13802 | 2
213
+ Kildare North | Fine Gael | 11553 | 2
214
+ Kildare North | Green Party/Comhaontas Glas | 1485 | 1
215
+ Kildare North | Independent | 1920 | 4
216
+ Kildare North | Labour Party | 4087 | 1
217
+ Kildare North | Renua Ireland | 994 | 1
218
+ Kildare North | Sinn Féin | 3205 | 1
219
+ Kildare North | Social Democrats | 11108 | 1
220
+ Kildare North | Solidarity–People Before Profit | 781 | 1
221
+ Kildare South | Fianna Fáil | 13375 | 2
222
+ Kildare South | Fine Gael | 11101 | 2
223
+ Kildare South | Green Party/Comhaontas Glas | 836 | 1
224
+ Kildare South | Independent | 2143 | 1
225
+ Kildare South | Labour Party | 4277 | 1
226
+ Kildare South | Renua Ireland | 787 | 1
227
+ Kildare South | Sinn Féin | 4267 | 1
228
+ Laois | Fianna Fáil | 13626 | 1
229
+ Laois | Fine Gael | 12603 | 2
230
+ Laois | Green Party/Comhaontas Glas | 1541 | 1
231
+ Laois | Labour Party | 2856 | 1
232
+ Laois | Sinn Féin | 8242 | 1
233
+ Limerick City | Catholic Democrats | 673 | 1
234
+ Limerick City | Fianna Fáil | 12999 | 1
235
+ Limerick City | Fine Gael | 13341 | 2
236
+ Limerick City | Green Party/Comhaontas Glas | 964 | 1
237
+ Limerick City | Independent | 332 | 2
238
+ Limerick City | Labour Party | 5227 | 1
239
+ Limerick City | Sinn Féin | 5894 | 1
240
+ Limerick City | Social Democrats | 2747 | 1
241
+ Limerick City | Solidarity–People Before Profit | 4584 | 1
242
+ Limerick County | Direct Democracy Ireland | 222 | 1
243
+ Limerick County | Fianna Fáil | 12276 | 1
244
+ Limerick County | Fine Gael | 16492 | 2
245
+ Limerick County | Green Party/Comhaontas Glas | 311 | 1
246
+ Limerick County | Independent | 8494 | 3
247
+ Limerick County | Sinn Féin | 3347 | 1
248
+ Limerick County | Social Democrats | 3270 | 1
249
+ Longford–Westmeath | Catholic Democrats | 654 | 1
250
+ Longford–Westmeath | Direct Democracy Ireland | 132 | 1
251
+ Longford–Westmeath | Fianna Fáil | 15596 | 2
252
+ Longford–Westmeath | Fine Gael | 13156 | 3
253
+ Longford–Westmeath | Green Party/Comhaontas Glas | 1102 | 1
254
+ Longford–Westmeath | Independent | 14013 | 7
255
+ Longford–Westmeath | Labour Party | 4817 | 1
256
+ Longford–Westmeath | Sinn Féin | 5270 | 1
257
+ Longford–Westmeath | Solidarity–People Before Profit | 506 | 1
258
+ Louth | Direct Democracy Ireland | 803 | 2
259
+ Louth | Fianna Fáil | 12521 | 2
260
+ Louth | Fine Gael | 13222 | 2
261
+ Louth | Green Party/Comhaontas Glas | 3187 | 1
262
+ Louth | Independent | 6606 | 3
263
+ Louth | Labour Party | 6143 | 2
264
+ Louth | Renua Ireland | 2095 | 1
265
+ Louth | Sinn Féin | 19490 | 2
266
+ Louth | Solidarity–People Before Profit | 3462 | 1
267
+ Mayo | Fianna Fáil | 17633 | 2
268
+ Mayo | Fine Gael | 32434 | 3
269
+ Mayo | Green Party/Comhaontas Glas | 629 | 1
270
+ Mayo | Independent | 4386 | 7
271
+ Mayo | Renua Ireland | 1574 | 1
272
+ Mayo | Sinn Féin | 6414 | 1
273
+ Mayo | Solidarity–People Before Profit | 576 | 1
274
+ Meath East | Direct Democracy Ireland | 794 | 1
275
+ Meath East | Fianna Fáil | 10818 | 1
276
+ Meath East | Fine Gael | 14386 | 2
277
+ Meath East | Green Party/Comhaontas Glas | 766 | 1
278
+ Meath East | Independent | 4010 | 2
279
+ Meath East | Labour Party | 2270 | 1
280
+ Meath East | Renua Ireland | 523 | 1
281
+ Meath East | Sinn Féin | 5780 | 1
282
+ Meath East | Social Democrats | 1715 | 1
283
+ Meath East | Workers’ Party | 326 | 1
284
+ Meath West | Direct Democracy Ireland | 1279 | 1
285
+ Meath West | Fianna Fáil | 10585 | 1
286
+ Meath West | Fine Gael | 12555 | 2
287
+ Meath West | Green Party/Comhaontas Glas | 1421 | 1
288
+ Meath West | Independent | 2157 | 2
289
+ Meath West | Labour Party | 1166 | 1
290
+ Meath West | Sinn Féin | 9442 | 1
291
+ Offaly | Fianna Fáil | 15760 | 2
292
+ Offaly | Fine Gael | 6838 | 1
293
+ Offaly | Green Party/Comhaontas Glas | 525 | 1
294
+ Offaly | Independent | 10540 | 4
295
+ Offaly | Irish Democratic Party | 971 | 1
296
+ Offaly | Renua Ireland | 4596 | 1
297
+ Offaly | Sinn Féin | 4804 | 1
298
+ Roscommon–Galway | Fianna Fáil | 8819 | 2
299
+ Roscommon–Galway | Fine Gael | 6812 | 1
300
+ Roscommon–Galway | Green Party/Comhaontas Glas | 286 | 1
301
+ Roscommon–Galway | Independent | 23975 | 4
302
+ Roscommon–Galway | Labour Party | 1211 | 1
303
+ Roscommon–Galway | Renua Ireland | 520 | 1
304
+ Roscommon–Galway | Sinn Féin | 3075 | 1
305
+ Roscommon–Galway | Solidarity–People Before Profit | 982 | 1
306
+ Sligo–Leitrim | Fianna Fáil | 20177 | 3
307
+ Sligo–Leitrim | Fine Gael | 17247 | 3
308
+ Sligo–Leitrim | Green Party/Comhaontas Glas | 603 | 1
309
+ Sligo–Leitrim | Independent | 8727 | 6
310
+ Sligo–Leitrim | Labour Party | 1829 | 1
311
+ Sligo–Leitrim | Renua Ireland | 881 | 1
312
+ Sligo–Leitrim | Sinn Féin | 11103 | 2
313
+ Sligo–Leitrim | Solidarity–People Before Profit | 1768 | 1
314
+ Tipperary | Fianna Fáil | 18604 | 3
315
+ Tipperary | Fine Gael | 12542 | 3
316
+ Tipperary | Green Party/Comhaontas Glas | 1341 | 1
317
+ Tipperary | Independent | 31991 | 4
318
+ Tipperary | Labour Party | 7746 | 1
319
+ Tipperary | Sinn Féin | 5724 | 1
320
+ Waterford | Direct Democracy Ireland | 194 | 1
321
+ Waterford | Fianna Fáil | 10603 | 1
322
+ Waterford | Fine Gael | 14850 | 2
323
+ Waterford | Green Party/Comhaontas Glas | 2237 | 1
324
+ Waterford | Independent | 9304 | 3
325
+ Waterford | Labour Party | 2268 | 1
326
+ Waterford | Renua Ireland | 862 | 1
327
+ Waterford | Sinn Féin | 9739 | 1
328
+ Waterford | Solidarity–People Before Profit | 1646 | 1
329
+ Wexford | Direct Democracy Ireland | 128 | 1
330
+ Wexford | Fianna Fáil | 19106 | 3
331
+ Wexford | Fine Gael | 16708 | 3
332
+ Wexford | Green Party/Comhaontas Glas | 1056 | 1
333
+ Wexford | Independent | 5805 | 4
334
+ Wexford | Independents 4 Change | 7917 | 1
335
+ Wexford | Labour Party | 10574 | 1
336
+ Wexford | Sinn Féin | 7260 | 1
337
+ Wexford | Social Democrats | 1635 | 1
338
+ Wexford | Solidarity–People Before Profit | 1472 | 1
339
+ Wicklow | Direct Democracy Ireland | 168 | 1
340
+ Wicklow | Fianna Fáil | 9279 | 2
341
+ Wicklow | Fine Gael | 18955 | 3
342
+ Wicklow | Green Party/Comhaontas Glas | 1350 | 1
343
+ Wicklow | Independent | 3629 | 3
344
+ Wicklow | Labour Party | 2634 | 1
345
+ Wicklow | Renua Ireland | 5510 | 1
346
+ Wicklow | Sinn Féin | 11151 | 1
347
+ Wicklow | Social Democrats | 14348 | 1
348
+ Wicklow | Solidarity–People Before Profit | 1780 | 2
@@ -0,0 +1,165 @@
1
+ #
2
+ # Statistical Analysis of Polling Results (SAPoR)
3
+ # Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
4
+ #
5
+ # This file is part of SAPoR.
6
+ #
7
+ # SAPoR is free software: you can redistribute it and/or modify it under the
8
+ # terms of the GNU General Public License as published by the Free Software
9
+ # Foundation, either version 3 of the License, or (at your option) any later
10
+ # version.
11
+ #
12
+ # SAPoR is distributed in the hope that it will be useful, but WITHOUT ANY
13
+ # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
+ # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
15
+ #
16
+ # You can find a copy of the GNU General Public License in /doc/gpl.txt
17
+ #
18
+
19
+ module Sapor
20
+ #
21
+ # The regional data for Ireland for the 2016 election.
22
+ #
23
+ class Ireland2016 < Area
24
+ include Singleton
25
+
26
+ def area_code
27
+ 'IE@2016'
28
+ end
29
+
30
+ def coalitions
31
+ COALITIONS
32
+ end
33
+
34
+ def election_results_of_2016
35
+ if @election_results_of_2016.nil?
36
+ @election_results_of_2016, @candidates_of_2016 = load_capped_election_results(
37
+ 'ireland-20160226.psv'
38
+ )
39
+ end
40
+ @election_results_of_2016
41
+ end
42
+
43
+ def no_of_seats
44
+ seat_distribution.values.inject(:+)
45
+ end
46
+
47
+ def overall_election_results_of_2016
48
+ if @overall_election_results_of_2016.nil?
49
+ @overall_election_results_of_2016 = \
50
+ summarize_election_results(election_results_of_2016)
51
+ end
52
+ @overall_election_results_of_2016
53
+ end
54
+
55
+ def population_size
56
+ POPULATION_SIZE
57
+ end
58
+
59
+ def seat_distribution
60
+ SEAT_DISTRIBUTION_2016
61
+ end
62
+
63
+ def seats(simulation)
64
+ electoral_system.project(simulation)
65
+ end
66
+
67
+ private
68
+
69
+ FF_PARTY = 'Fianna Fáil'.freeze
70
+ FG_PARTY = 'Fine Gael'.freeze
71
+ GREEN_PARTY = 'Green Party/Comhaontas Glas'.freeze
72
+ LAB_PARTY = 'Labour Party'.freeze
73
+ SD_PARTY = 'Social Democrats'.freeze
74
+ SF_PARTY = 'Sinn Féin'.freeze
75
+
76
+ COALITIONS = [[FF_PARTY, FG_PARTY],
77
+ [FF_PARTY, GREEN_PARTY],
78
+ [FF_PARTY, GREEN_PARTY, LAB_PARTY],
79
+ [FF_PARTY, GREEN_PARTY, LAB_PARTY, SD_PARTY],
80
+ [FF_PARTY, LAB_PARTY],
81
+ [FF_PARTY, SF_PARTY],
82
+ [FG_PARTY],
83
+ [FG_PARTY, GREEN_PARTY],
84
+ [FG_PARTY, GREEN_PARTY, LAB_PARTY],
85
+ [FG_PARTY, GREEN_PARTY, LAB_PARTY, SD_PARTY],
86
+ [FG_PARTY, LAB_PARTY]].freeze
87
+
88
+ # Voter turnout on 26 February 2016
89
+ # https://en.wikipedia.org/wiki/2016_Irish_general_election
90
+ POPULATION_SIZE = 2_132_895
91
+
92
+ SEAT_DISTRIBUTION_2016 = { 'Carlow–Kilkenny' => 5, 'Cavan–Monaghan' => 4,
93
+ 'Clare' => 4, 'Cork East' => 4,
94
+ 'Cork North-Central' => 4, 'Cork North-West' => 3,
95
+ 'Cork South-Central' => 4, 'Cork South-West' => 3,
96
+ 'Donegal' => 5, 'Dublin Bay North' => 5,
97
+ 'Dublin Bay South' => 4, 'Dublin Central' => 3,
98
+ 'Dublin Fingal' => 5, 'Dublin Mid-West' => 4,
99
+ 'Dublin North-West' => 3, 'Dublin Rathdown' => 3,
100
+ 'Dublin South-Central' => 4, 'Dublin South-West' => 5,
101
+ 'Dublin West' => 4, 'Dún Laoghaire' => 4,
102
+ 'Galway East' => 3, 'Galway West' => 5, 'Kerry' => 5,
103
+ 'Kildare North' => 4, 'Kildare South' => 3,
104
+ 'Laois' => 3, 'Limerick City' => 4,
105
+ 'Limerick County' => 3, 'Longford–Westmeath' => 4,
106
+ 'Louth' => 5, 'Mayo' => 4, 'Meath East' => 3,
107
+ 'Meath West' => 3, 'Offaly' => 3, 'Roscommon–Galway' => 3,
108
+ 'Sligo–Leitrim' => 4, 'Tipperary' => 5,
109
+ 'Waterford' => 4, 'Wexford' => 5,
110
+ 'Wicklow' => 5 }.freeze
111
+
112
+ WEIGHTS = [ [1.0],
113
+ [0.646, 0.354],
114
+ [0.532, 0.316, 0.152],
115
+ [0.547, 0.303, 0.108, 0.041],
116
+ [0.532, 0.249, 0.138, 0.05, 0.032] ].freeze
117
+
118
+ def election_results_of_2016
119
+ if @election_results_of_2016.nil?
120
+ @election_results_of_2016, @candidates_of_2016 = load_capped_election_results(
121
+ 'ireland-20160226.psv'
122
+ )
123
+ end
124
+ @election_results_of_2016
125
+ end
126
+
127
+ def electoral_system
128
+ if @electoral_system.nil?
129
+ @electoral_system = ManyPastThePost.new( \
130
+ overall_election_results_of_2016, election_results_of_2016,
131
+ seat_distribution, @candidates_of_2016, WEIGHTS
132
+ )
133
+ end
134
+ @electoral_system
135
+ end
136
+ end
137
+
138
+ # Extension of Ireland with the 2020 seat distribution among the
139
+ # constituencies.
140
+ class Ireland < Ireland2016
141
+ def area_code
142
+ 'IE'
143
+ end
144
+
145
+ def election_results_of_2016
146
+ if @election_results_of_2016.nil?
147
+ @election_results_of_2016, @candidates_of_2016 = load_capped_election_results(
148
+ 'ireland-20160226-2020-candidates.psv'
149
+ )
150
+ end
151
+ @election_results_of_2016
152
+ end
153
+
154
+ def seat_distribution
155
+ SEAT_DISTRIBUTION_2020
156
+ end
157
+
158
+ private
159
+
160
+ SEAT_DISTRIBUTION_2020 = Ireland2016.instance.seat_distribution.merge(
161
+ 'Cavan–Monaghan' => 5, 'Dublin Central' => 4, 'Kildare South' => 4,
162
+ 'Laois–Offaly' => 5
163
+ ).reject { |k, _v| %w[Laois Offaly].include?(k) }.freeze
164
+ end
165
+ end