That class is an internal implementation detail, so mark it with a
leading underscore as per Python idioms.
Also, tweak the docs so that there's less duplicate information and
more cross-references.
Change-Id: Ieb1c8034ab5b442032396d7c4bbd0a697c7eb492
This mainly reverts some auto-fix-ups done in
I2f0fca5aa1314f9bb546a3e6dc712a42580cd562 which do not make that much
sense. By reverting them by hand, it's (hopefully) easy to see what is
just a tool work and what is an opinionated preference.
Change-Id: I6cb479e34b552fadc85c41b4b06b24e60c87b4a3
It always seemed like a strange restriction to not allow this.
Change-Id: Ice3ed3ecc08f42b6ef8b74d4a6bc3b1794ff078a
Signed-off-by: Jonas Mårtensson <jonas.martensson@ri.se>
Currently interpolation of nf_ripple or gain_ripple fails if the length
of the input list is different from the dgt input list since the amplier
frequencies used for interpolation are calculated based on the length of
the dgt input list. There seems to be no good reason for this restriction
so I propose to calculate amplifier frequencies separately for the
different inputs. This also allows to specify a flat ripple with just one
number and a flat dgt with two numbers.
Change-Id: Ia8c8d734c7045062ce123360f4a1432490384118
Signed-off-by: Jonas Mårtensson <jonas.martensson@ri.se>
Currently the string representation of some elements in elements.py refer to parameters that are not assigned until the propagate function runs.
Printing an element or trying to access its string representation before propagation therefore raises a TypeError.
This patch should fix the issue.
Change-Id: I29962f3c00e1f4fb7935535d4514a9579bc0c918
Signed-off-by: Jonas Mårtensson <jonas.martensson@ri.se>
This might have nothing to do with the ITU frequency grid (it's really
just about a uniform distribution), so let's give it a more readable
name and more readable parameters.
Both of these places referred to "eq. 123 from arXiv:1209.0394", the
only difference (apart from the source of the input parameters, beta2
and asymptotic_length) was calling the two branches "SCI" and "XCI" vs.
"SPM" and "XPM".
In this commit I've only moved the code to a single implementation. The
input data are still being read from the same parameters, of course.
For some reason, the code allowed using "convenience names" for
accessing properties since commit 58ac717f. To me, this looks like an
obvious anti-pattern because accessing a single property via three
different names only makes the code less readable. Let's kill this
"feature".
In case of the `Power` class, the code used "ase" and "nli" on the
majority of places, so let's use these abbreviations instead of their
spelt-out variants.
SpectralInformation was "clean" already, but there were calls to the
`update()` wrapper around the `namedtuple._replace`. Given that there
were no property aliases, it's safe to just call `_replace()` directly.
In case of the `Pref` class, once again always use `p_span0`, `p_spani`
instead of `p0` and `pi` -- it's a trivial change.
Rather than do the None-dance and document the default value within a
docstring, let's use the default value directly. This is safe because
numbers are immutable.
Because default arguments are evaluated *once*, not every time they are
called, a mutable default value is not "reset", and this happens:
>>> from gnpy.core.node import Node
>>> x=Node('123')
>>> y=Node('456')
>>> print(x.metadata)
{'location': Location(latitude=0, longitude=0, city=None, region=None)}
>>> print(y.metadata)
{'location': Location(latitude=0, longitude=0, city=None, region=None)}
>>> y.metadata['foo']=123
>>> print(x.metadata)
{'location': Location(latitude=0, longitude=0, city=None, region=None), 'foo': 123}
This is easily fixable by using an immutable value as a placeholder
here.
This feature is intended to support designs such as OpenROADM where the
line degree integrates a specific preamp/booster pair. In that case, it
does not make sense for our autodesign to "pick an amplifier". The
restrictions can be activated by:
- Listing them in `eqpt_config.json`, so that they are effective for all
ROADM instances.
- On a per-ROADM basis within the Excel sheet or the JSON definitions.
Restrictions apply to an entire ROADM as a whole, not to the individual
degrees.
If a per-degree exception is needed, the amplifier of this degree can be
defined in the equipment sheet or in the network definition.
If no booster amplifier should be placed on a degree, use the `Fused`
node in place of an amplifier.
Signed-off-by: Esther Le Rouzic <esther.lerouzic@orange.com>
Co-authored-by: Jan Kundrát <jan.kundrat@telecominfraproject.com>
While the `itufl()` function uses THz by default, its values depend on
the frequency range that is passed via arguments. In this context, the
f_min and f_max come from the default SpectralInformation which is in
Hz.
Thanks to @ojnas for reporting this.
fixes#243
exception KeyError type in service sheet not correctly catched
print Request.mode instead of Requestmode (not defined at this point)
selection of modes did not respect min spacing criterium:
constraint added
transmission_main did not give SNR in 0.1 nm: added in std out
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
-add f_min & f_max frequency definition in amplifier json
-improve interpolation algorithm to support length differences between the spectrum information and the amplifier ripple and dgt frequency definition
Signed-off-by: Jean-Luc Auge <jeanluc.auge@orange.com>
set individual channel powers wrto the target reference power
tilt and ripple is eliminated after the Roadm
Signed-off-by: Jean-Luc Auge <jeanluc.auge@orange.com>
power mode no longer reads operational_gain:
now reads operational.dp_db
or calculate optimum dp_db from next span loss
gain_mode:
reads operational.gain_target
or use gain_from_dp
Signed-off-by: Jean-Luc Auge <jeanluc.auge@orange.com>
squash to dp
Signed-off-by: Jean-Luc Auge <jeanluc.auge@orange.com>
support min gain for raman auto-design:
raman amplification is only considered for a span if its gain > specified
min gain of the raman hybrid in eqpt_config
auto-design was checked succesfully when enabling a mix of 6 possible different
amplifiers: low gain, medium gain, hybrid ramans, high power and high
gain amplifiers. They were picked as expected.
Signed-off-by: Jean-Luc Auge <jeanluc.auge@orange.com>