Describe the bug
FiberParams.init does not support the YANG model-defined 'loss_coef_value' key in loss_coef dictionary. When using a YANG-compliant loss_coef_per_frequency (frequency-dependent loss coefficient vector), it raises ParametersError claiming the 'value' field is missing.
According to the YANG model definition, fiber parameters should support two formats:
loss_coef (scalar, decimal64) - single scalar value
loss_coef_per_frequency (vector, list) - frequency-dependent vector, each element contains frequency and loss_coef_value
Currently, FiberParams.init only handles the loss_coef field (single value or a dictionary with 'value' and 'frequency' keys), and does not implement support for loss_coef_value.
To Reproduce
Steps to reproduce the behavior:
- Create a YANG-compliant network topology JSON file with fiber elements using loss_coef_per_frequency format
- Load the network topology using GNPy
- The error occurs when FiberParams is initialized
Error Message
Simulation parameters error: Config error in fiber (...): Fiber configurations json must include 'value'. Configuration: {..., 'loss_coef': {'frequency': [196200000000000.0, 193400000000000.0, 191400000000000.0, 190900000000000.0, 187900000000000.0, 186150000000000.0], 'loss_coef_value': [0.25, 0.249, 0.248, 0.248, 0.249, 0.25]}, ...}
Environment:
- OS: Windows
- Python Version 3.12
- GNPyVersion 2.13
Describe the bug
FiberParams.init does not support the YANG model-defined 'loss_coef_value' key in loss_coef dictionary. When using a YANG-compliant loss_coef_per_frequency (frequency-dependent loss coefficient vector), it raises ParametersError claiming the 'value' field is missing.
According to the YANG model definition, fiber parameters should support two formats:
loss_coef (scalar, decimal64) - single scalar value
loss_coef_per_frequency (vector, list) - frequency-dependent vector, each element contains frequency and loss_coef_value
Currently, FiberParams.init only handles the loss_coef field (single value or a dictionary with 'value' and 'frequency' keys), and does not implement support for loss_coef_value.
To Reproduce
Steps to reproduce the behavior:
Error Message
Simulation parameters error: Config error in fiber (...): Fiber configurations json must include 'value'. Configuration: {..., 'loss_coef': {'frequency': [196200000000000.0, 193400000000000.0, 191400000000000.0, 190900000000000.0, 187900000000000.0, 186150000000000.0], 'loss_coef_value': [0.25, 0.249, 0.248, 0.248, 0.249, 0.25]}, ...}
Environment: