Skip to content

Commit

Permalink
Merge pull request #276 from Open-Telecoms-Data/remove-temporary-code
Browse files Browse the repository at this point in the history
Remove temporary code
  • Loading branch information
Bjwebb authored Jun 28, 2023
2 parents 5b8b22d + 427d074 commit 41addf3
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 57 deletions.
4 changes: 2 additions & 2 deletions docs/history/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ Iterative improvements are made outside of the release cycle. They do not involv

### Normative documentation

- [#262](https://github.com/Open-Telecoms-Data/open-fibre-data-standard/pull/262) - Use well-known text to represent geometries in the CSV publication format.
- [#262](https://github.com/Open-Telecoms-Data/open-fibre-data-standard/pull/262), [#276](https://github.com/Open-Telecoms-Data/open-fibre-data-standard/pull/276) - Use well-known text to represent geometries in the CSV publication format.
- [#260](https://github.com/Open-Telecoms-Data/open-fibre-data-standard/pull/260) - Use relative links to jsonschema anchors.
- [#266](https://github.com/Open-Telecoms-Data/open-fibre-data-standard/pull/266) - Add `featureType` field to GeoJSON publication format.
- [#266](https://github.com/Open-Telecoms-Data/open-fibre-data-standard/pull/266), [#276](https://github.com/Open-Telecoms-Data/open-fibre-data-standard/pull/276) - Add `featureType` field to GeoJSON publication format.

### Non-normative documentation

Expand Down
2 changes: 1 addition & 1 deletion examples/csv/spans.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
id,spans/0/id,spans/0/name,spans/0/phase/id,spans/0/phase/name,spans/0/status,spans/0/readyForServiceDate,spans/0/start,spans/0/end,spans/0/directed,spans/0/route,spans/0/physicalInfrastructureProvider/id,spans/0/physicalInfrastructureProvider/name,spans/0/supplier/id,spans/0/supplier/name,spans/0/transmissionMedium,spans/0/deployment,spans/0/deploymentDetails/description,spans/0/darkFibre,spans/0/fibreType,spans/0/fibreTypeDetails/fibreSubtype,spans/0/fibreTypeDetails/description,spans/0/fibreCount,spans/0/fibreLength,spans/0/technologies,spans/0/capacity,spans/0/capacityDetails/description,spans/0/countries
a096d627-72e1-4f9b-b129-951b1737bff4,1,Accra to Kumasi,1,NextGen Phase 1,operational,2018-01-01,1,2,False,"LINESTRING (-0.173 5.626,-0.178 5.807,-0.112 5.971,-0.211 5.963,-0.321 6.17,-0.488 6.29,-0.56 6.421,-0.752 6.533,-0.867 6.607,-1.101 6.585,-1.304 6.623,-1.461 6.727,-1.628 6.713)",GH-RGD-CS111111111,FibreCo,GH-RGD-CS333333333,ProjectCo,fibre,belowGround,Buried in ducts,True,G.652,G.652.D,"CABLED STANDARD ENHANCED SINGLEMODE FIBRE ESMF, LOW WATER PEAK SINGLE MODE FIBRE G.652.D, OS2",24,276000,sdh,4.976,2xSTM-16,GH
a096d627-72e1-4f9b-b129-951b1737bff4,1,Accra to Kumasi,1,NextGen Phase 1,operational,2018-01-01,1,2,False,"LINESTRING (-0.173 5.626, -0.178 5.807, -0.112 5.971, -0.211 5.963, -0.321 6.17, -0.488 6.29, -0.56 6.421, -0.752 6.533, -0.867 6.607, -1.101 6.585, -1.304 6.623, -1.461 6.727, -1.628 6.713)",GH-RGD-CS111111111,FibreCo,GH-RGD-CS333333333,ProjectCo,fibre,belowGround,Buried in ducts,True,G.652,G.652.D,"CABLED STANDARD ENHANCED SINGLEMODE FIBRE ESMF, LOW WATER PEAK SINGLE MODE FIBRE G.652.D, OS2",24,276000,sdh,4.976,2xSTM-16,GH
30 changes: 28 additions & 2 deletions examples/geojson/nodes.geojson
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,20 @@
"networkProviders": [
{
"id": "GH-RGD-CS222222222",
"name": "FastWeb"
"name": "FastWeb",
"identifier": {
"id": "CS222222222",
"scheme": "GH-RGD",
"legalName": "FastWeb Ghana Limited",
"uri": "https://example.com/companies/CS222222222"
},
"country": "GH",
"roles": [
"networkProvider"
],
"roleDetails": "FastWeb provides wholesale services to service providers and dark fibre access to other network providers.",
"website": "https://www.example.com",
"logo": "https://www.example.com/logo.png"
}
],
"network": {
Expand Down Expand Up @@ -215,7 +228,20 @@
"networkProviders": [
{
"id": "GH-RGD-CS222222222",
"name": "FastWeb"
"name": "FastWeb",
"identifier": {
"id": "CS222222222",
"scheme": "GH-RGD",
"legalName": "FastWeb Ghana Limited",
"uri": "https://example.com/companies/CS222222222"
},
"country": "GH",
"roles": [
"networkProvider"
],
"roleDetails": "FastWeb provides wholesale services to service providers and dark fibre access to other network providers.",
"website": "https://www.example.com",
"logo": "https://www.example.com/logo.png"
}
],
"network": {
Expand Down
15 changes: 14 additions & 1 deletion examples/geojson/spans.geojson
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,20 @@
"networkProviders": [
{
"id": "GH-RGD-CS222222222",
"name": "FastWeb"
"name": "FastWeb",
"identifier": {
"id": "CS222222222",
"scheme": "GH-RGD",
"legalName": "FastWeb Ghana Limited",
"uri": "https://example.com/companies/CS222222222"
},
"country": "GH",
"roles": [
"networkProvider"
],
"roleDetails": "FastWeb provides wholesale services to service providers and dark fibre access to other network providers.",
"website": "https://www.example.com",
"logo": "https://www.example.com/logo.png"
}
],
"supplier": {
Expand Down
47 changes: 2 additions & 45 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,7 @@ def pre_commit():
truncation_length=9,
root_list_path='networks',
line_terminator='LF',
convert_wkt=True
)

# Update examples/csv/template
Expand All @@ -551,37 +552,9 @@ def pre_commit():
truncation_length=9,
no_deprecated_fields=True,
line_terminator='LF',
convert_wkt=True
)

# Use WKT geometry in CSV examples and templates. This code should be removed once Flatten Tool supports WKT
replacements = {
'examples/csv/nodes.csv': [
('nodes/0/location/type,nodes/0/location/coordinates','nodes/0/location'),
('Point,-0.174;5.625', 'POINT (-0.174 5.625)'),
('Point,-1.628;6.711', 'POINT (-1.628 6.711)')
],
'examples/csv/template/nodes.csv': [
('nodes/0/location/type,nodes/0/location/coordinates','nodes/0/location')
],
'examples/csv/spans.csv': [
('spans/0/route/type,spans/0/route/coordinates','spans/0/route'),
('LineString,"-0.173,5.626;-0.178,5.807;-0.112,5.971;-0.211,5.963;-0.321,6.17;-0.488,6.29;-0.56,6.421;-0.752,6.533;-0.867,6.607;-1.101,6.585;-1.304,6.623;-1.461,6.727;-1.628,6.713"', '"LINESTRING (-0.173 5.626,-0.178 5.807,-0.112 5.971,-0.211 5.963,-0.321 6.17,-0.488 6.29,-0.56 6.421,-0.752 6.533,-0.867 6.607,-1.101 6.585,-1.304 6.623,-1.461 6.727,-1.628 6.713)"')
],
'examples/csv/template/spans.csv': [
('spans/0/route/type,spans/0/route/coordinates','spans/0/route')
]
}

for key, value in replacements.items():
with open(key, 'r') as f:
content = f.read()

for replacement in value:
content = content.replace(replacement[0], replacement[1])

with open(key, 'w') as f:
f.write(content)

# Update docs/reference/publication_formats/csv.md
update_csv_docs(jsonref_schema)

Expand All @@ -594,22 +567,6 @@ def pre_commit():
# Update examples/geojson/nodes.geojson and examples/geojson/spans.geojson
subprocess.run(['libcoveofds', 'jsontogeojson', 'examples/json/network-package.json', 'examples/geojson/nodes.geojson', 'examples/geojson/spans.geojson'])

# Add `properties.featureType` field to GeoJSON examples. This code should be removed once libcoveofds supports this feature.
feature_collections = {
'examples/geojson/nodes.geojson': 'node',
'examples/geojson/spans.geojson': 'span'
}

for path, feature_type in feature_collections.items():
with open(path, 'r') as f:
feature_collection = json.load(f)

for feature in feature_collection['features']:
feature['properties']['featureType'] = feature_type

with open(path, 'w') as f:
json.dump(feature_collection, f, indent=4)

# Run mdformat
subprocess.run(['mdformat', 'docs'])

Expand Down
4 changes: 2 additions & 2 deletions requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ pyairtable
PyGithub
ocdskit>=1.1.3
sphinx-design
libcoveofds
flattentool>=0.20
libcoveofds>=0.8.2
flattentool>=0.22
pytest
jscc
mdformat
Expand Down
14 changes: 10 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ docutils==0.17.1
# sphinxcontrib-opendataservices-jsonschema
et-xmlfile==1.1.0
# via openpyxl
flattentool==0.20.0
flattentool==0.22.0
# via -r requirements.in
geojson==3.0.1
# via flattentool
idna==3.3
# via requests
ijson==3.1.4
Expand Down Expand Up @@ -85,7 +87,6 @@ jsonref==1.0.1
# -r requirements.in
# flattentool
# jscc
# libcoveofds
# ocdsextensionregistry
# ocdskit
# ocdsmerge
Expand All @@ -95,7 +96,7 @@ jsonschema==4.17.3
# -r requirements.in
# jscc
# libcoveofds
libcoveofds==0.5.0
libcoveofds==0.8.2
# via -r requirements.in
livereload==2.6.3
# via sphinx-autobuild
Expand All @@ -120,6 +121,8 @@ myst-parser==0.18.0
# sphinxcontrib-opencontracting
# sphinxcontrib-opendataservices
# sphinxcontrib-opendataservices-jsonschema
numpy==1.25.0
# via shapely
ocdsextensionregistry==0.1.13
# via
# ocdskit
Expand Down Expand Up @@ -169,7 +172,6 @@ pyyaml==6.0
requests==2.28.1
# via
# jscc
# libcoveofds
# ocdsextensionregistry
# ocdsmerge
# pyairtable
Expand All @@ -183,8 +185,12 @@ rfc3339-validator==0.1.4
# via jscc
rfc3986-validator==0.1.1
# via jscc
rfc3987==1.3.8
# via libcoveofds
schema==0.7.5
# via flattentool
shapely==2.0.1
# via flattentool
six==1.16.0
# via
# livereload
Expand Down

0 comments on commit 41addf3

Please sign in to comment.