Skip to content

Commit

Permalink
space align __str__ output
Browse files Browse the repository at this point in the history
  • Loading branch information
dutc committed Mar 21, 2018
1 parent c9ece6a commit 898aa4f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions gnpy/core/elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ def __str__(self):
osnr_ase_01nm = round(np.mean(self.osnr_ase_01nm), 2)

return '\n'.join([f'{type(self).__name__} {self.uid}',
f' OSNR ASE (1nm): {np.mean(self.osnr_ase_01nm):.2f}',
f' OSNR ASE (signal bw): {np.mean(self.osnr_ase):.2f}',
f' OSNR ASE (1nm): {np.mean(self.osnr_ase_01nm):.2f}',
f' OSNR ASE (signal bw): {np.mean(self.osnr_ase):.2f}',
f' SNR total (signal bw): {np.mean(snr):.2f}'])

def __call__(self, spectral_info):
Expand All @@ -85,7 +85,7 @@ def __repr__(self):

def __str__(self):
return '\n'.join([f'{type(self).__name__} {self.uid}',
f' loss: {self.loss:.2f}'])
f' loss (dB): {self.loss:.2f}'])

def propagate(self, *carriers):
attenuation = db2lin(self.loss)
Expand Down Expand Up @@ -118,8 +118,8 @@ def __repr__(self):

def __str__(self):
return '\n'.join([f'{type(self).__name__} {self.uid}',
f' length: {self.length:.2f}',
f' loss: {self.loss:.2f}'])
f' length (m): {self.length:.2f}',
f' loss (dB): {self.loss:.2f}'])

def lin_attenuation(self):
attenuation = self.length * self.loss_coef
Expand Down Expand Up @@ -246,10 +246,10 @@ def __str__(self):
return f'{type(self).__name__} {self.uid}'

return '\n'.join([f'{type(self).__name__} {self.uid}',
f' gain (dB): {self.operational.gain_target:.2f}',
f' gain (dB): {self.operational.gain_target:.2f}',
f' noise figure (dB): {np.mean(self.nf):.2f}',
f' Power In (dBm): {self.pin_db:.2f}',
f' Power Out (dBm): {self.pout_db:.2f}'])
f' Power In (dBm): {self.pin_db:.2f}',
f' Power Out (dBm): {self.pout_db:.2f}'])

def interpol_params(self, frequencies, pin, baud_rates):
"""interpolate SI channel frequencies with the edfa dgt and gain_ripple frquencies from json
Expand Down

0 comments on commit 898aa4f

Please sign in to comment.