Commit Graph

1558 Commits

Author SHA1 Message Date
EstherLerouzic
537eb017b5 Add frequency range in default_edfa profile
This range is the property of amps and is independant from user propagation range.

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Ib89f1987910aa3121a3b8c859a0a785f7d5e27eb
2023-11-20 10:23:21 +01:00
EstherLerouzic
9c514e8086 Add a test on gain mode behaviour
This test checks that setting in gain mode forces amp to the gain settings
and ignores any power requirements. Change in SI in eqpt config and change
in req power (eg power sweep) should have no effect on the propagation.

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Iad826f30010fe3110d105b5206d99f502fbf98ff
2023-11-20 10:23:21 +01:00
EstherLerouzic
78efb6c650 Check element setting before and after propagation
In power mode, all elements design attributes should not change except
amplifiers' gain in case of power saturation.

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I2fec00232c80dd395e4dec20ec531c9c2e127760
2023-11-20 10:23:18 +01:00
EstherLerouzic
3510d59250 Correct design: apply saturation in all cases
Previously saturation was not checked during design if amp type was set.
This commit also applies saturation for these amplifiers.

This changes some of the autodesign result (since range for selection
is changed). For example, this changes some of the gains, or type variety
of amplifier of test files.

The commit also removes one of the rounding in the design phase, and
applies rounding only for printing purpose.

It also adds minor refactor on a function

In order to keep power sweep behaviour in case of saturation, the saturation
check in amplifier element uses initial power targets set by user instead
of a possible autodesign delta_p result.

Note that gain_mode is unchanged: design in gain mode means that delta_p
is set to None during the build process, even if the user defined a value
in operational.delta_p.

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Idc5cfc8263cf678473acb6ec490207d9d6ba5c0a
2023-11-20 10:21:38 +01:00
EstherLerouzic
41d9d156a6 Add more tests on amp saturation
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Ibba18bed646748d59cfe906b403a9b100c58bb7e
2023-11-20 10:21:35 +01:00
EstherLerouzic
e9d5e748e4 Add test in amplifier behaviour
Check that amp correctly applies saturation, when there is tilt.

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I3e7623e9d5b28bdc12eae24766588645781c2827
2023-11-20 10:21:06 +01:00
EstherLerouzic
5a5bed56c2 Add test on _check_one_request function
Add the call to the function, and creates additional test cases to raise the
different situations related to spectrum slots:
- M value too small
- total nb of channels too small
- overlapping

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I7ab3923deef2ff154ee1be21dcaeb3d9e4b84375
2023-11-17 16:26:12 +01:00
EstherLerouzic
22de1b1281 Add tests on aggregation
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I5409d847657fbe14f7963ff56546d0bedbf6c941
2023-11-17 16:26:12 +01:00
EstherLerouzic
73e1485b47 aggregate demands with defined mode and spectrum
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Id9fc2e0fe6f6ff5a3996700f6db7dfa6222dc3ca
2023-11-17 16:26:12 +01:00
EstherLerouzic
22ee05ea6f Add more tests for multiple slots spectrum assignment
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Id773f0f14cfe80b7ebcf07370170ad425faf0919
2023-11-17 16:23:48 +01:00
EstherLerouzic
31824f318d Enable multiple slots assignment
list of slot may include (N, M) values such as
(int, uint>0)
(int, None)
(None, uint>0)
(None, None)

