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
@@ -1,7 +1,6 @@
1
- # encoding: utf-8
2
1
  #
3
2
  # Statistical Analysis of Polling Results (SAPoR)
4
- # Copyright (C) 2016 Filip van Laenen <f.a.vanlaenen@ieee.org>
3
+ # Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
5
4
  #
6
5
  # This file is part of SAPoR.
7
6
  #
@@ -28,34 +27,27 @@ module Sapor
28
27
  end
29
28
 
30
29
  def coalitions
31
- [['Junts pel Sí'],
32
- ['Junts pel Sí', 'Candidatura d’Unitat Popular'],
33
- ['Junts pel Sí', 'Catalunya en Comú'],
34
- ['Ciutadans–Partido de la Ciudadanía',
35
- 'Partit dels Socialistes de Catalunya (PSC-PSOE)',
36
- 'Catalunya en Comú', 'Partit Popular'],
37
- ['Ciutadans–Partido de la Ciudadanía',
38
- 'Partit dels Socialistes de Catalunya (PSC-PSOE)', 'Partit Popular']]
30
+ COALITIONS
39
31
  end
40
32
 
41
33
  def no_of_seats
42
34
  SEAT_DISTRIBUTION.values.inject(:+)
43
35
  end
44
36
 
45
- def overall_election_results_of_2015
46
- if @overall_election_results_of_2015.nil?
47
- @overall_election_results_of_2015 = \
48
- summarize_election_results(election_results_of_2015)
37
+ def overall_election_results_of_2017
38
+ if @overall_election_results_of_2017.nil?
39
+ @overall_election_results_of_2017 = \
40
+ summarize_election_results(election_results_of_2017)
49
41
  end
50
- @overall_election_results_of_2015
42
+ @overall_election_results_of_2017
51
43
  end
52
44
 
53
45
  def population_size
54
- # Voter turnout in 2015
55
- # Source: "Election Results. Parliament of Catalonia Election 2015".
56
- # Generalitat of Catalonia. Retrieved 21 October 2017.
57
- # URL: http://governacio.gencat.cat/ca/pgov_ambits_d_actuacio/pgov_eleccions/pgov_dades_electorals/resultats-2?id_eleccions=A20151&id_territori=CA09
58
- 5_510_853
46
+ # Voter turnout in 2017
47
+ # Source: "Disposición 426 del BOE núm. 11 de 2018" Retrieved on 3 January
48
+ # 2020.
49
+ # URL: http://www.juntaelectoralcentral.es/cs/jec/documentos/CATALU%C3%91A_2017_Resultados.pdf
50
+ 4_357_368
59
51
  end
60
52
 
61
53
  def seats(simulation)
@@ -68,29 +60,65 @@ module Sapor
68
60
 
69
61
  private
70
62
 
63
+ CEC_PARTY = 'Catalunya en Comú–Podem'.freeze
64
+ CS_PARTY = 'Ciutadans–Partido de la Ciudadanía'.freeze
65
+ CUP_PARTY = 'Candidatura d’Unitat Popular'.freeze
66
+ ERC_PARTY = 'Esquerra Republicana–Catalunya Sí'.freeze
67
+ JXCAT_PARTY = 'Junts pel Catalunya'.freeze
68
+ PP_PARTY = 'Partit Popular'.freeze
69
+ PSC_PARTY = 'Partit dels Socialistes de Catalunya (PSC-PSOE)'.freeze
70
+ VOX_PARTY = 'Vox'.freeze
71
+
72
+ COALITIONS = [[CEC_PARTY, CS_PARTY, PSC_PARTY, PP_PARTY],
73
+ [CEC_PARTY, ERC_PARTY],
74
+ [CEC_PARTY, ERC_PARTY, JXCAT_PARTY],
75
+ [CEC_PARTY, ERC_PARTY, PSC_PARTY],
76
+ [CS_PARTY, PSC_PARTY, PP_PARTY],
77
+ [CS_PARTY, PSC_PARTY, PP_PARTY, VOX_PARTY],
78
+ [CUP_PARTY, ERC_PARTY, JXCAT_PARTY],
79
+ [ERC_PARTY, JXCAT_PARTY]].freeze
80
+
71
81
  SEAT_DISTRIBUTION = { 'Barcelona' => 85, 'Girona' => 17, 'Lleida' => 15,
72
- 'Tarragona' => 18 }
82
+ 'Tarragona' => 18 }.freeze
73
83
 
