Commit Graph

1558 Commits

Author SHA1 Message Date
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
87e10c240e Add test on blocking due to PDL penalty
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I2d6a7f9ed0ff8ad6977bcfe1b78ed620bb0e848d
2024-06-02 19:26:33 +02:00
EstherLerouzic
43c1085be6 feat: apply per path_type ROADM OSNR
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I2b0838c9a217a7f918b2cf08c233aacdbf686a72
2024-06-02 19:26:33 +02:00
EstherLerouzic
4ace60bea2 Feat: apply roadm-path loss
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I87e27d5b653bdce814f43e4c9c1183fb51fbcc1e
2024-06-02 19:26:33 +02:00
EstherLerouzic
f950a6aee8 Feat: add detailed ROADM impairments per roadm-path
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I09c55dcff53ffb264609654cde0f1d8b9dc7fe9b
2024-06-02 19:26:33 +02:00
EstherLerouzic
fb4195c775 Feat: Enable multiple type_varieties for ROADM
This commit introduces the 'type_variety' attribute for ROADM elements,
allowing the use of different types of ROADM specifications instead of
being limited to the default one.

If no type variety name is provided in the eqpt_config, the 'default'
name is used for backward compatibility with libraries. Additionally,
if no type variety is defined in the ROADM element in the topology,
the default one is used for backward compatibility with topologies.

The 'type_variety' attribute is included in the 'to_json' and
'display' methods for ROADM elements.

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I61a2491f994e47ad0b08cf8eaef30d6d855aa706
2024-06-02 19:26:33 +02:00
EstherLerouzic
29f42666e5 remove whites spaces and align parentheses
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I0f5f389a3cf20155ceb0e9d9f071d1334a5ad688
2024-06-02 19:26:33 +02:00
EstherLerouzic
9bf7f336e3 Update release notes of v2.9
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Ib949ff81fa818886a69339117bc66290dc2685b0
2024-06-02 19:26:27 +02:00
EstherLerouzic
eed6564f11 Add power sweep functionality description in documentation
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Ic8db566bc168f120ddb0016c91bcc1d24263548c
2024-06-02 19:17:07 +02:00
EstherLerouzic
fbb2f2c587 fix missing to_json export of computed_number_of_channels
The parameter was introduced in commit 9736f7c032
but the export to_json was not added.

In the next commits, it is necessary to compute Raman gain during the design
phase. The sim-params used for this computation are updated during the
design phase for speed reasons. To ensure the proper restoration of user
settings for propagation, the export must include all parameters. Therefore,
this commit adds 'computed_number_of_channels' to the JSON export. This allows
for the accurate recording of all user settings locally and enables their
restoration.

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I221a6f614010edea9cf46c3a7d43c5be064ff09c
2024-06-01 19:17:50 +02:00
EstherLerouzic
44040c4d06 fix missing description of computed_number_of_channels
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I5c8d057dcdab535617eee8de3eccdd806cec403e
2024-06-01 09:11:56 +02:00
EstherLerouzic
ee9af69558 Improve doc to state when tilt is vs wavelength
add some text in the docs to explain that tilt can be expressed
vs freq or lambda depending on context:
advanced_model expresses dgt as a function of frequency,
while tilt target is still defined vs wavelength (common usage).