Demands will be splitted into requested slots according to first fit strategy.
For example, if request is for 32 slots corresponding to 8 x 4slots 32Gbauds
channels, the following frequency slots will result in the following
assignments:
example 1
N = 0, 8,    16, 32           -> 0,   8,   16,   32
M = 8, None, 8,  None         -> 8,   8,    8,    8
example 2
N = 0,    8,    16, 32        -> 0,   , 16
M = None, None, 8,  None      -> 24,  , 8

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Ice9bb4b5700d23bcf30db25aa4882e74853169ac
2023-11-17 16:23:48 +01:00
EstherLerouzic
b0cb604e91 Remove old commented code
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Idd2fcca0fe757eb801ab575953828c6df0521bb4
2023-11-17 16:23:48 +01:00
EstherLerouzic
79102e283a Refactor function to simplify the process
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I362d23a969c338ccd70caecc4e59e991d2a8d8a2
2023-11-17 16:23:48 +01:00
EstherLerouzic
db5e63d51b Refactor spectrum selection function
Cut some functions into smaller pieces to be easily re-used afterwards.
This step to prepare multiple slots assignment.

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: If0fa2df7f6174e54405f92a57d60289d560c1166
2023-11-17 16:23:48 +01:00
EstherLerouzic
af42699133 Enable the loading of a bitmap
OMS are currently built with a brand new spectrum bitmap using f_min, f_max,
guard band and grid values. This changes enables to load an existing bitmap.

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: If0547bc337c863a3510ad9e43928e6f64701d295
2023-11-17 16:23:48 +01:00
EstherLerouzic
4ba77d0a0a Change rq.N and rq.M from scalar to list
Prepare for the next step, to be able to handle lists of candidate assignment

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I2bd78606ce4502f68efb60f85892df5f76d52bb5
2023-11-17 16:23:48 +01:00
EstherLerouzic
064d3af8e0 Remove line number from invocation logs
line numbers are useful for debugging, but the benefit does not
compensate for the painful update of lines in files at each commit
that changes line numbers.
So I have removed those lines only for the test_invocation logs case.

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Ic1f628d80b204a9a098f3902ebdfd10b480c7613
2023-11-17 11:56:06 +01:00
AndreaDAmico
4ab5bac45f EDFA Parameters restructuring
The parameters of the EDFA are explicitely retrieved in the EDFAParams class.
All the defaults are set instead in the gnpy.tool.json_io.AMP class.
Where required, the AMP.default_values are used instead of an empty dictionary.

Change-Id: Iba80a6a56bc89feb7e959b54b9bd424ec9b0bf06
Co-authored-by: Vittorio Gatto <vittoriogatto98@gmail.com>
2023-11-17 09:08:00 +01:00
AndreaDAmico
bbe5fb7821 Chromatic Dispersion scaling along frequency
The chromatic dispersion and dispersion slope can be provided as a single values evaluated at the fiber reference frequency or in a dictionary containing the dispersion values evaluated at multiple frequencies:
"dispersion": {"value": [], "frequency": []}

Change-Id: I81429484dd373cc49bd9baf013247782ba1912fd
2023-11-17 09:04:44 +01:00
AndreaDAmico
edf1eec072 Nonlinear coefficient scaling along frequency
The nonlinear coefficient can be expressed at the reference frequency and will be scaled in frequency using the scaling rule of the effective area

Change-Id: Id103b227472702776bda17ab0a2a120ecfbf7473
2023-11-17 08:53:58 +01:00
AndreaDAmico
88ac41f721 Seprating the eta matrix evaluation in compute nli
The evaluation of the eta matrix is reintroduced for nli evaluation and validation purposes. Also, the parameters for cut and pump are separated explicitelly.

Change-Id: Id3844fa8ba41a5d4f5a72d281d758136ee983f45
2023-11-17 08:51:35 +01:00
AndreaDAmico
c20e6fb320 Effective Area and Raman Gain Coefficient Scaling
1. Effective area scaling along frequency is implemented by means of a technological model.
2. Raman gain coefficient is extended coherently, including the scaling due to the pump frequency.

Change-Id: I4e8b79697500ef0f73ba2f969713d9bdb3e9949c
Co-authored-by: Giacomo Borraccini <giacomo.borraccini@polito.it>
2023-11-17 08:51:26 +01:00
Jan Kundrát
05500c7047 CI: run tests on Apple M1 CPUs as well (64bit ARM)
Note that on GitHub, this currently targets a "runner" that's behind a
paywall. TIP does have a payment setup in place AFAICT, so we make sure
that this job does not run on forks.

Change-Id: I50c556424d86a1ce47e59911b9e39f336df34ce5
2023-11-15 20:37:26 +01:00
Jan Kundrát
86a39f4b5e packaging: mark Python 3.12 as supported
Change-Id: If3c8ea7d5a7651b71379a71e5dfde6b464aa5b4a
2023-11-15 20:06:55 +01:00
Jan Kundrát
2b25609255 CI: test on Python 3.12 and some new platforms
Change-Id: Ice5c3ca21245c4ac87cb2bf4f0fd062596615a2e
2023-11-15 20:06:55 +01:00
Jan Kundrát
7e0b95bcfd Bump all dependencies
Change-Id: Id08b7722880b992b1bb70f53ad243d4f40ffe387
2023-11-15 20:06:54 +01:00
Jan Kundrát
f0a52dcc8a tests: upgrade pandas
There are no binary wheels for Python 3.12 prior to pandas v2.1.1. Our
previous pin requested the 1.x branch, and that resulted in building
Pandas from source, which takes time. We cannot pin to 2.1.1 because
they removed support of Python 3.8 in 2.1, so 2.0.3 it is.