74
84
  THRESHOLD = 0.03
75
85
 
76
- def election_results_of_2015
77
- if @election_results_of_2015.nil?
78
- @election_results_of_2015 = load_election_results( \
79
- 'catalonia-2015.psv')
86
+ def election_results_of_2017
87
+ if @election_results_of_2017.nil?
88
+ @election_results_of_2017 = load_election_results( \
89
+ 'catalonia-20171221.psv'
90
+ )
80
91
  end
81
- @election_results_of_2015
92
+ @election_results_of_2017
82
93
  end
83
94
 
84
95
  def electoral_system
85
96
  if @electoral_system.nil?
86
97
  @electoral_system = MultiDistrictProportional.new( \
87
- overall_election_results_of_2015,
88
- election_results_of_2015,
98
+ overall_election_results_of_2017,
99
+ election_results_of_2017,
89
100
  SEAT_DISTRIBUTION,
90
101
  DhondtDenominators,
91
- THRESHOLD)
102
+ THRESHOLD
103
+ )
92
104
  end
93
105
  @electoral_system
94
106
  end
95
107
  end
108
+
109
+ # Extension of Catalonia with Vox
110
+ class CataloniaWithVox < Catalonia
111
+ def area_code
112
+ 'ES-CT∪{Vox}'
113
+ end
114
+
115
+ def election_results_of_2017
116
+ if @election_results_of_2017.nil?
117
+ @election_results_of_2017 = load_election_results(
118
+ 'catalonia-20171221-with-vox.psv'
119
+ )
120
+ end
121
+ @election_results_of_2017
122
+ end
123
+ end
96
124
  end
@@ -1,5 +1,5 @@
1
1
  # Statistical Analysis of Polling Results (SAPoR)
2
- # Copyright (C) 2016 Filip van Laenen <f.a.vanlaenen@ieee.org>
2
+ # Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
3
3
  #
4
4
  # This file is part of SAPoR.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  # Statistical Analysis of Polling Results (SAPoR)
2
- # Copyright (C) 2016 Filip van Laenen <f.a.vanlaenen@ieee.org>
2
+ # Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
3
3
  #
4
4
  # This file is part of SAPoR.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  # Statistical Analysis of Polling Results (SAPoR)
2
- # Copyright (C) 2016 Filip van Laenen <f.a.vanlaenen@ieee.org>
2
+ # Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
3
3
  #
4
4
  # This file is part of SAPoR.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  # Statistical Analysis of Polling Results (SAPoR)
2
- # Copyright (C) 2016 Filip van Laenen <f.a.vanlaenen@ieee.org>
2
+ # Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
3
3
  #
4
4
  # This file is part of SAPoR.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  # Statistical Analysis of Polling Results (SAPoR)
2
- # Copyright (C) 2016 Filip van Laenen <f.a.vanlaenen@ieee.org>
2
+ # Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
3
3
  #
4
4
  # This file is part of SAPoR.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  # Statistical Analysis of Polling Results (SAPoR)
2
- # Copyright (C) 2016 Filip van Laenen <f.a.vanlaenen@ieee.org>
2
+ # Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
3
3
  #
4
4
  # This file is part of SAPoR.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  # Statistical Analysis of Polling Results (SAPoR)
2
- # Copyright (C) 2016 Filip van Laenen <f.a.vanlaenen@ieee.org>
2
+ # Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
3
3
  #
4
4
  # This file is part of SAPoR.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  # Statistical Analysis of Polling Results (SAPoR)
2
- # Copyright (C) 2016 Filip van Laenen <f.a.vanlaenen@ieee.org>
2
+ # Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
3
3
  #
4
4
  # This file is part of SAPoR.
5
5
  #
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Statistical Analysis of Polling Results (SAPoR)
3
- # Copyright (C) 2016 Filip van Laenen <f.a.vanlaenen@ieee.org>
3
+ # Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
4
4
  #
