Skip to content

Commit

Permalink
Merge pull request #43 from Open-Telecoms-Data/2022-11-16
Browse files Browse the repository at this point in the history
work
  • Loading branch information
James (ODSC) authored Nov 18, 2022
2 parents 9ffe657 + de2b960 commit 4221901
Show file tree
Hide file tree
Showing 19 changed files with 232 additions and 80 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Python Validate:
- add more information to errors
- Add unique ID checks
- Add path to output

## [0.4.0] - 2022-11-09

Expand Down
12 changes: 11 additions & 1 deletion docs/additional_checks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,14 @@ Node not used in any spans

Produces additional checks of type:

* `node_not_used_in_any_spans`
* `node_not_used_in_any_spans`

Unique ID's
-----------

* `duplicate_node_id`
* `duplicate_span_id`
* `duplicate_phase_id`
* `duplicate_organisation_id`
* `duplicate_contract_id`

255 changes: 177 additions & 78 deletions libcoveofds/python_validate.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"type": "span_end_node_not_found",
"missing_node_id": "2467",
"span_id": "1",
"path": "/networks/0/spans/0/end",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"type": "node_international_connections_country_not_set",
"node_id": "1",
"path": "/networks/0/nodes/0/internationalConnections/0",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
6.713
]
],
"path": "/networks/0/nodes/0/location/coordinates",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"type": "node_location_type_incorrect",
"node_id": "1",
"incorrect_type": "LineString",
"path": "/networks/0/nodes/0/location/type",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"type": "node_not_used_in_any_spans",
"node_id": "3",
"path": "/networks/0/nodes/2",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,46 @@
"type": "node_organisation_reference_id_not_found",
"node_id": "1",
"field": "physicalInfrastructureProvider",
"path": "/networks/0/nodes/0/physicalInfrastructureProvider/id",
"organisation_id_not_found": "2",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
},
{
"type": "node_organisation_reference_id_not_found",
"node_id": "1",
"field": "networkProvider",
"path": "/networks/0/nodes/0/networkProvider/id",
"organisation_id_not_found": "3",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
},
{
"type": "span_organisation_reference_id_not_found",
"span_id": "1",
"field": "physicalInfrastructureProvider",
"path": "/networks/0/spans/0/physicalInfrastructureProvider/id",
"organisation_id_not_found": "4",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
},
{
"type": "span_organisation_reference_id_not_found",
"span_id": "1",
"field": "networkProvider",
"path": "/networks/0/spans/0/networkProvider/id",
"organisation_id_not_found": "5",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
},
{
"type": "span_organisation_reference_id_not_found",
"span_id": "1",
"field": "supplier",
"path": "/networks/0/spans/0/supplier/id",
"organisation_id_not_found": "6",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
},
{
"type": "phase_organisation_reference_id_not_found",
"phase_id": "1",
"path": "/networks/0/phases/0/funders/0/id",
"organisation_id_not_found": "7",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"type": "node_organisation_reference_name_does_not_match",
"node_id": "1",
"field": "physicalInfrastructureProvider",
"path": "/networks/0/nodes/0/physicalInfrastructureProvider/name",
"name_in_reference": "Nothing Nowhere A",
"name_should_be": "Everything Everywhere",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
Expand All @@ -11,6 +12,7 @@
"type": "node_organisation_reference_name_does_not_match",
"node_id": "1",
"field": "networkProvider",
"path": "/networks/0/nodes/0/networkProvider/name",
"name_in_reference": "Nothing Nowhere B",
"name_should_be": "Everything Everywhere",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
Expand All @@ -19,6 +21,7 @@
"type": "span_organisation_reference_name_does_not_match",
"span_id": "1",
"field": "physicalInfrastructureProvider",
"path": "/networks/0/spans/0/physicalInfrastructureProvider/name",
"name_in_reference": "Nothing Nowhere C",
"name_should_be": "Everything Everywhere",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
Expand All @@ -27,6 +30,7 @@
"type": "span_organisation_reference_name_does_not_match",
"span_id": "1",
"field": "networkProvider",
"path": "/networks/0/spans/0/networkProvider/name",
"name_in_reference": "Nothing Nowhere D",
"name_should_be": "Everything Everywhere",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
Expand All @@ -35,13 +39,15 @@
"type": "span_organisation_reference_name_does_not_match",
"span_id": "1",
"field": "supplier",
"path": "/networks/0/spans/0/supplier/name",
"name_in_reference": "Nothing Nowhere E",
"name_should_be": "Everything Everywhere",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
},
{
"type": "phase_organisation_reference_name_does_not_match",
"phase_id": "1",
"path": "/networks/0/phases/0/funders/0/name",
"name_in_reference": "Nothing Nowhere F",
"name_should_be": "Everything Everywhere",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,46 @@
"type": "node_organisation_reference_name_set_but_not_in_original",
"node_id": "1",
"field": "physicalInfrastructureProvider",
"path": "/networks/0/nodes/0/physicalInfrastructureProvider/name",
"name_in_reference": "Nothing Nowhere A",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
},
{
"type": "node_organisation_reference_name_set_but_not_in_original",
"node_id": "1",
"field": "networkProvider",
"path": "/networks/0/nodes/0/networkProvider/name",
"name_in_reference": "Nothing Nowhere B",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
},
{
"type": "span_organisation_reference_name_set_but_not_in_original",
"span_id": "1",
"field": "physicalInfrastructureProvider",
"path": "/networks/0/spans/0/physicalInfrastructureProvider/name",
"name_in_reference": "Nothing Nowhere C",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
},
{
"type": "span_organisation_reference_name_set_but_not_in_original",
"span_id": "1",
"field": "networkProvider",
"path": "/networks/0/spans/0/networkProvider/name",
"name_in_reference": "Nothing Nowhere D",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
},
{
"type": "span_organisation_reference_name_set_but_not_in_original",
"span_id": "1",
"field": "supplier",
"path": "/networks/0/spans/0/supplier/name",
"name_in_reference": "Nothing Nowhere E",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
},
{
"type": "phase_organisation_reference_name_set_but_not_in_original",
"phase_id": "1",
"path": "/networks/0/phases/0/funders/0/name",
"name_in_reference": "Nothing Nowhere F",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@
{
"type": "node_phase_reference_id_not_found",
"node_id": "1",
"path": "/networks/0/nodes/0/phase/id",
"phase_id_not_found": "2",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
},
{
"type": "span_phase_reference_id_not_found",
"span_id": "1",
"path": "/networks/0/spans/0/phase/id",
"phase_id_not_found": "3",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
},
{
"type": "contract_related_phase_reference_id_not_found",
"contract_id": "1",
"path": "/networks/0/contracts/0/relatedPhases/0/id",
"phase_id_not_found": "4",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,23 @@
{
"type": "node_phase_reference_name_does_not_match",
"node_id": "1",
"path": "/networks/0/nodes/0/phase/name",
"name_in_reference": "I forget",
"name_should_be": "NextGen Phase 1",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
},
{
"type": "span_phase_reference_name_does_not_match",
"span_id": "1",
"path": "/networks/0/spans/0/phase/name",
"name_in_reference": "I forget again",
"name_should_be": "NextGen Phase 1",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
},
{
"type": "contract_related_phase_reference_name_does_not_match",
"contract_id": "1",
"path": "/networks/0/contracts/0/relatedPhases/0/name",
"name_in_reference": "I forget, really I'm so bad",
"name_should_be": "NextGen Phase 1",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,28 @@
{
"type": "node_phase_reference_name_set_but_not_in_original",
"node_id": "1",
"path": "/networks/0/nodes/0/phase/name",
"name_in_reference": "I forget",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
},
{
"type": "node_phase_reference_name_set_but_not_in_original",
"node_id": "2",
"path": "/networks/0/nodes/1/phase/name",
"name_in_reference": "I forget again",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
},
{
"type": "span_phase_reference_name_set_but_not_in_original",
"span_id": "1",
"path": "/networks/0/spans/0/phase/name",
"name_in_reference": "I forget more",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
},
{
"type": "contract_related_phase_reference_name_set_but_not_in_original",
"contract_id": "1",
"path": "/networks/0/contracts/0/relatedPhases/0/name",
"name_in_reference": "I forget, did I even know?",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
-1.628,
6.711
],
"path": "/networks/0/spans/0/route/coordinates",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"type": "span_route_type_incorrect",
"span_id": "1",
"incorrect_type": "Point",
"path": "/networks/0/spans/0/route/type",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"type": "span_start_node_not_found",
"missing_node_id": "167",
"span_id": "1",
"path": "/networks/0/spans/0/start",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
}
]
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[
{
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4",
"type": "has_links_with_external_node_data"
"type": "has_links_with_external_node_data",
"path": "/networks/0"
}
]
5 changes: 5 additions & 0 deletions tests/fixtures/pythonvalidate/unique_ids_1.expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,31 @@
{
"type": "duplicate_node_id",
"node_id": "2",
"path": "/networks/0/nodes/2",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
},
{
"type": "duplicate_span_id",
"span_id": "1",
"path": "/networks/0/spans/1",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
},
{
"type": "duplicate_phase_id",
"phase_id": "2",
"path": "/networks/0/phases/1",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
},
{
"type": "duplicate_organisation_id",
"organisation_id": "2",
"path": "/networks/0/organisations/1",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
},
{
"type": "duplicate_contract_id",
"contract_id": "2",
"path": "/networks/0/contracts/1",
"network_id": "a096d627-72e1-4f9b-b129-951b1737bff4"
}
]

0 comments on commit 4221901

Please sign in to comment.