Skip to content

Commit

Permalink
fix: do not assume 0 dB default value for tilt-target
Browse files Browse the repository at this point in the history
Instead keep the None value, it user has not stated anything

Signed-off-by: EstherLerouzic <[email protected]>
Change-Id: I45fcff92caabbfbe514fbe30deac60426b7eb16b
  • Loading branch information
EstherLerouzic committed Nov 27, 2024
1 parent 91850bd commit f833457
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 90 deletions.
3 changes: 2 additions & 1 deletion gnpy/core/elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,8 @@ def __str__(self):
f' type_variety: {self.params.type_variety}',
f' effective gain(dB): {self.effective_gain:.2f}',
' (before att_in and before output VOA)',
f' tilt-target(dB) {self.tilt_target:.2f}',
f' tilt-target(dB) {self.tilt_target if self.tilt_target else 0:.2f}',
# avoids -0.00 value for tilt_target
f' noise figure (dB): {nf:.2f}',
f' (including att_in)',
f' pad att_in (dB): {self.att_in:.2f}',
Expand Down
6 changes: 3 additions & 3 deletions gnpy/tools/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def update_attr(self, kwargs):
'east_amp_type': '',
'east_amp_gain': None,
'east_amp_dp': None,
'east_tilt_vs_wavelength': 0,
'east_tilt_vs_wavelength': None,
'east_att_out': None
}

Expand Down Expand Up @@ -518,7 +518,7 @@ def xls_to_json_data(input_filename: Path, filter_region: List[str] = None) -> D
'longitude': x.longitude}},
'type': 'Edfa',
'operational': {'gain_target': None,
'tilt_target': 0}
'tilt_target': None}
} for x in nodes_by_city.values() if x.node_type.lower() == 'ila' and x.city not in eqpts_by_city] +
[{'uid': f'east edfa in {x.city}',
'metadata': {'location': {'city': x.city,
Expand All @@ -527,7 +527,7 @@ def xls_to_json_data(input_filename: Path, filter_region: List[str] = None) -> D
'longitude': x.longitude}},
'type': 'Edfa',
'operational': {'gain_target': None,
'tilt_target': 0}
'tilt_target': None}
} for x in nodes_by_city.values() if x.node_type.lower() == 'ila' and x.city not in eqpts_by_city]
+ [create_east_eqpt_element(e, nodes_by_city) for e in eqpts]
+ [create_west_eqpt_element(e, nodes_by_city) for e in eqpts],
Expand Down
42 changes: 21 additions & 21 deletions tests/data/perdegreemeshTopologyExampleV2_expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@
"type": "Edfa",
"operational": {
"gain_target": null,
"tilt_target": 0
"tilt_target": null
}
},
{
Expand All @@ -682,7 +682,7 @@
"type": "Edfa",
"operational": {
"gain_target": null,
"tilt_target": 0
"tilt_target": null
}
},
{
Expand All @@ -698,7 +698,7 @@
"type": "Edfa",
"operational": {
"gain_target": null,
"tilt_target": 0
"tilt_target": null
}
},
{
Expand All @@ -714,7 +714,7 @@
"type": "Edfa",
"operational": {
"gain_target": null,
"tilt_target": 0
"tilt_target": null
}
},
{
Expand All @@ -732,7 +732,7 @@
"operational": {
"gain_target": 20.0,
"delta_p": null,
"tilt_target": 0,
"tilt_target": null,
"out_voa": null
}
},
Expand Down Expand Up @@ -766,7 +766,7 @@
"operational": {
"gain_target": null,
"delta_p": null,
"tilt_target": 0,
"tilt_target": null,
"out_voa": null
}
},
Expand All @@ -784,7 +784,7 @@
"operational": {
"gain_target": null,
"delta_p": null,
"tilt_target": 0,
"tilt_target": null,
"out_voa": null
}
},
Expand All @@ -802,7 +802,7 @@
"operational": {
"gain_target": null,
"delta_p": null,
"tilt_target": 0,
"tilt_target": null,
"out_voa": null
}
},
Expand All @@ -820,7 +820,7 @@
"operational": {
"gain_target": null,
"delta_p": null,
"tilt_target": 0,
"tilt_target": null,
"out_voa": null
}
},
Expand All @@ -838,7 +838,7 @@
"operational": {
"gain_target": null,
"delta_p": null,
"tilt_target": 0,
"tilt_target": null,
"out_voa": null
}
},
Expand All @@ -856,7 +856,7 @@
"operational": {
"gain_target": null,
"delta_p": null,
"tilt_target": 0,
"tilt_target": null,
"out_voa": null
}
},
Expand All @@ -874,7 +874,7 @@
"operational": {
"gain_target": null,
"delta_p": null,
"tilt_target": 0,
"tilt_target": null,
"out_voa": null
}
},
Expand All @@ -892,7 +892,7 @@
"operational": {
"gain_target": null,
"delta_p": null,
"tilt_target": 0,
"tilt_target": null,
"out_voa": null
}
},
Expand All @@ -910,7 +910,7 @@
"operational": {
"gain_target": null,
"delta_p": null,
"tilt_target": 0,
"tilt_target": null,
"out_voa": null
}
},
Expand All @@ -928,7 +928,7 @@
"operational": {
"gain_target": null,
"delta_p": null,
"tilt_target": 0,
"tilt_target": null,
"out_voa": null
}
},
Expand All @@ -946,7 +946,7 @@
"operational": {
"gain_target": null,
"delta_p": null,
"tilt_target": 0,
"tilt_target": null,
"out_voa": null
}
},
Expand All @@ -964,7 +964,7 @@
"operational": {
"gain_target": null,
"delta_p": null,
"tilt_target": 0,
"tilt_target": null,
"out_voa": null
}
},
Expand All @@ -983,7 +983,7 @@
"operational": {
"gain_target": 18.0,
"delta_p": null,
"tilt_target": 0,
"tilt_target": null,
"out_voa": null
}
},
Expand All @@ -1001,7 +1001,7 @@
"operational": {
"gain_target": null,
"delta_p": null,
"tilt_target": 0,
"tilt_target": null,
"out_voa": null
}
},
Expand All @@ -1019,7 +1019,7 @@
"operational": {
"gain_target": null,
"delta_p": null,
"tilt_target": 0,
"tilt_target": null,
"out_voa": null
}
},
Expand All @@ -1037,7 +1037,7 @@
"operational": {
"gain_target": null,
"delta_p": null,
"tilt_target": 0,
"tilt_target": null,
"out_voa": null
}
}
Expand Down
Loading

0 comments on commit f833457

Please sign in to comment.