From 8f5b90a04bc27f7fa814426f519b97ea44cb4df5 Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Fri, 17 May 2024 17:46:01 -0400 Subject: [PATCH 1/5] fix: Use camelCase codes --- docs/cost/ids/sustainability.md | 4 ++-- docs/examples/example.json | 2 +- mapping/process-level-procurement.csv | 2 +- mapping/sustainability.yaml | 4 ++-- schema/project-level/codelists/classificationScheme.csv | 2 +- schema/project-level/codelists/contractingProcessStatus.csv | 2 +- schema/project-level/project-schema.json | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/cost/ids/sustainability.md b/docs/cost/ids/sustainability.md index ff795aab..dbadc3a0 100644 --- a/docs/cost/ids/sustainability.md +++ b/docs/cost/ids/sustainability.md @@ -540,7 +540,7 @@ Project level: If an environmental impact assessment was conducted: 1. Set [`environment.hasImpactAssessment`](project-schema.json,,environment/hasImpactAssessment) to `true`. -2. Add a [`Classification`](../../reference/schema.md#classification) object to the [`environment.impactCategories`](project-schema.json,,environment/impactCategories) array, set its [`.scheme`](project-schema.json,/definitions/Classification,scheme) to 'ifc-environmental-social' and set its [`.id`](project-schema.json,/definitions/Classification,id) to the lowercase letter of the category into which the project falls. +2. Add a [`Classification`](../../reference/schema.md#classification) object to the [`environment.impactCategories`](project-schema.json,,environment/impactCategories) array, set its [`.scheme`](project-schema.json,/definitions/Classification,scheme) to 'ifcEnvironmentalSocial' and set its [`.id`](project-schema.json,/definitions/Classification,id) to the lowercase letter of the category into which the project falls. If an environmental impact assessment was not conducted, set [`environment.hasImpactAssessment`](project-schema.json,,environment/hasImpactAssessment) to `false`. ```json @@ -549,7 +549,7 @@ If an environmental impact assessment was not conducted, set [`environment.hasIm "hasImpactAssessment": true, "impactCategories": [ { - "scheme": "ifc-environmental-social", + "scheme": "ifcEnvironmentalSocial", "id": "a" } ] diff --git a/docs/examples/example.json b/docs/examples/example.json index 977402a5..46dce6a1 100644 --- a/docs/examples/example.json +++ b/docs/examples/example.json @@ -1188,7 +1188,7 @@ "hasImpactAssessment": true, "impactCategories": [ { - "scheme": "ifc-environmental-social", + "scheme": "ifcEnvironmentalSocial", "id": "a" } ], diff --git a/mapping/process-level-procurement.csv b/mapping/process-level-procurement.csv index 1671095b..329c2f2e 100644 --- a/mapping/process-level-procurement.csv +++ b/mapping/process-level-procurement.csv @@ -2,7 +2,7 @@ CoST IDS element,Description,Mapping to OC4IDS,Mapping from OCDS,OC4IDS Fields,O Procuring entity,Enter name of the organization carrying out the procurement,Project Level: Add an entry to `parties` with 'procuringEntity' included in its `.roles` | Contracting process: Record the name and identifier in `.summary.tender.procuringEntity`,"Check the `/parties` array for `Organization` objects with 'procuringEntity' in `/roles`. Copy each object to the `parties` array in OC4IDS. If there is more than one procuring entity, do not set `.summary.tender.procuringEntity.name` and `.summary.tender.procuringEntity.id`; otherwise, set them to the procuring entity's `.name` and `.id`.","parties,parties/id,parties/name,parties/role,contractingProcesses,contractingProcesses/summary,contractingProcesses/summary/tender,contractingProcesses/summary/tender/procuringEntity,contractingProcesses/summary/tender/procuringEntity/id,contractingProcesses/summary/tender/procuringEntity/name",parties/roles='procuringEntity' Procuring entity contact details,Postal and Electronic address,Project Level: Publish the postal address in `parties.address` and the electronic address in `parties.contactPoint`,"Check the `/parties` array for `Organization` objects with 'procuringEntity' in `/roles`. Copy each object to the `parties` array in OC4IDS. If there is more than one procuring entity, do not set `.summary.tender.procuringEntity.name` and `.summary.tender.procuringEntity.id`; otherwise, set them to the procuring entity's `.name` and `.id`.","parties,parties/id,parties/address,parties/address/streetAddress,parties/address/locality,parties/address/region,parties/address/postalCode,parties/address/countryName,parties/contactPoint,parties/contactPoint/email",parties/roles='procuringEntity' Contract administrative entity,Enter name of the organization carrying out the contract administrative entity if different from the Procuring Entity,Project Level: Add an entry to `parties` with 'administrativeEntity' included in its `.roles` | Contracting process: Record the name and identifier in `.summary.tender.administrativeEntity`,"Check the `/parties` array for `Organization` objects with 'administrativeEntity' in `/roles`. Copy each object to the `parties` array in OC4IDS. If there is more than one procuring entity, do not set `.summary.tender.administrativeEntity.name` and `.summary.tender.administrativeEntity.id`; otherwise, set them to the procuring entity's `.name` and `.id`.","parties,parties/id,parties/name,parties/role,contractingProcesses,contractingProcesses/summary,contractingProcesses/summary/tender,contractingProcesses/summary/tender/administrativeEntity,contractingProcesses/summary/tender/administrativeEntity/id,contractingProcesses/summary/tender/administrativeEntity/name",parties/roles='administrativeEntity' -Contract status,"Select from pre-award, active or closed",Contracting process: Publish in `.summary.status` using the contractingProcessStatus codelist,Set `.summary.status` to a value from the contractingProcessStatus codelist according to the business logic in the codelist.,"contractingProcesses,contractingProcesses/summary,contractingProcesses/summary/status", +Contract status,"Select from preAward, active or closed",Contracting process: Publish in `.summary.status` using the contractingProcessStatus codelist,Set `.summary.status` to a value from the contractingProcessStatus codelist according to the business logic in the codelist.,"contractingProcesses,contractingProcesses/summary,contractingProcesses/summary/status", Procurement process,"Develop a list such as International Competitive Bidding, National Competitive Bidding, Donor Procurement Rules, Framework, Direct Award",Contracting process: Publish in `.summary.tender.procurementMethodDetails` and map to `.summary.tender.procurementMethod`,Set `.summary.tender.procurementMethod` and `.summary.tender.procurementMethodDetails`to the values of `/tender/procurementMethod` and `/tender/procurementMethodDetails` respectively.,"contractingProcesses,contractingProcesses/summary,contractingProcesses/summary/tender,contractingProcesses/summary/tender/procurementMethodDetails,contractingProcesses/summary/tender/procurementMethod", Contract type,"Develop a list such as Design, Supervision, Design & Supervision, Design & Build, Construction","Contracting process: Add one or more values to the `.summary.nature` array. (e.g. [""design"", ""build""] for a design and build contract)",*Map from `/tender/items/classification` or `/tender/items/additionalClassifications` or infer from `/tender/description`.*,"contractingProcesses,contractingProcesses/summary,contractingProcesses/summary/nature", Number of firms tendering,Number of firms who submit a tender,Contracting process: Publish in `.summary.tender.numberOfTenderers`,Set `.summary.numberOfTenderers` to the value of `/tender/numberOfTenderers`.,"contractingProcesses,contractingProcesses/summary,contractingProcesses/summary/tender,contractingProcesses/summary/tender/numberOfTenderers", diff --git a/mapping/sustainability.yaml b/mapping/sustainability.yaml index fb1e9ed7..f4cb79e9 100644 --- a/mapping/sustainability.yaml +++ b/mapping/sustainability.yaml @@ -433,7 +433,7 @@ If an environmental impact assessment was conducted: 1. Set [`environment.hasImpactAssessment`](project-schema.json,,environment/hasImpactAssessment) to `true`. - 2. Add a [`Classification`](../../reference/schema.md#classification) object to the [`environment.impactCategories`](project-schema.json,,environment/impactCategories) array, set its [`.scheme`](project-schema.json,/definitions/Classification,scheme) to 'ifc-environmental-social' and set its [`.id`](project-schema.json,/definitions/Classification,id) to the lowercase letter of the category into which the project falls. + 2. Add a [`Classification`](../../reference/schema.md#classification) object to the [`environment.impactCategories`](project-schema.json,,environment/impactCategories) array, set its [`.scheme`](project-schema.json,/definitions/Classification,scheme) to 'ifcEnvironmentalSocial' and set its [`.id`](project-schema.json,/definitions/Classification,id) to the lowercase letter of the category into which the project falls. If an environmental impact assessment was not conducted, set [`environment.hasImpactAssessment`](project-schema.json,,environment/hasImpactAssessment) to `false`. example: |- @@ -442,7 +442,7 @@ "hasImpactAssessment": true, "impactCategories": [ { - "scheme": "ifc-environmental-social", + "scheme": "ifcEnvironmentalSocial", "id": "a" } ] diff --git a/schema/project-level/codelists/classificationScheme.csv b/schema/project-level/codelists/classificationScheme.csv index 29f3d8f0..5a80fc0c 100644 --- a/schema/project-level/codelists/classificationScheme.csv +++ b/schema/project-level/codelists/classificationScheme.csv @@ -4,4 +4,4 @@ sdgTarget,Sustainable Development Goal Targets,The Sustainable Development Goal icms,International Cost Measurement Standard,"The International Cost Measurement Standard provides a single methodology for reporting, grouping and classifying construction project costs.",https://icms-coalition.org/the-standard/,costMeasurement costIdsLegalType,CoST IDS Legal Type,The CoST IDS classification of an organization's legal type.,https://standard.open-contracting.org/infrastructure/latest/en/cost/ids/sustainability/#climate-finance-accredited-entity-type,organization costIdsAdministrativeLevel,CoST IDS Administrative Level,The CoST IDS classification of an organization's administrative level.,https://standard.open-contracting.org/infrastructure/latest/en/cost/ids/sustainability/#climate-finance-accredited-entity-type,organization -ifc-environmental-social,International Finance Corporation’s Policy on environmental and social sustainability,"As part of the review of environmental and social risks and impacts of a proposed investment, IFC uses a process of environmental and social categorization to reflect the magnitude of risks and impacts.",https://www.ifc.org/en/insights-reports/2012/publications-policy-sustainability-2012,purpose +ifcEnvironmentalSocial,International Finance Corporation’s Policy on environmental and social sustainability,"As part of the review of environmental and social risks and impacts of a proposed investment, IFC uses a process of environmental and social categorization to reflect the magnitude of risks and impacts.",https://www.ifc.org/en/insights-reports/2012/publications-policy-sustainability-2012,purpose diff --git a/schema/project-level/codelists/contractingProcessStatus.csv b/schema/project-level/codelists/contractingProcessStatus.csv index 1231bd59..9332c461 100644 --- a/schema/project-level/codelists/contractingProcessStatus.csv +++ b/schema/project-level/codelists/contractingProcessStatus.csv @@ -1,4 +1,4 @@ Code,Title,Description,Business Logic -pre-award,Pre-award,"No contract has yet been awarded, and the process has not ended.","`tender.status` is not 'cancelled', 'unsuccessful' or 'withdrawn', and one of: There are no awards or contracts; All `Award.status` and `Contract.status` are 'pending'; All award dates (in order of preference: `Award.date`, `tender.awardPeriod`) are in the future." +preAward,Pre-award,"No contract has yet been awarded, and the process has not ended.","`tender.status` is not 'cancelled', 'unsuccessful' or 'withdrawn', and one of: There are no awards or contracts; All `Award.status` and `Contract.status` are 'pending'; All award dates (in order of preference: `Award.date`, `tender.awardPeriod`) are in the future." active,Active,"A contract was awarded, but not all contracts have ended.","One of: There is at least one `Contract.status` of 'active'; At least one contract period (in order of preference: `Contract.period`, `Award.contractPeriod`, `tender.contractPeriod`) includes the present date." closed,Closed,"The process ended with no contract being awarded, or all contracts have ended.","One of: `tender.status` is 'cancelled', 'unsuccessful' or 'withdrawn'; There is at least one award, and all `Award.status` are 'cancelled' or 'unsuccessful'; There is at least one contract, and all `Contract.status` are 'terminated' or 'cancelled'; The `.endDate` of all contract periods (in order of preference: `Contract.period`, `Award.contractPeriod`, `tender.contractPeriod`), are in the past." diff --git a/schema/project-level/project-schema.json b/schema/project-level/project-schema.json index d7e2b4e3..028cc105 100644 --- a/schema/project-level/project-schema.json +++ b/schema/project-level/project-schema.json @@ -590,7 +590,7 @@ "description": "The status of this contracting process. Drawn from the [contractingProcessStatus codelist](https://standard.open-contracting.org/infrastructure/{{version}}/{{lang}}/reference/codelists/#contractingprocessstatus).", "type": "string", "enum": [ - "pre-award", + "preAward", "active", "closed" ], From fd5480cf113e3e4ce1e5b1afa8f9b9bd84781d8b Mon Sep 17 00:00:00 2001 From: Duncan Dewhurst Date: Fri, 14 Jun 2024 09:10:28 +0100 Subject: [PATCH 2/5] schema/codelists/contractingProcessStatus: Deprecate pre-award --- .../project-level/codelists/contractingProcessStatus.csv | 9 +++++---- schema/project-level/project-schema.json | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/schema/project-level/codelists/contractingProcessStatus.csv b/schema/project-level/codelists/contractingProcessStatus.csv index 9332c461..47f9d35d 100644 --- a/schema/project-level/codelists/contractingProcessStatus.csv +++ b/schema/project-level/codelists/contractingProcessStatus.csv @@ -1,4 +1,5 @@ -Code,Title,Description,Business Logic -preAward,Pre-award,"No contract has yet been awarded, and the process has not ended.","`tender.status` is not 'cancelled', 'unsuccessful' or 'withdrawn', and one of: There are no awards or contracts; All `Award.status` and `Contract.status` are 'pending'; All award dates (in order of preference: `Award.date`, `tender.awardPeriod`) are in the future." -active,Active,"A contract was awarded, but not all contracts have ended.","One of: There is at least one `Contract.status` of 'active'; At least one contract period (in order of preference: `Contract.period`, `Award.contractPeriod`, `tender.contractPeriod`) includes the present date." -closed,Closed,"The process ended with no contract being awarded, or all contracts have ended.","One of: `tender.status` is 'cancelled', 'unsuccessful' or 'withdrawn'; There is at least one award, and all `Award.status` are 'cancelled' or 'unsuccessful'; There is at least one contract, and all `Contract.status` are 'terminated' or 'cancelled'; The `.endDate` of all contract periods (in order of preference: `Contract.period`, `Award.contractPeriod`, `tender.contractPeriod`), are in the past." +Code,Title,Description,Business Logic,Deprecated +preAward,Pre-award,"No contract has yet been awarded, and the process has not ended.","`tender.status` is not 'cancelled', 'unsuccessful' or 'withdrawn', and one of: There are no awards or contracts; All `Award.status` and `Contract.status` are 'pending'; All award dates (in order of preference: `Award.date`, `tender.awardPeriod`) are in the future.", +active,Active,"A contract was awarded, but not all contracts have ended.","One of: There is at least one `Contract.status` of 'active'; At least one contract period (in order of preference: `Contract.period`, `Award.contractPeriod`, `tender.contractPeriod`) includes the present date.", +closed,Closed,"The process ended with no contract being awarded, or all contracts have ended.","One of: `tender.status` is 'cancelled', 'unsuccessful' or 'withdrawn'; There is at least one award, and all `Award.status` are 'cancelled' or 'unsuccessful'; There is at least one contract, and all `Contract.status` are 'terminated' or 'cancelled'; The `.endDate` of all contract periods (in order of preference: `Contract.period`, `Award.contractPeriod`, `tender.contractPeriod`), are in the past.", +pre-award,Pre-award,"This code is deprecated in favour of 'preAward', to conform to the use of camelCase for codes.","",0.9.5 diff --git a/schema/project-level/project-schema.json b/schema/project-level/project-schema.json index 028cc105..91a2e4d4 100644 --- a/schema/project-level/project-schema.json +++ b/schema/project-level/project-schema.json @@ -592,7 +592,8 @@ "enum": [ "preAward", "active", - "closed" + "closed", + "pre-award" ], "codelist": "contractingProcessStatus.csv", "openCodelist": false From a9b3c4a96452cbfd97b8b8d403ed0cf1d00f3a32 Mon Sep 17 00:00:00 2001 From: Duncan Dewhurst Date: Fri, 14 Jun 2024 09:15:13 +0100 Subject: [PATCH 3/5] schema/project-level/codelists/contractingProcessStatus: Fix lint error --- schema/project-level/codelists/contractingProcessStatus.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schema/project-level/codelists/contractingProcessStatus.csv b/schema/project-level/codelists/contractingProcessStatus.csv index 47f9d35d..91581ade 100644 --- a/schema/project-level/codelists/contractingProcessStatus.csv +++ b/schema/project-level/codelists/contractingProcessStatus.csv @@ -2,4 +2,4 @@ Code,Title,Description,Business Logic,Deprecated preAward,Pre-award,"No contract has yet been awarded, and the process has not ended.","`tender.status` is not 'cancelled', 'unsuccessful' or 'withdrawn', and one of: There are no awards or contracts; All `Award.status` and `Contract.status` are 'pending'; All award dates (in order of preference: `Award.date`, `tender.awardPeriod`) are in the future.", active,Active,"A contract was awarded, but not all contracts have ended.","One of: There is at least one `Contract.status` of 'active'; At least one contract period (in order of preference: `Contract.period`, `Award.contractPeriod`, `tender.contractPeriod`) includes the present date.", closed,Closed,"The process ended with no contract being awarded, or all contracts have ended.","One of: `tender.status` is 'cancelled', 'unsuccessful' or 'withdrawn'; There is at least one award, and all `Award.status` are 'cancelled' or 'unsuccessful'; There is at least one contract, and all `Contract.status` are 'terminated' or 'cancelled'; The `.endDate` of all contract periods (in order of preference: `Contract.period`, `Award.contractPeriod`, `tender.contractPeriod`), are in the past.", -pre-award,Pre-award,"This code is deprecated in favour of 'preAward', to conform to the use of camelCase for codes.","",0.9.5 +pre-award,Pre-award,"This code is deprecated in favour of 'preAward', to conform to the use of camelCase for codes.",,0.9.5 From d7529f46f39c9d3cfc52bd97d7ca2548aa3f6cfb Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Wed, 3 Jul 2024 18:57:46 -0400 Subject: [PATCH 4/5] chore: Spellcheck --- mapping/project-level-identification.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mapping/project-level-identification.csv b/mapping/project-level-identification.csv index 4dd52e8b..419bc7f8 100644 --- a/mapping/project-level-identification.csv +++ b/mapping/project-level-identification.csv @@ -4,5 +4,5 @@ Sector,"Develop a list of sectors relevant to country e.g. housing, transport, e Subsector,"Develop a subset for each sector e.g. Transport could be subdivided into national highway, local road, railway, port, airport etc.",Project Level: Publish in `additionalClassifications`,Copy each `Classification` object from the `/planning/project/additionalClassifications` array (Project extension) to the `additionalClassifications` array.,"additionalClassifications,additionalClassifications/id,additionalClassifications/scheme", Project name,Specify the project name,Project Level: Publish in `title`,"Set `title` to the value of `/planning/project/title` (Project extension); if not available, optionally use `/tender/title`.",title, Project Location,Briefly specify location of the project,"Project Level: Publish using the `locations` fields as an address, geometry (point/line/polygon) or gazetteer entry","Copy each `Location` object from `/planning/project/locations` (Project extension) to the `locations` array; if not available, optionally use `/tender/items/deliveryLocation` or `/tender/items/deliveryAddress` (Location extension). Add an `.id` to each `Location` object.","locations,locations/id,locations/address,locations/address/streetAddress,locations/address/locality,locations/address/region,locations/address/postalCode,locations/address/countryName,locations/geometry,locations/geometry/type,locations/geometry/coordinates,locations/gazetteer/scheme,locations/gazetteer/identifiers", -Purpose,Specify the socio-economic purpose of the project,"Project Level: Publish in `purpose`; if classified against a codelist, also publish in `additionalClassifications`.","Set `purpose` to the value of `/planning/rationale`; if not available, optionally check the `/planning/documents` array for `Document` objects with `/type` set to 'needsAssessment' and copy each object to the `documents` array.","purpose,additionalClassifications,additionalClassifications/id,additionalClassifications/scheme", +Purpose,Specify the socioeconomic purpose of the project,"Project Level: Publish in `purpose`; if classified against a codelist, also publish in `additionalClassifications`.","Set `purpose` to the value of `/planning/rationale`; if not available, optionally check the `/planning/documents` array for `Document` objects with `/type` set to 'needsAssessment' and copy each object to the `documents` array.","purpose,additionalClassifications,additionalClassifications/id,additionalClassifications/scheme", Project description,Concise description and details of the project,Project Level: Publish in `description`,"Set `description` to the value of `/planning/project/description` (Project extension); if not available, optionally use `/tender/description`.",description, From 92d25df3afd04ed5274db2714cfc0d36c9b0d882 Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Wed, 3 Jul 2024 18:59:48 -0400 Subject: [PATCH 5/5] chore: flake8 --- manage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manage.py b/manage.py index c75b036a..8fc17160 100755 --- a/manage.py +++ b/manage.py @@ -1100,7 +1100,7 @@ def _get_paths(d, path=""): elif element["refs"] != "": # elements that reference another element and have a blank example example = mapping[element["refs"]]["example"] # A dict is used to preserve order (unlike a set). - element["fields"] = list({path: 0 for path in _get_paths(json.loads(example))}) + element["fields"] = list(dict.fromkeys(_get_paths(json.loads(example)), 0)) write_yaml_file(filename, list(mapping.values()))