Change the variable to have explicit name when it is per wavelength,
or add a comment to help identifyper wavelength or per frequency
variables.

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I7727f00b38244152b95954e981cc9da096bb3d1d
2024-05-24 07:11:02 +00:00
Esther Le Rouzic
ce21609fec Merge "fix: image of the script and documentation" 2024-05-22 14:24:26 +00:00
Esther Le Rouzic
a1289e6a9b Merge "feat: enable different sim_param vectors for multiple requests" 2024-05-22 14:19:35 +00:00
AndreaDAmico
138115e1d7 Frequency scaling description in release notes v2.8
Change-Id: I74f3d52a3cbc087b914ff18075869d2162b693ac
2024-05-16 01:23:27 -04:00
EstherLerouzic
ed41305f55 fix: image of the script and documentation
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Ib022320efd36a2d912f7b443686d7fee137e48b1
2024-04-26 18:19:53 +02:00
EstherLerouzic
9736f7c032 feat: enable different sim_param vectors for multiple requests
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Ia800a7b98b33b795cc3553500116be61c612e45c
2024-04-26 17:12:43 +02:00
EstherLerouzic
be7ae35db3 Refactor amp default in parameters
default parameters are shared between json and network function,
so it is better to have them on the parameters to avoid circular
dependency when importing modules

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Ib9d41852e394586d36f74992c91f67f3330cc552
2024-04-25 17:51:56 +02:00
EstherLerouzic
2b4a4ab72c fix Raman gain estimation during design
- Replaced multiple calls to the span_loss function
  with recording the span loss result in the fiber elements,
  reducing computation time.
- Updated Raman gain estimation based on design target powers to ensure
  accurate Edfa gain calculation or gain reduction during design.
- display the computed and design Raman gain in RamanFiber string output
- do not add padding on Raman fibers
- Added to_json function to preserve user input SimParams values,
  which were previously overwritten by initializing SimParams
  with fake values during design.

Next step is to allow users to balance computation time and
target accuracy of the design by inputing their own SimParams
and ref channels design values.

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I1ca4954d0621858cefb3d776a538131992cae3e3
2024-04-12 08:58:16 +02:00
EstherLerouzic
426c88432d fix: update README script animation
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I31381ddf3e372f34836416162c080a5205ef969d
2024-04-12 08:41:27 +02:00
AndreaDAmico
2a800b781f Bug fix: Raman coefficient properly scaled in non SSMF case
Before the Raman coefficient was normalized with respect the given effective area, instead of the reference.

Change-Id: I4c0547db4fbd0f823a9058022b93c1ca37d67b51
2024-04-11 01:21:02 -04:00
Jan Kundrát
8d1d3677ed docs: fix graphs on RTD
At OFC I was talking with the OpenROADM people, and it turned out that
our docs stopped rendering properly at RTD. It turned out that the build
started skipping the bindep.txt file at some (unknown) point in time.

