Skip to content

Commit

Permalink
Merge pull request #174 from atlanticwave-sdx/add-iso3166_2_lvl4
Browse files Browse the repository at this point in the history
Add iso3166_2_lvl4
  • Loading branch information
congwang09 authored Feb 13, 2024
2 parents 3dfc08a + 8694647 commit 45c25be
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 14 deletions.
2 changes: 2 additions & 0 deletions src/sdx_pce/topology/grenmlconverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def add_nodes(self, nodes):
node.short_name,
longitude=location.longitude,
latitude=location.latitude,
iso3166_2_lvl4=location.iso3166_2_lvl4,
address=location.address,
)

Expand All @@ -54,6 +55,7 @@ def add_links(self, links):
node.short_name,
longitude=location.longitude,
latitude=location.latitude,
iso3166_2_lvl4=location.iso3166_2_lvl4,
address=location.address,
)
end_nodes.append(grenml_node)
Expand Down
12 changes: 8 additions & 4 deletions tests/data/sax-2.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"location": {
"address": "SaoPaulo",
"latitude": -46.650271781410524,
"longitude": -23.5311561958366
"longitude": -23.5311561958366,
"iso3166_2_lvl4": "BR-SP"
},
"ports": [
{
Expand Down Expand Up @@ -84,7 +85,8 @@
"location": {
"address": "PanamaCity",
"latitude": -79.4947050137491,
"longitude": 8.993040465928525
"longitude": 8.993040465928525,
"iso3166_2_lvl4": "US-PN"
},
"ports": [
{
Expand Down Expand Up @@ -149,7 +151,8 @@
"location": {
"address": "Fortaleza",
"latitude": -38.52443289673026,
"longitude": -3.73163824920348
"longitude": -3.73163824920348,
"iso3166_2_lvl4": "BR-FR"
},
"ports": [
{
Expand Down Expand Up @@ -201,7 +204,8 @@
"location": {
"address": "Santiago",
"latitude": -70.64634765264213,
"longitude": -33.4507049233331
"longitude": -33.4507049233331,
"iso3166_2_lvl4": "CL-SN"
},
"ports": [
{
Expand Down
30 changes: 20 additions & 10 deletions tests/data/sdx.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"location": {
"address": "Miami",
"latitude": -80.37676058477908,
"longitude": 25.75633040531146
"longitude": 25.75633040531146,
"iso3166_2_lvl4": "US-MIA"
},
"ports": [
{
Expand Down Expand Up @@ -71,7 +72,8 @@
"location": {
"address": "BocaRaton",
"latitude": -80.10225977485742,
"longitude": 26.381437356374075
"longitude": 26.381437356374075,
"iso3166_2_lvl4": "US-BC"
},
"ports": [
{
Expand Down Expand Up @@ -123,7 +125,8 @@
"location": {
"address": "redclara",
"latitude": -81.66666016473143,
"longitude": 30.34943181039702
"longitude": 30.34943181039702,
"iso3166_2_lvl4": "US-RC"
},
"ports": [
{
Expand Down Expand Up @@ -162,7 +165,8 @@
"location": {
"address": "SaoPaulo",
"latitude": -46.650271781410524,
"longitude": -23.5311561958366
"longitude": -23.5311561958366,
"iso3166_2_lvl4": "BR-SP"
},
"ports": [
{
Expand Down Expand Up @@ -227,7 +231,8 @@
"location": {
"address": "PanamaCity",
"latitude": -79.4947050137491,
"longitude": 8.993040465928525
"longitude": 8.993040465928525,
"iso3166_2_lvl4": "US-PN"
},
"ports": [
{
Expand Down Expand Up @@ -292,7 +297,8 @@
"location": {
"address": "Fortaleza",
"latitude": -38.52443289673026,
"longitude": -3.73163824920348
"longitude": -3.73163824920348,
"iso3166_2_lvl4": "BR-FR"
},
"ports": [
{
Expand Down Expand Up @@ -344,7 +350,8 @@
"location": {
"address": "Santiago",
"latitude": -70.64634765264213,
"longitude": -33.4507049233331
"longitude": -33.4507049233331,
"iso3166_2_lvl4": "CL-SN"
},
"ports": [
{
Expand Down Expand Up @@ -383,7 +390,8 @@
"location": {
"address": "Sangano",
"latitude": 13.216709879405311,
"longitude": -9.533459658700743
"longitude": -9.533459658700743,
"iso3166_2_lvl4": "IT-SN"
},
"ports": [
{
Expand Down Expand Up @@ -435,7 +443,8 @@
"location": {
"address": "CapeTown",
"latitude": -38.52443289673026,
"longitude": -3.73163824920348
"longitude": -3.73163824920348,
"iso3166_2_lvl4": "ZA-WC"
},
"ports": [
{
Expand Down Expand Up @@ -487,7 +496,8 @@
"location": {
"address": "Karoo",
"latitude": 22.541224555821298,
"longitude": -32.3632301851245
"longitude": -32.3632301851245,
"iso3166_2_lvl4": "ZA-KR"
},
"ports": [
{
Expand Down

0 comments on commit 45c25be

Please sign in to comment.