diff --git a/.github/workflows/platformer-da621eaf-3159-4ff9-9e3b-046d71dced38.yml b/.github/workflows/platformer-386f8a99-bb2f-4296-81e8-b6464020c97b.yml similarity index 81% rename from .github/workflows/platformer-da621eaf-3159-4ff9-9e3b-046d71dced38.yml rename to .github/workflows/platformer-386f8a99-bb2f-4296-81e8-b6464020c97b.yml index e89bfffb..3498e959 100644 --- a/.github/workflows/platformer-da621eaf-3159-4ff9-9e3b-046d71dced38.yml +++ b/.github/workflows/platformer-386f8a99-bb2f-4296-81e8-b6464020c97b.yml @@ -1,4 +1,4 @@ -name: Platformer Generated ui-master-push Build +name: Platformer Generated ui-dev-master-push Build on: push: branches: @@ -24,10 +24,10 @@ jobs: password: ${{ secrets.DOCKER_PASSWORD }} - name: Build the Docker image run: docker build --tag - ${SERVICE_NAME}:${{steps.event-version.outputs.SOURCE_TAG }} --file + ${SERVICE_NAME}:ui-${{steps.event-version.outputs.SOURCE_TAG }} --file ./results-tabulation-ui/Dockerfile ./results-tabulation-ui/ - name: GitHub Image Push - run: docker push $SERVICE_NAME:${{steps.event-version.outputs.SOURCE_TAG }} + run: docker push $SERVICE_NAME:ui-${{steps.event-version.outputs.SOURCE_TAG }} - name: Platformer Deploy uses: platformer-com/build-deploy-action@v1 with: @@ -35,5 +35,5 @@ jobs: project-id: ${{secrets.PROJECT_ID_FCB1AEBE_71DB_4911_9067_F5FA9BA73D4D}} token: ${{secrets.AUTOGENERATED_CICD_FCB1AEBE_71DB_4911_9067_F5FA9BA73D4D}} image-name: ${{env.SERVICE_NAME}} - tag: ${{steps.event-version.outputs.SOURCE_TAG }} + tag: ui-${{steps.event-version.outputs.SOURCE_TAG }} container-id: 42534598-30c1-475f-bd37-6853261010d1 diff --git a/.github/workflows/platformer-47b61be7-b630-4637-aaa2-4bb7bdc6e7da.yml b/.github/workflows/platformer-47b61be7-b630-4637-aaa2-4bb7bdc6e7da.yml new file mode 100644 index 00000000..776deb1e --- /dev/null +++ b/.github/workflows/platformer-47b61be7-b630-4637-aaa2-4bb7bdc6e7da.yml @@ -0,0 +1,38 @@ +name: Platformer Generated ui-stag-tag-push Build +on: + push: + tags: + - 'stag-**' +jobs: + build: + runs-on: + - ubuntu-latest + env: + SERVICE_NAME: ghcr.io/eclk/results-tabulation + CONTAINER_REGISTRY: ghcr.io + steps: + - uses: actions/checkout@v2 + - name: Set Version + id: event-version + run: echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/} + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ${{ env.CONTAINER_REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Build the Docker image + run: docker build --tag + ${SERVICE_NAME}:ui-${{steps.event-version.outputs.SOURCE_TAG }} --file + ./results-tabulation-ui/Staging.Dockerfile ./results-tabulation-ui/ + - name: GitHub Image Push + run: docker push $SERVICE_NAME:ui-${{steps.event-version.outputs.SOURCE_TAG }} + - name: Platformer Deploy + uses: platformer-com/build-deploy-action@v1 + with: + org-id: ${{secrets.ORG_ID_FCB1AEBE_71DB_4911_9067_F5FA9BA73D4D}} + project-id: ${{secrets.PROJECT_ID_FCB1AEBE_71DB_4911_9067_F5FA9BA73D4D}} + token: ${{secrets.AUTOGENERATED_CICD_FCB1AEBE_71DB_4911_9067_F5FA9BA73D4D}} + image-name: ${{env.SERVICE_NAME}} + tag: ui-${{steps.event-version.outputs.SOURCE_TAG }} + container-id: d5978be8-fb29-4f53-b951-acf8995587f3 diff --git a/.github/workflows/platformer-e20889a8-1e86-4980-9e02-3359975f6dc4.yml b/.github/workflows/platformer-e20889a8-1e86-4980-9e02-3359975f6dc4.yml new file mode 100644 index 00000000..7d961c4d --- /dev/null +++ b/.github/workflows/platformer-e20889a8-1e86-4980-9e02-3359975f6dc4.yml @@ -0,0 +1,38 @@ +name: Platformer Generated stag-api-tag-push Build +on: + push: + tags: + - 'stag-**' +jobs: + build: + runs-on: + - ubuntu-latest + env: + SERVICE_NAME: ghcr.io/eclk/results-tabulation + CONTAINER_REGISTRY: ghcr.io + steps: + - uses: actions/checkout@v2 + - name: Set Version + id: event-version + run: echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/} + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ${{ env.CONTAINER_REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Build the Docker image + run: docker build --tag + ${SERVICE_NAME}:api-${{steps.event-version.outputs.SOURCE_TAG }} --file + ./results-tabulation-api/Dockerfile ./results-tabulation-api/ + - name: GitHub Image Push + run: docker push $SERVICE_NAME:api-${{steps.event-version.outputs.SOURCE_TAG }} + - name: Platformer Deploy + uses: platformer-com/build-deploy-action@v1 + with: + org-id: ${{secrets.ORG_ID_BCBDC02D_6FBA_4B10_9603_D19453632123}} + project-id: ${{secrets.PROJECT_ID_BCBDC02D_6FBA_4B10_9603_D19453632123}} + token: ${{secrets.AUTOGENERATED_CICD_BCBDC02D_6FBA_4B10_9603_D19453632123}} + image-name: ${{env.SERVICE_NAME}} + tag: api-${{steps.event-version.outputs.SOURCE_TAG }} + container-id: 017c3bee-7f08-49fd-b82a-f4b6f3504eee diff --git a/.github/workflows/platformer-026bf287-7c35-4b12-a573-befed717518f.yml b/.github/workflows/platformer-ee05fbca-9628-41e6-ab7b-a53befd32976.yml similarity index 96% rename from .github/workflows/platformer-026bf287-7c35-4b12-a573-befed717518f.yml rename to .github/workflows/platformer-ee05fbca-9628-41e6-ab7b-a53befd32976.yml index 44d42bc8..f7c9cc63 100644 --- a/.github/workflows/platformer-026bf287-7c35-4b12-a573-befed717518f.yml +++ b/.github/workflows/platformer-ee05fbca-9628-41e6-ab7b-a53befd32976.yml @@ -1,4 +1,4 @@ -name: Platformer Generated master-push Build +name: Platformer Generated dev-master-push Build on: push: branches: diff --git a/results-tabulation-api/ext/ExtendedElection/ExtendedElectionProvincialCouncilElection2021/ExtendedTallySheet/ExtendedTallySheet_PCE_PC_BS_1.py b/results-tabulation-api/ext/ExtendedElection/ExtendedElectionProvincialCouncilElection2021/ExtendedTallySheet/ExtendedTallySheet_PCE_PC_BS_1.py index d9245beb..39aac282 100644 --- a/results-tabulation-api/ext/ExtendedElection/ExtendedElectionProvincialCouncilElection2021/ExtendedTallySheet/ExtendedTallySheet_PCE_PC_BS_1.py +++ b/results-tabulation-api/ext/ExtendedElection/ExtendedElectionProvincialCouncilElection2021/ExtendedTallySheet/ExtendedTallySheet_PCE_PC_BS_1.py @@ -3,8 +3,8 @@ from exception.messages import MESSAGE_CODE_PCE_PC_BS_1_CANNOT_BE_PROCESSED_WITHOUT_PCE_PC_V from ext.ExtendedElection.ExtendedElectionProvincialCouncilElection2021.TEMPLATE_ROW_TYPE import \ TEMPLATE_ROW_TYPE_SEATS_ALLOCATED_FROM_ROUND_1, TEMPLATE_ROW_TYPE_VALID_VOTES_REMAIN_FROM_ROUND_1, \ - TEMPLATE_ROW_TYPE_SEATS_ALLOCATED_FROM_ROUND_2, TEMPLATE_ROW_TYPE_VALID_VOTE_COUNT_CEIL_PER_SEAT, \ - TEMPLATE_ROW_TYPE_DRAFT_SEATS_ALLOCATED_FROM_ROUND_2, TEMPLATE_ROW_TYPE_SEATS_ALLOCATED + TEMPLATE_ROW_TYPE_VALID_VOTE_COUNT_CEIL_PER_SEAT, \ + TEMPLATE_ROW_TYPE_SEATS_ALLOCATED from ext.ExtendedTallySheet import ExtendedEditableTallySheetReport from orm.entities import TallySheet from orm.entities.Template import TemplateRowModel, TemplateModel @@ -15,10 +15,6 @@ import numpy as np template_row_to_df_num_value_column_map = { - TEMPLATE_ROW_TYPE_SEATS_ALLOCATED_FROM_ROUND_1: "seatsAllocatedFromRound1", - TEMPLATE_ROW_TYPE_VALID_VOTES_REMAIN_FROM_ROUND_1: "validVotesRemainFromRound1", - TEMPLATE_ROW_TYPE_DRAFT_SEATS_ALLOCATED_FROM_ROUND_2: "draftSeatsAllocatedFromRound2", - TEMPLATE_ROW_TYPE_SEATS_ALLOCATED_FROM_ROUND_2: "seatsAllocatedFromRound2", TEMPLATE_ROW_TYPE_SEATS_ALLOCATED: "seatsAllocated", TEMPLATE_ROW_TYPE_VALID_VOTE_COUNT_CEIL_PER_SEAT: "voteCountCeilPerSeat" } @@ -29,15 +25,11 @@ class ExtendedTallySheetVersion(ExtendedEditableTallySheetReport.ExtendedTallySh def get_post_save_request_content(self): tally_sheet_id = self.tallySheetVersion.tallySheetId - number_of_members_to_be_elected = 29 + number_of_members_to_be_elected = 2 df = self.populate_seats_per_party(number_of_members_to_be_elected=number_of_members_to_be_elected) template_row_map = { - TEMPLATE_ROW_TYPE_SEATS_ALLOCATED_FROM_ROUND_1: [], - TEMPLATE_ROW_TYPE_VALID_VOTES_REMAIN_FROM_ROUND_1: [], - TEMPLATE_ROW_TYPE_DRAFT_SEATS_ALLOCATED_FROM_ROUND_2: [], - TEMPLATE_ROW_TYPE_SEATS_ALLOCATED_FROM_ROUND_2: [], TEMPLATE_ROW_TYPE_SEATS_ALLOCATED: [], TEMPLATE_ROW_TYPE_VALID_VOTE_COUNT_CEIL_PER_SEAT: [] } @@ -82,27 +74,18 @@ def populate_seats_per_party(self, number_of_members_to_be_elected=0): valid_vote_count_required_per_seat = total_valid_vote_count / number_of_members_to_be_elected valid_vote_count_required_per_seat_ceil = math.ceil(valid_vote_count_required_per_seat) - for index in df.index: - num_value = df.at[index, 'numValue'] - number_of_seats_qualified = math.floor(num_value / valid_vote_count_required_per_seat_ceil) - df.at[index, 'seatsAllocatedFromRound1'] = number_of_seats_qualified - number_of_members_to_be_elected -= number_of_seats_qualified - df.at[index, 'validVotesRemainFromRound1'] = num_value % valid_vote_count_required_per_seat_ceil + df = df.sort_values(by=['numValue'], ascending=True) + max_num_value_index = 0 + max_num_value = 0 - df = df.sort_values(by=['validVotesRemainFromRound1'], ascending=False) for index in df.index: - if number_of_members_to_be_elected > 0: - number_of_seats_qualified = 1 - df.at[index, 'seatsAllocatedFromRound2'] = number_of_seats_qualified - number_of_members_to_be_elected -= number_of_seats_qualified - else: - df.at[index, 'seatsAllocatedFromRound2'] = 0 - - df['seatsAllocated'] = df.seatsAllocatedFromRound1 + df.seatsAllocatedFromRound2 - - df['draftSeatsAllocatedFromRound2'] = df.seatsAllocatedFromRound2 + num_value = df.at[index, 'numValue'] + if num_value > max_num_value: + max_num_value=num_value + max_num_value_index=index + df.at[index, 'seatsAllocated'] = 0 - df = df.sort_values(by=['numValue'], ascending=False) + df.at[max_num_value_index, 'seatsAllocated'] = 2 df["voteCountCeilPerSeat"] = pd.Series( np.full(len(df.index), valid_vote_count_required_per_seat_ceil), @@ -250,7 +233,7 @@ def html_letter(self, title="", total_registered_voters=None, signatures=[]): total_vote_count += float(area_wise_vote_count_result_item.incompleteNumValue) content["totalVoteCounts"][0] = to_comma_seperated_num(total_vote_count) content["totalVoteCounts"][1] = to_percentage((total_vote_count / registered_voters_count) * 100) - + total_valid_vote_count = 0 for area_wise_valid_vote_count_result_item in area_wise_valid_vote_count_result.itertuples(): total_valid_vote_count += float(area_wise_valid_vote_count_result_item.incompleteNumValue) diff --git a/results-tabulation-api/ext/ExtendedElection/ExtendedElectionProvincialCouncilElection2021/ExtendedTallySheet/ExtendedTallySheet_PCE_PC_CD.py b/results-tabulation-api/ext/ExtendedElection/ExtendedElectionProvincialCouncilElection2021/ExtendedTallySheet/ExtendedTallySheet_PCE_PC_CD.py index 13c1038f..44501e0e 100644 --- a/results-tabulation-api/ext/ExtendedElection/ExtendedElectionProvincialCouncilElection2021/ExtendedTallySheet/ExtendedTallySheet_PCE_PC_CD.py +++ b/results-tabulation-api/ext/ExtendedElection/ExtendedElectionProvincialCouncilElection2021/ExtendedTallySheet/ExtendedTallySheet_PCE_PC_CD.py @@ -1,7 +1,7 @@ from flask import render_template - +import pandas as pd from ext.ExtendedElection.ExtendedElectionProvincialCouncilElection2021.TEMPLATE_ROW_TYPE import \ - TEMPLATE_ROW_TYPE_ELECTED_CANDIDATE + TEMPLATE_ROW_TYPE_ELECTED_CANDIDATE, TEMPLATE_ROW_TYPE_ELECTED_BONUS_CANDIDATE from ext.ExtendedTallySheet import ExtendedTallySheetReport from util import convert_image_to_data_uri @@ -45,12 +45,16 @@ def json(self): def get_candidate_wise_results(self): elected_candidates = self.df.loc[ (self.df['templateRowType'] == TEMPLATE_ROW_TYPE_ELECTED_CANDIDATE) & (self.df['numValue'] == 0)] + bonus_candidates = self.df.loc[ + (self.df['templateRowType'] == TEMPLATE_ROW_TYPE_ELECTED_BONUS_CANDIDATE) & (self.df['numValue'] == 0)] + final_elected_candidates = pd.concat([elected_candidates, bonus_candidates]).drop_duplicates( + subset=['partyId', 'candidateId']) - elected_candidates = elected_candidates.sort_values( + final_elected_candidates = final_elected_candidates.sort_values( by=['partyId', 'candidateId'], ascending=True ).reset_index() - return elected_candidates + return final_elected_candidates def html(self, title="", total_registered_voters=None): tallySheetVersion = self.tallySheetVersion diff --git a/results-tabulation-api/ext/ExtendedElection/ExtendedElectionProvincialCouncilElection2021/ExtendedTallySheet/ExtendedTallySheet_PCE_R2.py b/results-tabulation-api/ext/ExtendedElection/ExtendedElectionProvincialCouncilElection2021/ExtendedTallySheet/ExtendedTallySheet_PCE_R2.py index 32271127..9da0275b 100644 --- a/results-tabulation-api/ext/ExtendedElection/ExtendedElectionProvincialCouncilElection2021/ExtendedTallySheet/ExtendedTallySheet_PCE_R2.py +++ b/results-tabulation-api/ext/ExtendedElection/ExtendedElectionProvincialCouncilElection2021/ExtendedTallySheet/ExtendedTallySheet_PCE_R2.py @@ -26,9 +26,9 @@ TEMPLATE_ROW_TYPE_SEATS_ALLOCATED_FROM_ROUND_1: "seatsAllocatedFromRound1", TEMPLATE_ROW_TYPE_VALID_VOTES_REMAIN_FROM_ROUND_1: "validVotesRemainFromRound1", TEMPLATE_ROW_TYPE_DRAFT_SEATS_ALLOCATED_FROM_ROUND_2: "draftSeatsAllocatedFromRound2", - TEMPLATE_ROW_TYPE_DRAFT_BONUS_SEATS_ALLOCATED: "draftBonusSeatsAllocated", + # TEMPLATE_ROW_TYPE_DRAFT_BONUS_SEATS_ALLOCATED: "draftBonusSeatsAllocated", TEMPLATE_ROW_TYPE_SEATS_ALLOCATED_FROM_ROUND_2: "seatsAllocatedFromRound2", - TEMPLATE_ROW_TYPE_BONUS_SEATS_ALLOCATED: "bonusSeatsAllocated", + # TEMPLATE_ROW_TYPE_BONUS_SEATS_ALLOCATED: "bonusSeatsAllocated", TEMPLATE_ROW_TYPE_SEATS_ALLOCATED: "seatsAllocated", TEMPLATE_ROW_TYPE_VALID_VOTE_COUNT_CEIL_PER_SEAT: "voteCountCeilPerSeat", TEMPLATE_ROW_TYPE_MINIMUM_VALID_VOTE_COUNT_REQUIRED_FOR_SEAT_ALLOCATION: "minimumVoteCountRequiredForSeatAllocation" @@ -72,7 +72,7 @@ def json(self): "vote_count": 0, "vote_percentage": "", "seat_count": int(party_wise_result.seatsAllocated), - "bonus_seat_count": 0 + # "bonus_seat_count": 0 } for party_wise_result in party_wise_results.itertuples() ] } @@ -100,9 +100,9 @@ def get_post_save_request_content(self): TEMPLATE_ROW_TYPE_SEATS_ALLOCATED_FROM_ROUND_1: [], TEMPLATE_ROW_TYPE_VALID_VOTES_REMAIN_FROM_ROUND_1: [], TEMPLATE_ROW_TYPE_DRAFT_SEATS_ALLOCATED_FROM_ROUND_2: [], - TEMPLATE_ROW_TYPE_DRAFT_BONUS_SEATS_ALLOCATED: [], + # TEMPLATE_ROW_TYPE_DRAFT_BONUS_SEATS_ALLOCATED: [], TEMPLATE_ROW_TYPE_SEATS_ALLOCATED_FROM_ROUND_2: [], - TEMPLATE_ROW_TYPE_BONUS_SEATS_ALLOCATED: [], + # TEMPLATE_ROW_TYPE_BONUS_SEATS_ALLOCATED: [], TEMPLATE_ROW_TYPE_SEATS_ALLOCATED: [], TEMPLATE_ROW_TYPE_VALID_VOTE_COUNT_CEIL_PER_SEAT: [], TEMPLATE_ROW_TYPE_MINIMUM_VALID_VOTE_COUNT_REQUIRED_FOR_SEAT_ALLOCATION: [] @@ -158,12 +158,12 @@ def populate_seats_per_party(self, minimum_vote_count_percentage_required, numbe max_valid_vote_count_per_party = df['numValue'].max() - for index in df.index: - if df.at[index, 'numValue'] == max_valid_vote_count_per_party: - df.at[index, 'bonusSeatsAllocated'] = 1 - number_of_members_to_be_elected -= 1 - else: - df.at[index, 'bonusSeatsAllocated'] = 0 + # for index in df.index: + # if df.at[index, 'numValue'] == max_valid_vote_count_per_party: + # df.at[index, 'bonusSeatsAllocated'] = 1 + # number_of_members_to_be_elected -= 1 + # else: + # df.at[index, 'bonusSeatsAllocated'] = 0 valid_vote_count_required_per_seat = total_valid_vote_count_of_qualified_parties / number_of_members_to_be_elected valid_vote_count_required_per_seat_ceil = math.ceil(valid_vote_count_required_per_seat) @@ -188,10 +188,11 @@ def populate_seats_per_party(self, minimum_vote_count_percentage_required, numbe else: df.at[index, 'seatsAllocatedFromRound2'] = 0 - df['seatsAllocated'] = df.seatsAllocatedFromRound1 + df.seatsAllocatedFromRound2 + df.bonusSeatsAllocated + # df['seatsAllocated'] = df.seatsAllocatedFromRound1 + df.seatsAllocatedFromRound2 + df.bonusSeatsAllocated + df['seatsAllocated'] = df.seatsAllocatedFromRound1 + df.seatsAllocatedFromRound2 df['draftSeatsAllocatedFromRound2'] = df.seatsAllocatedFromRound2 - df['draftBonusSeatsAllocated'] = df.bonusSeatsAllocated + # df['draftBonusSeatsAllocated'] = df.bonusSeatsAllocated df = df.sort_values(by=['numValue'], ascending=False) @@ -297,7 +298,7 @@ def html(self, title="", total_registered_voters=None): total_seatsAllocatedFromRound1 = 0 total_seatsAllocatedFromRound2 = 0 - total_bonusSeatsAllocated = 0 + # total_bonusSeatsAllocated = 0 party_wise_seat_calculations = party_wise_seat_calculations[ (party_wise_seat_calculations[ @@ -313,20 +314,20 @@ def html(self, title="", total_registered_voters=None): data_row.append(to_comma_seperated_num(party_wise_seat_calculation_item.seatsAllocatedFromRound1)) data_row.append(to_comma_seperated_num(party_wise_seat_calculation_item.validVotesRemainFromRound1)) data_row.append(to_comma_seperated_num(party_wise_seat_calculation_item.seatsAllocatedFromRound2)) - data_row.append(to_comma_seperated_num(party_wise_seat_calculation_item.bonusSeatsAllocated)) + # data_row.append(to_comma_seperated_num(party_wise_seat_calculation_item.bonusSeatsAllocated)) data_row.append(to_comma_seperated_num(party_wise_seat_calculation_item.seatsAllocated)) content["data"].append(data_row) total_seatsAllocatedFromRound1 += int(party_wise_seat_calculation_item.seatsAllocatedFromRound1) total_seatsAllocatedFromRound2 += int(party_wise_seat_calculation_item.seatsAllocatedFromRound2) - total_bonusSeatsAllocated += int(party_wise_seat_calculation_item.bonusSeatsAllocated) + # total_bonusSeatsAllocated += int(party_wise_seat_calculation_item.bonusSeatsAllocated) # get the totals content["total"].append(to_comma_seperated_num(total_valid_votes_after_deduction)) content["total"].append(to_comma_seperated_num(total_seatsAllocatedFromRound1)) content["total"].append(to_comma_seperated_num(total_seatsAllocatedFromRound2)) - content["total"].append(to_comma_seperated_num(total_bonusSeatsAllocated)) + # content["total"].append(to_comma_seperated_num(total_bonusSeatsAllocated)) content["total"].append(to_comma_seperated_num(party_wise_seat_calculations['seatsAllocated'].sum())) html = render_template( diff --git a/results-tabulation-api/ext/ExtendedElection/ExtendedElectionProvincialCouncilElection2021/TallysheetTemplates/pce_pc_bs_1.py b/results-tabulation-api/ext/ExtendedElection/ExtendedElectionProvincialCouncilElection2021/TallysheetTemplates/pce_pc_bs_1.py index e458f756..a46c5d96 100644 --- a/results-tabulation-api/ext/ExtendedElection/ExtendedElectionProvincialCouncilElection2021/TallysheetTemplates/pce_pc_bs_1.py +++ b/results-tabulation-api/ext/ExtendedElection/ExtendedElectionProvincialCouncilElection2021/TallysheetTemplates/pce_pc_bs_1.py @@ -48,46 +48,6 @@ def create_template(): {"columnName": "numValue", "grouped": False, "func": "sum", "source": SOURCE_CONTENT} ] }, - TEMPLATE_ROW_TYPE_SEATS_ALLOCATED_FROM_ROUND_1: { - "hasMany": True, - "isDerived": False, - "columns": [ - {"columnName": "electionId", "grouped": True, "func": None, "source": SOURCE_META}, - {"columnName": "areaId", "grouped": True, "func": None, "source": SOURCE_META}, - {"columnName": "partyId", "grouped": True, "func": None, "source": SOURCE_CONTENT}, - {"columnName": "numValue", "grouped": False, "func": "sum", "source": SOURCE_CONTENT} - ] - }, - TEMPLATE_ROW_TYPE_VALID_VOTES_REMAIN_FROM_ROUND_1: { - "hasMany": True, - "isDerived": False, - "columns": [ - {"columnName": "electionId", "grouped": True, "func": None, "source": SOURCE_META}, - {"columnName": "areaId", "grouped": True, "func": None, "source": SOURCE_META}, - {"columnName": "partyId", "grouped": True, "func": None, "source": SOURCE_CONTENT}, - {"columnName": "numValue", "grouped": False, "func": "sum", "source": SOURCE_CONTENT} - ] - }, - TEMPLATE_ROW_TYPE_DRAFT_SEATS_ALLOCATED_FROM_ROUND_2: { - "hasMany": True, - "isDerived": False, - "columns": [ - {"columnName": "electionId", "grouped": True, "func": None, "source": SOURCE_META}, - {"columnName": "areaId", "grouped": True, "func": None, "source": SOURCE_META}, - {"columnName": "partyId", "grouped": True, "func": None, "source": SOURCE_CONTENT}, - {"columnName": "numValue", "grouped": False, "func": "sum", "source": SOURCE_CONTENT} - ] - }, - TEMPLATE_ROW_TYPE_SEATS_ALLOCATED_FROM_ROUND_2: { - "hasMany": True, - "isDerived": False, - "columns": [ - {"columnName": "electionId", "grouped": True, "func": None, "source": SOURCE_META}, - {"columnName": "areaId", "grouped": True, "func": None, "source": SOURCE_META}, - {"columnName": "partyId", "grouped": True, "func": None, "source": SOURCE_CONTENT}, - {"columnName": "numValue", "grouped": False, "func": "sum", "source": SOURCE_CONTENT} - ] - }, TEMPLATE_ROW_TYPE_SEATS_ALLOCATED: { "hasMany": True, "isDerived": False, diff --git a/results-tabulation-api/ext/ExtendedElection/ExtendedElectionProvincialCouncilElection2021/TallysheetTemplates/pce_r2.py b/results-tabulation-api/ext/ExtendedElection/ExtendedElectionProvincialCouncilElection2021/TallysheetTemplates/pce_r2.py index 7218dadd..dda26cbf 100644 --- a/results-tabulation-api/ext/ExtendedElection/ExtendedElectionProvincialCouncilElection2021/TallysheetTemplates/pce_r2.py +++ b/results-tabulation-api/ext/ExtendedElection/ExtendedElectionProvincialCouncilElection2021/TallysheetTemplates/pce_r2.py @@ -89,16 +89,16 @@ def create_template(): {"columnName": "numValue", "grouped": False, "func": "sum", "source": SOURCE_CONTENT} ] }, - TEMPLATE_ROW_TYPE_DRAFT_BONUS_SEATS_ALLOCATED: { - "hasMany": True, - "isDerived": False, - "columns": [ - {"columnName": "electionId", "grouped": True, "func": None, "source": SOURCE_META}, - {"columnName": "areaId", "grouped": True, "func": None, "source": SOURCE_META}, - {"columnName": "partyId", "grouped": True, "func": None, "source": SOURCE_CONTENT}, - {"columnName": "numValue", "grouped": False, "func": "sum", "source": SOURCE_CONTENT} - ] - }, + # TEMPLATE_ROW_TYPE_DRAFT_BONUS_SEATS_ALLOCATED: { + # "hasMany": True, + # "isDerived": False, + # "columns": [ + # {"columnName": "electionId", "grouped": True, "func": None, "source": SOURCE_META}, + # {"columnName": "areaId", "grouped": True, "func": None, "source": SOURCE_META}, + # {"columnName": "partyId", "grouped": True, "func": None, "source": SOURCE_CONTENT}, + # {"columnName": "numValue", "grouped": False, "func": "sum", "source": SOURCE_CONTENT} + # ] + # }, TEMPLATE_ROW_TYPE_SEATS_ALLOCATED_FROM_ROUND_2: { "hasMany": True, "isDerived": False, @@ -109,16 +109,16 @@ def create_template(): {"columnName": "numValue", "grouped": False, "func": "sum", "source": SOURCE_CONTENT} ] }, - TEMPLATE_ROW_TYPE_BONUS_SEATS_ALLOCATED: { - "hasMany": True, - "isDerived": False, - "columns": [ - {"columnName": "electionId", "grouped": True, "func": None, "source": SOURCE_META}, - {"columnName": "areaId", "grouped": True, "func": None, "source": SOURCE_META}, - {"columnName": "partyId", "grouped": True, "func": None, "source": SOURCE_CONTENT}, - {"columnName": "numValue", "grouped": False, "func": "sum", "source": SOURCE_CONTENT} - ] - }, + # TEMPLATE_ROW_TYPE_BONUS_SEATS_ALLOCATED: { + # "hasMany": True, + # "isDerived": False, + # "columns": [ + # {"columnName": "electionId", "grouped": True, "func": None, "source": SOURCE_META}, + # {"columnName": "areaId", "grouped": True, "func": None, "source": SOURCE_META}, + # {"columnName": "partyId", "grouped": True, "func": None, "source": SOURCE_CONTENT}, + # {"columnName": "numValue", "grouped": False, "func": "sum", "source": SOURCE_CONTENT} + # ] + # }, TEMPLATE_ROW_TYPE_SEATS_ALLOCATED: { "hasMany": True, "isDerived": False, diff --git a/results-tabulation-api/ext/ExtendedElection/ExtendedElectionProvincialCouncilElection2021/__init__.py b/results-tabulation-api/ext/ExtendedElection/ExtendedElectionProvincialCouncilElection2021/__init__.py index f3b1edfa..da6d8609 100644 --- a/results-tabulation-api/ext/ExtendedElection/ExtendedElectionProvincialCouncilElection2021/__init__.py +++ b/results-tabulation-api/ext/ExtendedElection/ExtendedElectionProvincialCouncilElection2021/__init__.py @@ -972,11 +972,11 @@ def _get_district_centre_entry(row): ) for row in get_rows_from_csv(number_of_seats_dataset_file): - province_election = _get_province_election(row) - province_election.meta.add_meta_data( - metaDataKey=META_DATA_KEY_ELECTION_NUMBER_OF_BONUS_SEATS_ALLOCATED, - metaDataValue=row["Bonus seats"] - ) + # province_election = _get_province_election(row) + # province_election.meta.add_meta_data( + # metaDataKey=META_DATA_KEY_ELECTION_NUMBER_OF_BONUS_SEATS_ALLOCATED, + # metaDataValue=row["Bonus seats"] + # ) administrative_district_election = _get_administrative_district_election(row) administrative_district_election.meta.add_meta_data( diff --git a/results-tabulation-api/templates/ProvincialCouncilElection2021/PCE-PC-V.html b/results-tabulation-api/templates/ProvincialCouncilElection2021/PCE-PC-V.html index 11902d3f..81e47292 100644 --- a/results-tabulation-api/templates/ProvincialCouncilElection2021/PCE-PC-V.html +++ b/results-tabulation-api/templates/ProvincialCouncilElection2021/PCE-PC-V.html @@ -42,7 +42,6 @@ Department of Elections
{{ content.election.electionName }}
{{ content.election.provinceName }} Province
- Postal Votes Results diff --git a/results-tabulation-api/templates/ProvincialCouncilElection2021/PCE-R2.html b/results-tabulation-api/templates/ProvincialCouncilElection2021/PCE-R2.html index 986a6847..df05c05b 100644 --- a/results-tabulation-api/templates/ProvincialCouncilElection2021/PCE-R2.html +++ b/results-tabulation-api/templates/ProvincialCouncilElection2021/PCE-R2.html @@ -271,7 +271,7 @@

PCE/R2

Number of members allotted at the first stage Remaining votes Number of members allotted at the second stage - Number of bonus seats allocated +{# Number of bonus seats allocated#} Number of members elected @@ -281,7 +281,7 @@

PCE/R2

(4) (5) (6) - (7) +{# (7)#} @@ -300,7 +300,7 @@

PCE/R2

{{content.total[2]}} {{content.total[3]}} - {{content.total[4]}} +{# {{content.total[4]}}#} @@ -317,8 +317,7 @@

PCE/R2

the division by the resulting number of the votes polled by each party/group should be indicated in the 3rd column, the number of members elected on the basis of the highest of the remainder in the votes - if any, in the 5th column, and the bonus seat allotted to the party/ group - which polled the highest number of votes in the 6th column and the total number + if any, in the 5th column, and the total number of members allotted to each party/group should be indicated in the 7th column. diff --git a/results-tabulation-ui/src/components/election/extended-election/ProvincialCouncilElection2021/index.js b/results-tabulation-ui/src/components/election/extended-election/ProvincialCouncilElection2021/index.js index f7e20b2c..4aad374a 100644 --- a/results-tabulation-ui/src/components/election/extended-election/ProvincialCouncilElection2021/index.js +++ b/results-tabulation-ui/src/components/election/extended-election/ProvincialCouncilElection2021/index.js @@ -132,18 +132,20 @@ export default class ExtendedElectionProvincialCouncilElection2021 extends Exten