Change-Id: Ia9a567e54f4dda19a0a6b67d0c295a9a079892de
2023-11-15 20:05:54 +01:00
EstherLerouzic
3bea4b3c9f Feat: improve sanity check for eqpt sheet
add cases of wrong sheets that were not captured and
generate errors later in propagation:
- if the eqpt line is duplicated
- if the eqpt contains a link that is not present in Links sheet,
  but Nodes are OK
- if the same link is defined but with opposite directions
- if the ila is defined twice with opposite directions
- if the service type or mode are not in the library

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I4715886e19f07380bf02ed0e664559972bb39b71
2023-11-02 10:14:03 +01:00
EstherLerouzic
f2cc9f7225 Add more logs
and test them

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I05ffc3a75354fa8d8f3a668973ab7f4cbcfa1a98
2023-11-02 10:01:38 +01:00
Esther Le Rouzic
e79f9f51b6 Merge "Feat: add offset power option for transceivers" 2023-10-31 08:30:13 +00:00
Esther Le Rouzic
7fd7f94efe Merge "Refactor error message" 2023-10-31 08:29:58 +00:00
Esther Le Rouzic
0acdf9d9f6 Merge "docs: rename the Matrix channel" 2023-10-27 15:09:16 +00:00
EstherLerouzic
a3edb20142 Feat: add offset power option for transceivers
Offset power is used for equalization purpose to correct for the
generic equalization target set in ROADM for this particular transceiver.
This is usefull to handle exception to the general equalization rule.
For example in the case of constant power equalization, the user might
want to apply particular power offsets unrelated to slot width or baudrate.
or in constant PSW, the user might want to have a given mode equalized for
a different value than the one computed based on the request bandwidth.

For example consider that a transceiver mode is meant to be equalized with
75 GHz whatever the spacing specified in request. then the user may specify
2 flavours depending on used spacing:

  service 1 : mode 3, spacing 75GHz
  service 2 : mode 4, spacing 87.5Ghz
avec
  {
    "format": "mode 3",
    "baud_rate": 64e9,
    "OSNR": 18,
    "bit_rate": 200e9,
    "roll_off": 0.15,
    "tx_osnr": 40,
    "min_spacing": 75e9,
    "cost": 1
  }

  {
    "format": "mode 4",
    "baud_rate": 64e9,
    "OSNR": 18,
    "bit_rate": 200e9,
    "roll_off": 0.15,
    "tx_osnr": 40,
    "min_spacing": 87.5e9,
    "equalization_offset_db": -0.67,
    "cost": 1
  }

then the same target power would be considered for mode3 and mode4
despite using a different slot width

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I437f75c42f257b88b24207260ef9ec9b1ab7066e
2023-10-24 13:20:00 +02:00
EstherLerouzic
33cc11b85c Refactor error message
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Ie8fc6bedcdbce26e2e80759c6c56d2c7429bf560
2023-10-24 13:20:00 +02:00
Jan Kundrát
5d079ab261 docs: rename the Matrix channel
It seems that the Matrix server at `foss.wtf` disappeared some time ago
with no details posted anywhere. I've marked the long-existing channel
alias `#oopt-gnpy:matrix.org` as the primary one, so let's adjust the
docs so that new people can actually join this channel.

This should have no consequences on people who have already joined.

Change-Id: Idee9c050ff5cb1c3926e5d4cf751002ad1541e71
2023-10-03 01:50:11 +02:00
AndreaDAmico
a3b1157e38 Fiber latency calculation
Fiber latency evaluated during propagation. The speed of ligth in fiber is evaluated as the vacuum speed of ligth  divided by the core reflective index n1.
The latency in the transceiver is evaluated in ms.

