- Timestamp:
- 2021-04-23T11:06:01+12:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/model-sites-dev/eurovision-lod/collect/eurovision/prepare/errata-categories/esc-wikipedia-download-and-process-votes.py
r35032 r35105 17 17 import escwikipedia 18 18 19 20 def generate_reverse_finishing_pos_metadata(country_year_recs): 19 21 22 country_year_recs_len = len(country_year_recs) 23 24 for country_year_key in country_year_recs.keys(): 25 country_year_rec = country_year_recs.get(country_year_key) 26 27 place = int(country_year_rec.get("Place")) 28 rev_place = country_year_recs_len - place + 1 29 30 country_year_rec["ReversePlace"] = str(rev_place) 31 32 country_year_rec["FinishingPos"] = str(place) 33 country_year_rec["ReverseFinishingPos"] = str(rev_place) 34 35 20 36 def gs_fileset_country_in_year(country_year_name, country_year_rec, nul_output_dir_name): 21 37 … … 152 168 stop_at_first=True, 153 169 extra_metadata={"Final": True}) 154 170 if (year > 1956): 171 # skip inaugural year, as only known who was 1st 172 # everyone else listed as 2nd, and given that there are 173 # two entrants per countries the reversing step generates 174 # (while technically correct) rather weird looking vals 175 generate_reverse_finishing_pos_metadata(country_year_recs) 155 176 156 177 all_country_year_recs.append(country_year_recs)
Note:
See TracChangeset
for help on using the changeset viewer.