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 Apr 25, 2024
1 parent be7ae35 commit d257eac
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 @@ -273,9 +273,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 @@ -299,6 +300,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 d257eac

Please sign in to comment.