From c9e3f5e74f846ec447b452e3e2418b100778e9a3 Mon Sep 17 00:00:00 2001 From: odscjen Date: Tue, 24 Sep 2024 15:17:45 +0100 Subject: [PATCH 1/3] add maintenance code to projectType --- docs/reference/schema.md | 2 +- schema/project-level/codelists/projectType.csv | 5 +++-- schema/project-level/project-schema.json | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/reference/schema.md b/docs/reference/schema.md index 336f5622..332f574f 100644 --- a/docs/reference/schema.md +++ b/docs/reference/schema.md @@ -18,7 +18,7 @@ The top-level object in OC4IDS is a project. A project is defined as: -> The development of a set of infrastructure assets in a specified location, generally the responsibility of a single procuring entity and budget authority: for example, a highway overpass or a university campus. +> The development, maintenance, rehabilitation, expansion, replacement and/or decommissioning of a set of infrastructure assets in a specified location, generally the responsibility of a single procuring entity and budget authority: for example, a highway overpass or a university campus. Development covers project identification, preparation, implementation and completion. A project's fields include: diff --git a/schema/project-level/codelists/projectType.csv b/schema/project-level/codelists/projectType.csv index 81e95523..7fb3ddbf 100644 --- a/schema/project-level/codelists/projectType.csv +++ b/schema/project-level/codelists/projectType.csv @@ -1,6 +1,7 @@ Code,Title,Description construction,Construction,The primary focus of this project is the construction of a new asset. -rehabilitation,Rehabilitation,The primary focus of this project is the rehabilitation of an existing asset. +maintenance,Maintenance,The primary focus of this project is proactively identifying and addressing deficiencies in an existing asset to slow the deterioration of the asset. +rehabilitation,Rehabilitation,The primary focus of this project is reactively addressing significant deficiencies in an existing asset to stop the deterioration of the asset. replacement,Replacement,The primary focus of this project is the replacement of an existing asset. -expansion,Expansion,The primary focus of this project is the expansion of an existing asset. +expansion,Expansion,The primary focus of this project is the expansion or upgrade of an existing asset. decommissioning,Decommissioning,The primary focus of this project is the decommissioning of an existing asset. diff --git a/schema/project-level/project-schema.json b/schema/project-level/project-schema.json index 91a2e4d4..892e2e23 100644 --- a/schema/project-level/project-schema.json +++ b/schema/project-level/project-schema.json @@ -2,7 +2,7 @@ "$schema": "http://json-schema.org/draft-04/schema#", "id": "https://standard.open-contracting.org/infrastructure/schema/0__9__5/project-schema.json", "title": "Open Contracting for Infrastructure Data Standard Schema", - "description": "The Open Contracting for Infrastructure Data Standard (OC4IDS) schema sets out a data structure for capturing and exchanging information about infrastructure projects in line with the disclosure requirements of the [CoST Infrastructure Data Standard](https://infrastructuretransparency.org/resource/977/). OC4IDS defines an \"infrastructure project\" as: \"the development, maintenance and decommissioning of a set of infrastructure assets in a specified location, generally the responsibility of a single procuring entity and budget authority: for example, a highway overpass or a university campus. Development covers project identification, preparation, implementation and completion.\"", + "description": "The Open Contracting for Infrastructure Data Standard (OC4IDS) schema sets out a data structure for capturing and exchanging information about infrastructure projects in line with the disclosure requirements of the [CoST Infrastructure Data Standard](https://infrastructuretransparency.org/resource/977/). OC4IDS defines an \"infrastructure project\" as: \"the development, maintenance, rehabilitation, expansion, replacement and/or decommissioning of a set of infrastructure assets in a specified location, generally the responsibility of a single procuring entity and budget authority: for example, a highway overpass or a university campus. Development covers project identification, preparation, implementation and completion.\"", "type": "object", "required": [ "id" @@ -145,6 +145,7 @@ "type": "string", "enum": [ "construction", + "maintenance", "rehabilitation", "replacement", "expansion", From 4a2f1aca356b12a8b1d06139597f8599f937e243 Mon Sep 17 00:00:00 2001 From: odscjen Date: Tue, 24 Sep 2024 15:34:48 +0100 Subject: [PATCH 2/3] update changelog.md --- docs/reference/changelog.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/reference/changelog.md b/docs/reference/changelog.md index ad8b3b61..2cc619c2 100644 --- a/docs/reference/changelog.md +++ b/docs/reference/changelog.md @@ -22,6 +22,12 @@ * [#475](https://github.com/open-contracting/infrastructure/pull/475) - conservationMeasure: * 'airManagement' * 'waterManagement' + * [#493](https://github.com/open-contracting/infrastructure/pull/493) - projectType: + * 'maintenance' +* Update code definitions: + * [#493](https://github.com/open-contracting/infrastructure/pull/493) - projectType: + * 'rehabilitation' + * 'expansion' ### Other From a2b4bede73e46946dc23c1491a30e5321103c81c Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Tue, 24 Sep 2024 18:10:01 -0400 Subject: [PATCH 3/3] fix: Fix _get_definition_references calls --- manage.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/manage.py b/manage.py index c3cbc5d6..bbff0b20 100755 --- a/manage.py +++ b/manage.py @@ -155,7 +155,7 @@ def _get_definition_references(schema, defn, parents=None, project_schema=None, defn, [*parents, key, "0"], project_schema, - include_nested, + include_nested=include_nested, ) ) elif "$ref" in value: @@ -168,17 +168,21 @@ def _get_definition_references(schema, defn, parents=None, project_schema=None, defn, [*parents, key], project_schema, - include_nested, + include_nested=include_nested, ) ) elif "properties" in value: references.extend( - _get_definition_references(value, defn, [*parents, key], project_schema, include_nested) + _get_definition_references( + value, defn, [*parents, key], project_schema, include_nested=include_nested + ) ) if "definitions" in schema: for key, value in schema["definitions"].items(): - references.extend(_get_definition_references(value, defn, [key], project_schema, include_nested)) + references.extend( + _get_definition_references(value, defn, [key], project_schema, include_nested=include_nested) + ) return references