Reported-by: Aparaajitha G L <aparaajitha.gomathinayakamlatha@utdallas.edu>
Change-Id: Ie9a4b61f36fb979fb5c109d02de06e0b2cbf270e
2024-03-29 19:23:08 +01:00
Jan Kundrát
5b6f8c60cf docs: use the default theme on ReadTheDocs.org as well
Historically, we've been using the RTD theme on the RTD site which hosts
the docs for us, and a Sphinx-default, "Alabaster" theme for other docs
builds. Doing that however started failing:

 Traceback (most recent call last):
   File "/home/docs/checkouts/readthedocs.org/user_builds/gnpy/envs/499/lib/python3.12/site-packages/sphinx/builders/html/__init__.py", line 1096, in handle_page
     output = self.templates.render(templatename, ctx)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/home/docs/checkouts/readthedocs.org/user_builds/gnpy/envs/499/lib/python3.12/site-packages/readthedocs_ext/readthedocs.py", line 181, in rtd_render
     content = old_render(template, render_context)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/home/docs/checkouts/readthedocs.org/user_builds/gnpy/envs/499/lib/python3.12/site-packages/sphinx/jinja2glue.py", line 194, in render
     return self.environment.get_template(template).render(context)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/home/docs/checkouts/readthedocs.org/user_builds/gnpy/envs/499/lib/python3.12/site-packages/jinja2/environment.py", line 1301, in render
     self.environment.handle_exception()
   File "/home/docs/checkouts/readthedocs.org/user_builds/gnpy/envs/499/lib/python3.12/site-packages/jinja2/environment.py", line 936, in handle_exception
     raise rewrite_traceback_stack(source=source)
   File "/home/docs/checkouts/readthedocs.org/user_builds/gnpy/envs/499/lib/python3.12/site-packages/sphinx/themes/basic/page.html", line 10, in top-level template code
     {%- extends "layout.html" %}
     ^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/home/docs/checkouts/readthedocs.org/user_builds/gnpy/envs/499/lib/python3.12/site-packages/sphinx/themes/classic/layout.html", line 10, in top-level template code
     {%- extends "basic/layout.html" %}
     ^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/home/docs/checkouts/readthedocs.org/user_builds/gnpy/envs/499/lib/python3.12/site-packages/sphinx/themes/default/../basic/layout.html", line 170, in top-level template code
     {%- block content %}
   File "/home/docs/checkouts/readthedocs.org/user_builds/gnpy/envs/499/lib/python3.12/site-packages/sphinx/themes/default/../basic/layout.html", line 189, in block 'content'
     {%- block sidebar2 %}{{ sidebar() }}{% endblock %}
     ^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/home/docs/checkouts/readthedocs.org/user_builds/gnpy/envs/499/lib/python3.12/site-packages/sphinx/themes/default/../basic/layout.html", line 189, in block 'sidebar2'
     {%- block sidebar2 %}{{ sidebar() }}{% endblock %}
     ^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/home/docs/checkouts/readthedocs.org/user_builds/gnpy/envs/499/lib/python3.12/site-packages/jinja2/sandbox.py", line 393, in call
     return __context.call(__obj, *args, **kwargs)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/home/docs/checkouts/readthedocs.org/user_builds/gnpy/envs/499/lib/python3.12/site-packages/jinja2/runtime.py", line 777, in _invoke
     rv = self._func(*arguments)
          ^^^^^^^^^^^^^^^^^^^^^^
   File "/home/docs/checkouts/readthedocs.org/user_builds/gnpy/envs/499/lib/python3.12/site-packages/sphinx/themes/default/../basic/layout.html", line 63, in template
     {%- include sidebartemplate %}
     ^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/home/docs/checkouts/readthedocs.org/user_builds/gnpy/envs/499/lib/python3.12/site-packages/sphinx/jinja2glue.py", line 215, in get_source
     raise TemplateNotFound(template)
 jinja2.exceptions.TemplateNotFound: about.html

 The above exception was the direct cause of the following exception:

 Traceback (most recent call last):
   File "/home/docs/checkouts/readthedocs.org/user_builds/gnpy/envs/499/lib/python3.12/site-packages/sphinx/cmd/build.py", line 281, in build_main
     app.build(args.force_all, args.filenames)
   File "/home/docs/checkouts/readthedocs.org/user_builds/gnpy/envs/499/lib/python3.12/site-packages/sphinx/application.py", line 347, in build
     self.builder.build_update()
   File "/home/docs/checkouts/readthedocs.org/user_builds/gnpy/envs/499/lib/python3.12/site-packages/sphinx/builders/__init__.py", line 310, in build_update
     self.build(to_build,
   File "/home/docs/checkouts/readthedocs.org/user_builds/gnpy/envs/499/lib/python3.12/site-packages/sphinx/builders/__init__.py", line 376, in build
     self.write(docnames, list(updated_docnames), method)
   File "/home/docs/checkouts/readthedocs.org/user_builds/gnpy/envs/499/lib/python3.12/site-packages/sphinx/builders/__init__.py", line 571, in write
     self._write_serial(sorted(docnames))
   File "/home/docs/checkouts/readthedocs.org/user_builds/gnpy/envs/499/lib/python3.12/site-packages/sphinx/builders/__init__.py", line 581, in _write_serial
     self.write_doc(docname, doctree)
   File "/home/docs/checkouts/readthedocs.org/user_builds/gnpy/envs/499/lib/python3.12/site-packages/sphinx/builders/html/__init__.py", line 672, in write_doc
     self.handle_page(docname, ctx, event_arg=doctree)
   File "/home/docs/checkouts/readthedocs.org/user_builds/gnpy/envs/499/lib/python3.12/site-packages/sphinx/builders/html/__init__.py", line 1103, in handle_page
     raise ThemeError(__("An error happened in rendering the page %s.\nReason: %r") %
 sphinx.errors.ThemeError: An error happened in rendering the page about-project.
 Reason: TemplateNotFound('about.html')

 Theme error:
 An error happened in rendering the page about-project.
 Reason: TemplateNotFound('about.html')

I have no clue what that means because we have never requested this
`about.html`, nor do we reference that file from anywhere. Chances are
that it's "just" some version pinning/compatibility issue, but hey --
why mess with that when there's a perfectly good default theme that
we're using for other purposes already.

As a side effect, this also solves that long-standing issue that Esther
reported where the tables have overly long lines. Apparently, it's a
theme-specific misfeature (readthedocs/sphinx_rtd_theme/#117), and the
Alabaster one doesn't suffer from that.

All hail alabaster!

Change-Id: I857890f29f14b7c0f66bca201c9a9c1b1cbf8841
v2.9
2024-03-13 21:30:20 +01:00
Jan Kundrát
3a733b1fd5 docs: try to unbreak the readthedocs.io build
It was failing with a message:

  Config validation error in build.os. Value os not found.

Apparently, the v2 config file is mandatory, so let's do that.

Change-Id: I267d5314db026de532b2b6644f500d25de08e343
2024-03-13 21:30:20 +01:00
Jan Kundrát
2d68b94a46 build: specify dependencies directly in setup.cfg
In tox v4, "reuse of environments" was disabled [1]. This is then later
explained [2] to refer to exactly that thing which we were using for
inheriting the dependencies from the top-level testenv all the way to
the docs build. That's why the docs build in GitHub CI started failing.

IMHO, The Correct Way™ of specifying what dependencies are used for
which feature are the so-called "extra dependencies". Once they are in
place, it is be possible to install gnpy via, e.g., `pip install
oopt-gnpy[docs]`. However, this process is (as far as I can tell)
incompatible with `requirements.txt`; all my attempts at using the
standard dependency syntax in that file have failed for me.

So, in order to make this happen, let's move all the dependencies from a
more-or-less ad-hoc collection of files to this declarative approach
right in setup.cfg. That way, the deps are listed on a single place, in
a declarative manner, and as a result, the installation is now a trivial
pip oneliner.

As a result, one can also remove that duplication of dependencies in
docs requirements.

[1] https://tox.wiki/en/4.11.4/upgrading.html#reuse-of-environments
[2] https://tox.wiki/en/4.11.4/upgrading.html#packaging-configuration-and-inheritance

Change-Id: I34aa0c71e993b39e2b805a7de40e133b4d290318
Fixes: 47c89626 fix docs requirements
2024-03-13 21:28:01 +01:00
EstherLerouzic
bc71823bd0 docs: add a release-note section and update documentation for penalties and SI
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I12a5747df3cee6df79c24dd6261f7be17aa77fcf
2024-02-09 18:59:40 +01:00
EstherLerouzic
5481b93728 Fix frequency scaling for fiber
- wrong parameter was used in parameter
- error message could not read 0-dimensional arrey for 0 and -1 element
- add a test that makes use of the feature

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Id7f6d6766d5b91a4b9410ad23aaa5e472b8ebb6f
2024-01-16 09:10:31 +00:00
EstherLerouzic
05e301182d Change fedora-python in action
"Until version 0.4, this action always used the
latest fedora-python-tox image"
https://github.com/fedora-python/tox-github-action

So let's use one that supports python 3.8

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Ibf3e0baa715da70b4c2af6e2cde6efccfab50311
2024-01-15 20:02:13 +01:00
EstherLerouzic
47c89626e3 fix docs requirements
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I9d151b842a38380b0368e099c67957ec36b78250
2024-01-15 13:53:44 +01:00
EstherLerouzic
7a032a63b5 ci change allow_whitelist which is deprecated
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Ic62050d351eb5bb2f8be2b8d9e0088bd965dc71d
2024-01-15 13:12:35 +01:00
EstherLerouzic
f195d5f496 fix: use ref power on transceiver to Roadm (or transceivers) links
The recent refactor removed a default pref in case of transceivers-OMS
(amplified links starting with a transceiver).
This resulted in a mismatch between input power during design
(default 0 forced in the function) and the design ref power using SI
power_dbm.

This change ensures that the same power is used for the input power
and for the design ref power, and avoid inconsistent gain computatiion.

The code has been using the same power input (SI power_dbm) to define the
power target out of a transceiver and the target out of amplifiers
(at the input of fibers). This will be changed in a future patch.

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I610c8df19039bcf156a8ba77c79114b22913a538
2023-12-08 12:27:05 +01:00
Esther Le Rouzic
56569f866f Merge changes from topics "mixed-rate", "refactor_remove_pref"
* changes:
  Add a test on EOL
  add invocation test with the 3 equalization settings
  Add a test on out_voa optimisation function
  Clean a bit, add docstrings
  Remove Pref, and move ref_carrier definition
  Remove p_span0 from SI
  Remove p_spani from Pref
  Use design delta_p and gains instead of p_spani
  restore initial power sweep behaviour
  refactor cli to use a common design function
  Parametrize verbose in autodesign
  refactor build_network: create a separate function to add elements
  Computes reference input power in fiber during design
  Computes reference input power in ROADM during design
  Add a variable to hold delta_p even if gain mode is selected
  Add frequency range in default_edfa profile
  Add a test on gain mode behaviour
  Check element setting before and after propagation
  Correct design: apply saturation in all cases
  Add more tests on amp saturation
2023-12-04 16:09:37 +00:00
Esther Le Rouzic
bf1f293043 Merge "Add test in amplifier behaviour" 2023-12-04 16:08:14 +00:00
Esther Le Rouzic
28871c6f2d Merge pull request #480 from jktjkt/python-3.12
CI: Python 3.12 and extended platform coverage
v2.8
2023-11-23 17:54:02 +01:00
EstherLerouzic
d7c1a6b75e Add a test on EOL
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Iddce655a64623a42cdaeaa2e8c269e3a737dd935
2023-11-20 17:07:53 +01:00
EstherLerouzic
c69c2a3af2 add invocation test with the 3 equalization settings
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I0aee8da7bbf71991c68e163c7188efe1ddf29ff9
2023-11-20 17:07:53 +01:00
EstherLerouzic
fb29d72906 Add a test on out_voa optimisation function
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I36d71d85e5837965f6d5ae47820506d06b3cb94e
2023-11-20 17:07:53 +01:00
EstherLerouzic
30a06da6b1 Clean a bit, add docstrings
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I8639d458ebb090761846387921f9da4fc65a9f64
2023-11-20 17:07:53 +01:00
EstherLerouzic
139c8cc1e7 Remove Pref, and move ref_carrier definition
Finally, ref_carrier is not meant to change after design since
it is the carrier used for design. So let's move its definition
to networks function. Only ROADM need the ref_carrier baud rate
so let's define a dedicated variable in ROADM to hold it.

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Ida7e42dd534a04c8df8792b44980f3fd2165ecb6
2023-11-20 17:07:53 +01:00
EstherLerouzic
7034d4c686 Remove p_span0 from SI
reference channel is defined during design. No need to convey it
anymore during propagation.

move target_pch_out_db definition to the design phase and change
its name to be consistent with what it contains (dbm)

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I350e4557e8488a614674042de26152ab89b2d245
2023-11-20 17:07:53 +01:00
EstherLerouzic
10164495b9 Remove p_spani from Pref
next step: remove Pref

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I7cc17253a2d7ab3fb42e3d07c1665991cffa6222
2023-11-20 17:07:53 +01:00
EstherLerouzic
87211b35e9 Use design delta_p and gains instead of p_spani
Remove the visualisation of the effective_pch in amp because actual
and target are the relevant ones. effective_pch was artificially
related to a mix of reference channel and noisy channel (mixed between
on the fly redesign but using actual ROADM equalisation which includes noise
in its actual loss).

the change does no more rely on the target power (which is rounded)
but on the designed gain, which is not rounded.

Propagations are slightly changed for openroadm simulations because of that.
(I verified)

The gain of amp was estimated on the fly with p_spni also in case of
RamanFiber preceding elements. removing p_spani requies that an estimation
of Raman gain be done during design.

This commit also adds this estimation.

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I960b85e99f85a7d168ac5349e325c4928fa5673b
2023-11-20 17:07:46 +01:00
EstherLerouzic
e9f9ddb4d6 restore initial power sweep behaviour
if user define a delta_p that is reduced because of saturation,
then this initial setting is still kept for power sweep to be sure
that the full amplitude of sweep is used.

SI power = 0 dBm
max power amp1 = 20 dBm,
user_defined_delta_p set by user = 3
80 channels, so pch_max = 20 - 10log10(80) = 0.96 dBm
power_sweep -> power range [-3, 0] dBm

then for initial design,
   pref = 0 dBm
   computed_delta_p =
      min(pch_max, pref + user_defined_delta_p) - pref = 0.96

but for -3 power sweep
   pref = -3 dBm
   computed_delta_p =
      min(pch_max, pref + user_defined_delta_p) - pref =
      min(0.96,    -3 + 3) - (-3) = 3
   so the user defined delta_p is applied as much as possible

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I8fd459c29aa9754ff9d4868af1d8be8642a31913
2023-11-20 11:10:07 +01:00
EstherLerouzic
8ea13bb4d6 refactor cli to use a common design function
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I029d8c7fc29b1e86e1e3b2b64933bae5da134226
2023-11-20 10:27:43 +01:00
EstherLerouzic
b45829d2df Parametrize verbose in autodesign
transmission-main-example and path-request-run functions implement an
on-the-fly redesign based on p_span_i.
Since we remove p_span_i from elements, we will need to properly call
redesign several times before each propagation, to keep the same
behaviour of these functions.

in this commit we simply enable the possibility to mute warnings.

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I3aa3d8fc87325033ef69641078bdd7213e0409eb
2023-11-20 10:27:41 +01:00
EstherLerouzic
6ac3a517cf refactor build_network: create a separate function to add elements
separate function that adds element, from function that configure them

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Ica332223bdf7fc599cb007d7513d7cd62d9c5f9c
2023-11-20 10:25:07 +01:00
EstherLerouzic
2f2920a716 Computes reference input power in fiber during design
input power is computed at design time: so let's record it and
use it instead of p_span_i for reference channel fiber loss computation.
Note that this loss parameter is only used for visualisation purpose.

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I16bd792bd6079ce521aafadcf5e21922aa3b4c81
2023-11-20 10:23:21 +01:00
EstherLerouzic
07fd89351b Computes reference input power in ROADM during design
input power is computed at design time: so let's record it and
use it instead of p_span_i for ROADM reference channel loss computation.
Note that this loss parameter is only used for visualisation purpose.
No impact on propagation.

Since this loss is computed for the reference channel used for
design, we need to record input power based on input degrees,
and indicate this information within the call function.

Note that this will be also usefull later on to implement ROADM
parameters

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I64d510fc20df72f07158f400964d592d76dc0ce4
2023-11-20 10:23:21 +01:00
EstherLerouzic
7c60b000b5 Add a variable to hold delta_p even if gain mode is selected
Let's use a clean convention to hold values that are configured,
autodesigned or resulting from propagation.

- edfa.operational.delta_p: holds the value set by the user if any.
  This is needed in case of redesign for power sweep for example.
  It is never changed.
- edfa.delta_p:
  o if power_mode is true, records the value computed by the design.
      Applies user defined value except:
      If the user has set non possible values (eg leading to saturation),
      then the value is corrected at design phase.
      If the element is propagated for different conditions than
      design, for example leading to saturation,  then delta_p might be
      different than the value initially computed during design.
  o if power_mode is False, it is set to None
- edfa._delta_p: records the value computed during design whatever
  the power mode

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I4e130a3abe0a5e3f6c057d89360e50531c168123
2023-11-20 10:23:21 +01:00