Skip to content

Commit

Permalink
Feat: Enable multiple type_varieties for ROADM
Browse files Browse the repository at this point in the history
if no type variety name is provided in eqpt_config, the 'default' name is
used (backward compatibility with libraries).

Without any type variety defined in ROADM element in topology,
the default one is used (backward compatibility with topologies).

Roadm elements include a type_variety attribute in the to_json and display.

Signed-off-by: EstherLerouzic <[email protected]>
Change-Id: I61a2491f994e47ad0b08cf8eaef30d6d855aa706
  • Loading branch information
EstherLerouzic committed Mar 15, 2024
1 parent 4fee21e commit cefd1fe
Show file tree
Hide file tree
Showing 23 changed files with 537 additions and 313 deletions.
4 changes: 3 additions & 1 deletion gnpy/core/elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,10 @@ def to_json(self):
to_json = {
'uid': self.uid,
'type': type(self).__name__,
'type_variety': self.type_variety,
'params': {
equalisation: value,
'restrictions': self.restrictions,
'restrictions': self.restrictions
},
'metadata': {
'location': self.metadata['location']._asdict()
Expand All @@ -300,6 +301,7 @@ def __str__(self):

total_pch = pretty_summary_print(per_label_average(self.pch_out_dbm, self.propagated_labels))
return '\n'.join([f'{type(self).__name__} {self.uid}',
f' type_variety: {self.type_variety}',
f' effective loss (dB): {self.ref_effective_loss:.2f}',
f' reference pch out (dBm): {self.ref_pch_out_dbm:.2f}',
f' actual pch out (dBm): {total_pch}'])
Expand Down
Loading

0 comments on commit cefd1fe

Please sign in to comment.