29 Commits

Author SHA1 Message Date
EstherLerouzic
f2039fbe1c fix: use loaded json instead of Path for extra configs
In order to be used by API.

Co-authored-by: Renato Ambrosone <renato.ambrosone@polito.it>

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I12111427c8a90b85b3158cdd95f4ee771cb39316
2025-09-26 11:17:45 +02:00
EstherLerouzic
56e615c713 Feat: Use a reference channel per OMS instead of total power for design
Correctly uses the oms band and spacing for computing the nb of channel
and total power for design per band.
In order to keep the SI values as reference, introduce a new parameter
in SI to indicate wether to use this feature or not.

If "use_si_channel_count_for_design": true, then the f_min, f_max and spacing
from SI are used for all OMSes
else, the f_min, f_max, spacing defined per OMS (design_bands) is used.

This impacts tests where the artificial C-band boudaries were hardcoded, and
it also has an impact on performances when SI's defined nb of channels is larger
than the one defined per OMS. In this case the design was considering a larger
total power than the one finally propagated which resulted in reduced performance.
This feature now corrects this case (if "use_si_channel_count_for_design": false
which is the default setting). Overall autodesign are thus improved.

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I471a2c45200894ca354c90b46b662f42414b48ad

tous les test marche et les jeu de tests aussi.

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: If25b47aa10f97301fde7f17daa2a9478aed46db2
2025-09-03 10:34:15 +02:00
EstherLerouzic
7a1b15a916 chore: make sure all python files have the correct header
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Ifdd6a566fda74c5b7d417f9d61c51d4d3da07bfd
2025-06-11 15:05:51 +02:00
EstherLerouzic
4fda8c6002 use explicit file arguments for additional configs
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I133bb6a2d21d573cf819e1d92b1912dfa87dbfa4
2025-01-30 17:23:18 +01:00
EstherLerouzic
38cc0e3cc5 feat: separate span power from tx power
gnpy currently uses the same parameter for tx output power and span
input power: this prevents from modelling low tx power effect.
This patch introduces a new tx-cannel-power and uses it to
propagate in ROADM.

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Id3ac75e2cb617b513bdb38b51a52e05d15af46f5
2024-06-02 19:26:33 +02:00
EstherLerouzic
fb70413784 Refactor equipment and add some tests
This fixes error message for wrong trx type,  catches the case of
KeyError when trx_type is not part of the library.

removes power setting from this function: power out of transceiver or
at the input of span is nor defined in equipment Transceiver

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I15fa7cc772ab5c1a8c7637738eb83c2ddffa1219
2024-06-02 19:26:33 +02: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
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
EstherLerouzic
7f7c568160 Enabling the reading of N and M value from the json request
For this commit only the first element from the {N, M} list is read
and assigned.

This is better than not reading this value at all.

the commit also updates test_files and test data files with correct
values for the effective_freq_slot attribute

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I1e60fe833ca1092b40de27c8cbfb13083810414e
2021-08-31 11:31:07 +02:00
EstherLerouzic
d25e98c567 adding another set of test for disjunction
Previous set of tests did not correctly check the combinations of
disjunction and route constraint. This new set tests specific cases
with several demands in one synchronization vector with and without
route constraint, and the case where both disjunction constraint and
route can not be met (STRICT and LOOSE cases)

+ minor refactor on test_disjunction

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Id5a5902e6945185922ce5743ac97d15dbc777af2
2021-08-02 18:02:14 +02:00
Jan Kundrát
c5c5b693f2 tests: remove something which looks like a path, but is not a valid path
As I'm moving the top-level directory `examples/` to another place, I
wanted to clear the source of any mentions of examples which are not
actually valid paths.

Change-Id: If6cce20feacfbbb79549e865d06aa00fd2dcd08d
2020-06-08 18:28:59 +02:00
Jan Kundrát
7da4ec08d8 reorganization: move JSON-specific bits from path_requests_run to tools.json_io
Change-Id: I03cf4e298300387ee5d56251e2e552e111b59f65
2020-05-23 21:28:06 +02:00
Jan Kundrát
648039521e reorganization: move all JSON processing into an extra module
We agreed that `gnpy.core` should only contain stuff for propagating
wavelengths. Conceptually, JSON parsing and even instantiating these
network elements from data obtained through JSON is *not* something that
is on the same level -- and this will become more important when we move
into YANG format in future.

Also, instead of former `gnpy.core.equipment.common`, use
`gnpy.tools.json_io._JsonThing`. It is not really an awesome name :),
but I think it sucks less than a thing called "common" which would be no
really longer any "common" in that new file.

Change-Id: Ifd85ea4423d418c14c8fae3d5054c5cb5638d283
2020-05-23 20:44:47 +02:00
Jan Kundrát
01c566a325 reorganization: gnpy/{core => topology}/spectrum_assignment.py
Change-Id: Ic6194ce639dcb2f9419372febe0f2b58473edb38
2020-05-23 15:05:42 +02:00
Jan Kundrát
0823f8de46 Move automatic_nch, automatic_fmax into utils
I think that gnpy/core/equipment.py should contain only stuff which
prepares the equipment_config, not anything "lower level" that is reused
from other places.