5
5
  # This file is part of SAPoR.
6
6
  #
@@ -1,5 +1,5 @@
1
1
  # Statistical Analysis of Polling Results (SAPoR)
2
- # Copyright (C) 2016 Filip van Laenen <f.a.vanlaenen@ieee.org>
2
+ # Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
3
3
  #
4
4
  # This file is part of SAPoR.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  # Statistical Analysis of Polling Results (SAPoR)
2
- # Copyright (C) 2016 Filip van Laenen <f.a.vanlaenen@ieee.org>
2
+ # Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
3
3
  #
4
4
  # This file is part of SAPoR.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  # Statistical Analysis of Polling Results (SAPoR)
2
- # Copyright (C) 2016 Filip van Laenen <f.a.vanlaenen@ieee.org>
2
+ # Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
3
3
  #
4
4
  # This file is part of SAPoR.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  # Statistical Analysis of Polling Results (SAPoR)
2
- # Copyright (C) 2016 Filip van Laenen <f.a.vanlaenen@ieee.org>
2
+ # Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
3
3
  #
4
4
  # This file is part of SAPoR.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  # Statistical Analysis of Polling Results (SAPoR)
2
- # Copyright (C) 2016 Filip van Laenen <f.a.vanlaenen@ieee.org>
2
+ # Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
3
3
  #
4
4
  # This file is part of SAPoR.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  # Statistical Analysis of Polling Results (SAPoR)
2
- # Copyright (C) 2016 Filip van Laenen <f.a.vanlaenen@ieee.org>
2
+ # Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
3
3
  #
4
4
  # This file is part of SAPoR.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  # Statistical Analysis of Polling Results (SAPoR)
2
- # Copyright (C) 2016 Filip van Laenen <f.a.vanlaenen@ieee.org>
2
+ # Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
3
3
  #
4
4
  # This file is part of SAPoR.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  # Statistical Analysis of Polling Results (SAPoR)
2
- # Copyright (C) 2016 Filip van Laenen <f.a.vanlaenen@ieee.org>
2
+ # Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
3
3
  #
4
4
  # This file is part of SAPoR.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  # Statistical Analysis of Polling Results (SAPoR)
2
- # Copyright (C) 2016 Filip van Laenen <f.a.vanlaenen@ieee.org>
2
+ # Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
3
3
  #
4
4
  # This file is part of SAPoR.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  # Statistical Analysis of Polling Results (SAPoR)
2
- # Copyright (C) 2016 Filip van Laenen <f.a.vanlaenen@ieee.org>
2
+ # Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
3
3
  #
4
4
  # This file is part of SAPoR.
5
5
  #
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  #
3
3
  # Statistical Analysis of Polling Results (SAPoR)
4
- # Copyright (C) 2016 Filip van Laenen <f.a.vanlaenen@ieee.org>
4
+ # Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
5
5
  #
6
6
  # This file is part of SAPoR.
7
7
  #
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  #
3
3
  # Statistical Analysis of Polling Results (SAPoR)
4
- # Copyright (C) 2016 Filip van Laenen <f.a.vanlaenen@ieee.org>
4
+ # Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
5
5
  #
6
6
  # This file is part of SAPoR.
7
7
  #
@@ -51,9 +51,11 @@ module Sapor
51
51
  'Hrvatska narodna stranka–liberalni demokrati (RE)',
52
52
  'Pametno (RE)'],
53
53
  ['Bandić Milan 365–Stranka rada i solidarnosti (*)',
54
+ 'Nezavisna lista Miroslava Škore (*)',
54
55
  'Stranka antikorupcije, razvoja i transparentnosti (*)'],
55
56
  ['Hrvatska konzervativna stranka (ECR)',
56
- 'Hrvatski rast (ECR)', 'Most nezavisnih lista (ECR)'],
57
+ 'Hrvatski rast (ECR)', 'Hrvatski suverenisti (ECR)',
58
+ 'Most nezavisnih lista (ECR)'],
57
59
  ['Nezavisna lista Mislava Kolakušića (NI)',
58
60
  'Živi zid (NI)'],