Change-Id: I7a3638c49f346aecaf1d4897cecf96d345fdb26c
2023-08-07 18:29:03 +02:00
AndreaDAmico
70731b64d6 fix: include position of lumped losses in Raman profile
In the previous version, the position of the lumped losses were not
included in the result Raman profile. As the latter is then used to
evaluate the NLI, including the lumped loss positions is required for
accurate estimations.

Change-Id: I683f48ceb7139d1a8be03d2e7ca7e3abffecbe85
2023-07-24 17:13:15 +02:00
AndreaDAmico
4ea0180caf tests: prefer pandas.read_csv over numpy.genfromtext
Change-Id: Icc9618afc4cad0c7a07f3a785c99b6b438e0c6cc
2023-07-24 17:12:25 +02:00
AndreaDAmico
eb2363a3d4 Fix: lumped losses included in total fiber loss
In previous version, the lumped losses where not included in the fiber loss, creating an inaccurate overall power balance.

Change-Id: I98a4d37b9cc0526218fe3c6f2b9318b6fa797901
2023-07-06 15:19:07 +02:00
EstherLerouzic
41b94cc888 fix: don't crash if PMD, PDL or CD penalties are missing in transceivers
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Iafc248af3ecfcd4da4c1135fd3a37da796cdfb5f
2023-05-09 10:11:26 +02:00
Jan Kundrát
1eeb6a0583 Merge changes Icd0b4fbd,I3ca81bcd,Ia33315f0
* changes:
  docs: docstring formatting
  SimParams: less boilerplate
  python: prefer isinstance(foo, Bar) over type(foo) == Bar
2023-04-18 23:01:30 +00:00
Jan Kundrát
215c20e245 Merge "fix: add missing PSW case for power computation" 2023-04-18 00:41:45 +00:00
Jan Kundrát
76e9146043 docs: docstring formatting
Let's use the pythonic indenting, quoting and structure in general as
specified in PEP 0257.

Change-Id: Icd0b4fbd94dabd9a163ae3f6887b236e76c486ab
2023-04-18 01:34:19 +02:00
Jan Kundrát
2a07eec966 SimParams: less boilerplate
The code look as if it was trying to prevent direct instantiation of the
SimParams class. However, instance *creation* in Python is actually
handled via `__new__` which was not overridden. In addition, the
`get()` accessor was invoking `SimParams.__new__()` directly, which
meant that this class was instantiated each time it was needed.

Let's cut the boilerplate by getting rid of the extra step and just use
the regular constructor.

This patch doesn't change anything in actual observable behavior. I
still do not like this implicit singleton design pattern, but nuking
that will have to wait until some other time.

Change-Id: I3ca81bcd0042e91b4f6b7581879922611f18febe
2023-04-17 23:06:31 +02:00
Jan Kundrát
cc994bf118 python: prefer isinstance(foo, Bar) over type(foo) == Bar
Use of isinstance() is more Python and it also allows inheritance to
work properly.

Change-Id: Ia33315f0e3faf6638334bec85d0fa92ea8ac81f0
2023-04-17 23:02:51 +02:00
EstherLerouzic
37e70e622c fix: add missing PSW case for power computation
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I5fa9135cdde1735ec142bc88d8fdf0aa03b13a41
2023-04-13 16:48:21 +02:00
Florian FRANK
7d9a508955 Fix 2 minor typos in docs/model.rst
Signed-off-by: Florian FRANK <florian1.frank@orange.com>
Change-Id: Ic2160f554b120b011c941aca36b69a0f032cf45f
2023-04-13 09:33:19 +02:00
Florian FRANK
185adabd77 Fix bug of comparison dimension when Raman is allowed and loss_coef is a vector instead of a scalar
Signed-off-by: Florian FRANK <florian1.frank@orange.com>
Change-Id: I0b39d102b9200ec25ed62e6f53b1e0addcc66f67
2023-04-11 17:30:24 +02:00
Jan Kundrát
8f9cf8ccc7 docs: sync the author list from git history
I don't have a script for this because it requires some manual fixups.

Change-Id: I19f36b953c98d6bc0c09040c27b964b288360c0e
v2.7
2023-03-06 01:31:41 +01:00
Sami Alavi
0c797a254c simplify type annotations
PEP 484 says that `float` also implicitly allows `int`, so there's no
need to use `Union[int | float]`.

Fixes: #450
Change-Id: Ib1aeda4c13ffabd47719c1e0886e9ebcf21a64e0
2023-03-03 21:12:57 +05:00