Change-Id: I0cd593fd3e5558178ddd0ad8fff5c596e022894a
2020-05-23 13:08:24 +02:00
Jan Kundrát
3548ed74e2 coding style: autopep --in-place --recursive --jobs 4 --max-line-length 120 gnpy/ tests/
Change-Id: I2f0fca5aa1314f9bb546a3e6dc712a42580cd562
2020-05-19 12:40:00 +02:00
Jan Kundrát
145653df6e reorganization: gnpy/{core => topology}/request.py
Change-Id: Ib399549479b56634c681930aa444b657e5f58ca7
2020-05-19 11:56:02 +02:00
Jan Kundrát
63a6256b5e pep8: rename classes to use CamelCase
Change-Id: Ia696e05b72f1bc5feb570996f492042dafab262d
2020-05-19 11:54:27 +02:00
EstherLerouzic
de58d7d7c2 Enable ILA and FUSED type in routing constraints with xls input
- builds correspondance dicts between input name from excel
  and names created with convert.py and autodesign in network.py
- correct the corresp_name dicts according to the effective
  network autodesign. This supports the case of fiber splitting
  and of fused elements
- include the case of parrallel links with only one hop
- interpret the node list constraint given by the user with the dict
- filter the constraints that are not applicable
- add tests for constraints
- correct equipment sheet of mesh_example_topologyv2.xls: morlaix and
  loudeac should not appear in node A column since they are fused

ILA and FUSED constraints must be filled with the next node
information in order to avoid confusion on the direction.
for example
     eg    a----b-----c
           |    |     |
           i    j     k
           |    |     |
           e----f-----g

a constraint 'j' given for service i to k leads to 2 possible direction:
i-a-b-j-f-g-k
i-e-f-j-b-c-k
the user must indicate the chossen direction. This ambiguity does not
exist with network input in json format (names are unique).

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Ia7cf2026e569c8b566459791fc89546b91fb117c
2020-04-23 11:15:37 +02:00
EstherLerouzic
d56c91ca7f small linter fixes
(Jan: cherry-picked relevant parts of c6be21f36f)

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Ib84f452a15a20a88ea186ceef64712eb967d46a7
2020-03-24 12:07:33 +01:00
EstherLerouzic
25819fadf5 refactor test and add test on constraints
(Jan: cherry-picked relevant changes from commit
44e8936f04d6eb334cea2e5643d8ddceb6a0a5a8)

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Signed-off-by: Jan Kundrát <jan.kundrat@telecominfraproject.com>
Change-Id: Ibeeaa42b35e23075618c8543a857f47fac48df27
2020-03-24 12:05:56 +01:00
EstherLerouzic
c577a75725 second set of modification due to codacy report
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
2019-10-10 09:02:19 +01:00
EstherLerouzic
edb54b02ac Another time improving formatting (codacy report)
removing unused import
change short variable names to conform to [a-z_][a-z0-9_]{2,30}$
change main variable names to conform to [A-Z_][A-Z0-9_]{2,30}$
add or remove spaces
add docstrings
correct comments and indents of cut lines

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
2019-10-10 09:02:02 +01:00
EstherLerouzic
921e8d2d3c Call build_oms_list in test_disjunction
Call bbuild_oms_list in the test to correctly build all attributes
of network elements

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
2019-10-09 19:17:35 +01:00
EstherLerouzic
c009d28f7d Update test_disjunction and test_automaticmodefeature
Add bidir argument on load_requests calls

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
2019-10-09 19:17:35 +01:00
EstherLerouzic
79f198d6fe reduce the number of test files
- use the same file to test different configuration: with and without Eqpt sheet defined,
   add the abcdfgh topo for disjunction tests in the same file
 - change the name of files to avoid mixing with examples/meshTopologyExampleV2.xxx

TODO: test if examples/ files pass for both path_requests_run and trasmission_main_example

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
2019-04-09 17:13:40 +01:00
EstherLerouzic
02a7e467e2 Major correction on mode optimization behaviour + small fixes
- this version handles special cases: if no baudrate satisfies the spacing
  , if no mode satisfies the OSNR threshold from transponders
- template of service corrected wih the novel path_bandwidth
- some ideas TODO added for testing

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
2018-11-21 09:20:25 +00:00
EstherLerouzic
9ea96e431c Test disjunction file corrected to include novel path_bandwidth parameter
Correction of data file for test_parser.py + adding a test on path non looping

- service json files now include path_nadwidth value
- previous constrained routing did not ensure loop free path. This has been
  corrected in A test has been added to avoid loosing this feature in future
  versions.

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
2018-11-21 09:16:23 +00:00
EstherLerouzic
75660febc1 Create test_disjunction
- create some test to check that produced paths are really disjoint
- add some TODOs on optical power for requests computation

First check of disjunction feature added to tests

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
2018-10-23 11:53:57 +01:00