59
61
  ['Neovisni za Hrvatsku (ID)'],
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  #
3
3
  # Statistical Analysis of Polling Results (SAPoR)
4
- # Copyright (C) 2016 Filip van Laenen <f.a.vanlaenen@ieee.org>
4
+ # Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
5
5
  #
6
6
  # This file is part of SAPoR.
7
7
  #
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  #
3
3
  # Statistical Analysis of Polling Results (SAPoR)
4
- # Copyright (C) 2016 Filip van Laenen <f.a.vanlaenen@ieee.org>
4
+ # Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
5
5
  #
6
6
  # This file is part of SAPoR.
7
7
  #
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  #
3
3
  # Statistical Analysis of Polling Results (SAPoR)
4
- # Copyright (C) 2016 Filip van Laenen <f.a.vanlaenen@ieee.org>
4
+ # Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
5
5
  #
6
6
  # This file is part of SAPoR.
7
7
  #
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  #
3
3
  # Statistical Analysis of Polling Results (SAPoR)
4
- # Copyright (C) 2016 Filip van Laenen <f.a.vanlaenen@ieee.org>
4
+ # Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
5
5
  #
6
6
  # This file is part of SAPoR.
7
7
  #
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  #
3
3
  # Statistical Analysis of Polling Results (SAPoR)
4
- # Copyright (C) 2016 Filip van Laenen <f.a.vanlaenen@ieee.org>
4
+ # Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
5
5
  #
6
6
  # This file is part of SAPoR.
7
7
  #
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  #
3
3
  # Statistical Analysis of Polling Results (SAPoR)
4
- # Copyright (C) 2016 Filip van Laenen <f.a.vanlaenen@ieee.org>
4
+ # Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
5
5
  #
6
6
  # This file is part of SAPoR.
7
7
  #
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  #
3
3
  # Statistical Analysis of Polling Results (SAPoR)
4
- # Copyright (C) 2016 Filip van Laenen <f.a.vanlaenen@ieee.org>
4
+ # Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
5
5
  #
6
6
  # This file is part of SAPoR.
7
7
  #
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  #
3
3
  # Statistical Analysis of Polling Results (SAPoR)
4
- # Copyright (C) 2016 Filip van Laenen <f.a.vanlaenen@ieee.org>
4
+ # Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
5
5
  #
6
6
  # This file is part of SAPoR.
7
7
  #
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  #
3
3
  # Statistical Analysis of Polling Results (SAPoR)
4
- # Copyright (C) 2016 Filip van Laenen <f.a.vanlaenen@ieee.org>
4
+ # Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
5
5
  #
6
6
  # This file is part of SAPoR.
7
7
  #
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  #
3
3
  # Statistical Analysis of Polling Results (SAPoR)
4
- # Copyright (C) 2016 Filip van Laenen <f.a.vanlaenen@ieee.org>
4
+ # Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
5
5
  #
6
6
  # This file is part of SAPoR.
7
7
  #
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  #
3
3
  # Statistical Analysis of Polling Results (SAPoR)
4
- # Copyright (C) 2016 Filip van Laenen <f.a.vanlaenen@ieee.org>
4
+ # Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
5
5
  #
6
6
  # This file is part of SAPoR.
7
7
  #
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  #
3
3
  # Statistical Analysis of Polling Results (SAPoR)
4
- # Copyright (C) 2016 Filip van Laenen <f.a.vanlaenen@ieee.org>
4
+ # Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
5
5
  #
6
6
  # This file is part of SAPoR.
7
7
  #
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  #
3
3
  # Statistical Analysis of Polling Results (SAPoR)
4
- # Copyright (C) 2016 Filip van Laenen <f.a.vanlaenen@ieee.org>
4
+ # Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
5
5
  #
6
6
  # This file is part of SAPoR.
7
7
  #
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  #
3
3
  # Statistical Analysis of Polling Results (SAPoR)
4
- # Copyright (C) 2016 Filip van Laenen <f.a.vanlaenen@ieee.org>
4
+ # Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
5
5
  #
6
6
  # This file is part of SAPoR.
7
7
  #