#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# SPDX-License-Identifier: BSD-3-Clause
# precision of fraction digits collected in yang models
# Copyright (C) 2025 Telecom Infra Project and GNPy contributors
# see AUTHORS.rst for a list of contributors

PRECISION_DICT = {
    "contact": -1, "date": -1, "description": -1, "module": -1, "organization": -1,
    "f_min": 1,
    "f_max": 1,
    "length": 6,
    "loss_coef": 6,
    "pmd_coef": 18,
    "frequency": 1,
    "freq": 2, "ref_frequency": 1, "ref_wavelength": 12,
    "g0": 14, "loss_coef_value": 16, "position": 6, "reference_frequency": 1,
    "att_in": 2,
    "con_in": 2,
    "con_out": 2,
    "temperature": 2,
    "power": 9,
    "gain_target": 6,
    "tilt_target": 6,
    "out_voa": 2,
    "in_voa": 2,
    "delta_p": 6,
    "spacing": 2,
    "target_pch_out_db": 2,
    "target_psd_out_mWperGHz": 10,
    "target_out_mWperSlotWidth": 10,
    "per_degree_pch_out_db": 2,
    "per_degree_psd_out_mWperGHz": 10,
    "per_degree_psd_out_mWperSlotWidth": 10,
    "number-of-channels": 0,
    "loss": 2,
    "city": -1,
    "region": -1,
    "latitude": 6,
    "longitude": 6,
    "length_units": -1,
    "propagation_direction": -1,
    "type_variety": -1,
    "degree_uid": -1,
    "preamp_variety_list": -1,
    "booster_variety_list": -1,
    "from_degree": -1,
    "to_degree": -1,
    "impairment_id": 0,
    "variety_list": -1,
    "uid": -1,
    "type": -1,
    "from_node": -1,
    "to_node": -1,
    "network_name": -1,
    "output-power": 8,
    "tx_power": 5,
    "path_bandwidth": 1,
    "accumulative-value": 8,
    "N": 0,
    "M": 0,
    "trx_mode": -1,
    "max-nb-of-channel": 0,
    "technology": -1,
    "trx_type": -1,
    "transponder-type": -1,
    "transponder-mode": -1,
    "explicit-route-usage": -1,
    "disjointness": -1,
    "index": 0,
    "node-id": -1,
    "link-tp-id": -1,
    "hop-type": -1,
    "source": -1,
    "destination": -1,
    "src-tp-id": -1,
    "dst-tp-id": -1,
    "synchronization-id": -1,
    "relaxable": -1,
    "request-id-number": -1,
    "request-id": -1,
    "bidirectional": -1,
    "metric-type": -1,
    "response-id": -1,
    "no-path": -1,
    "result_spatial_resolution": 3,
    "solver_spatial_resolution": 3,
    "dispersion_tolerance": 1,
    "phase_shift_tolerance": 1,
    "flag": -1,
    "order": 0,
    "method": -1,
    "computed_channels": 0,
    "computed_number_of_channels": 0,
    "nf_min": 2,
    "nf_max": 2,
    "nf0": 2,
    "nf_coef": 10,
    "coef_order": 0,
    "gain_flatmax": 2,
    "gain_min": 2,
    "extended_gain_range": 2,
    "p_max": 2,
    "dispersion": 8,
    'dispersion_slope': 11,
    "gamma": 8,
    "effective_area": 14,
    "min_value": 2,
    "max_value": 2,
    "step": 2,
    "lower-frequency": 2,
    "upper-frequency": 2,
    "cr": 9,
    "frequency_offset": 2,
    "max_length": 2,
    "max_loss": 2,
    "max_fiber_lineic_loss_for_raman": 2,
    "target_extended_gain": 2,
    "padding": 2,
    "EOL": 2,
    "span_loss_ref": 2,
    "power_slope": 2,
    "voa_margin": 2,
    "voa_step": 2,
    "add_drop_osnr": 2,
    "pmd": 15,
    "pdl": 2,
    "baud_rate": 2,
    "power_dbm": 2,
    "roll_off": 2,
    "tx_osnr": 2,
    "tx_power_dbm": 2,
    "sys_margins": 2,
    "min": 2,
    "max": 2,
    "OSNR": 2,
    "min_spacing": 2,
    "bit_rate": 2,
    "cost": 2,
    "chromatic_dispersion": 2,
    "penalty_value": 2,
    "equalization_offset_db": 4,
    "preamp_variety": -1,
    "booster_variety": -1,
    "amplifiers": -1,
    "advanced_config_from_json": -1,
    "default_config_from_json": -1,
    "allowed_for_design": -1,
    "type_def": -1,
    "raman": -1,
    "out_voa_auto": -1,
    "in_voa_auto": -1,
    "other_name": -1,
    "power_mode": -1,
    "roadm-path-impairments-id": 0,
    "use_si_channel_count_for_design": -1,
    "comment": -1,
    "format": -1,
    "roadm-osnr": 2,
    "nf_ripple": 18,
    "dgt": 18,
    "gain_ripple": 18,
    "slot_width": 2,
    "delta_pdb": 2,
    "label": -1,
    "roadm-pmd": 8,
    "otsi-carrier-frequency": 9,
    "oms-element-uid": -1,
    "configured-mode": -1,
    "type-variety": -1,
    "frequency-range-id": 0,
    "stage-order": 0,
    "name": -1,
    "nominal-carrier-power": 2,
    "nominal-psd": 16,
    "actual-gain": 2,
    "in-voa": 2,
    "out-voa": 2,
    "tilt-target": 2,
    "total-output-power": 2,
    "raman-direction": -1,
    "pump-id": 0,
    "delta-power": 2,
    "loss-coef": 2,
    "total-loss": 2,
    "conn-in": 2,
    "conn-out": 2,
    "roadm-cd": 5,
    "roadm-pdl": 2,
    "roadm-inband-crosstalk": 2,
    "roadm-maxloss": 2,
    "roadm-pmax": 2,
    "roadm-noise-figure": 5,
    "roadm-minloss": 2,
    "roadm-typloss": 2,
    "roadm-pmin": 2,
    "roadm-ptyp": 2,
    "generalized-snr": 2,
    "equalization-mode": -1,
    "otsi-carrier-id": 0,
    "e2e-mc-path-id": 0,
    "otsi-group-ref": -1,
    "media-channel-id": 0,
    "otsi-carrier-ref": -1,
    "e2e-mc-path-ref": -1,
    "elt-index": 0,
    "link-ref": -1,
    "oms-element-ref": -1,
    "otsi-ref": -1,
    "otsi-group-id": -1,
    "explicit-transceiver-mode-id": -1,
    "transponder-id": 0,
    "termination-type-capabilities": -1,
    "transceiver-id": 0,
    "explicit-transceiver-mode-ref": -1,
    "configured-termination-type": -1,
    "group-id": 0,
    "regen-metric": 0,
    "transponder-ref": -1,
    "transceiver-ref": -1,
    "protection-type": -1,
    "inter-layer-sequence-number": 0,
    "roadm-path-impairments": -1,
    "ltp-ref": -1,
    "add-path-impairments": -1,
    "drop-path-impairments": -1,
    "ttp-transponder-ref": -1,
    "ttp-transceiver-ref": -1,
    "is-allowed": -1,
    "penalty-value": 2,
    "max-chromatic-dispersion": 2,
    "cd-value": 2,
    "max-polarization-mode-dispersion": 2,
    "pmd-value": 2,
    "available-baud-rate": 1,
    "roll-off": 4,
    "fec-code-rate": 8,
    "fec-threshold": 8,
    "polarization-skew": 2,
    "dwdm-n": -1,
    "cwdm-n": -1,
    "wson-dwdm-channel-spacing": -1,
    "wson-cwdm-channel-spacing": -1,
    "subcarrier-dwdm-n": 0,
    "slot-width-granularity": -1,
    "min-slot-width-factor": 0,
    "max-slot-width-factor": 0,
    "grid-type": -1,
    "priority": 0,
    "flexi-n": 0,
    "flexi-m": 0,
    "flexi-grid-channel-spacing": -1,
    "flexi-ncfg": -1,
    "flexi-n-step": 0,
    "mode-id": -1,
    "supported-application-codes": -1,
    "supported-organizational-modes": -1,
    "standard-mode": -1,
    "operational-mode": -1,
    "organization-identifier": -1,
    "line-coding-bitrate": -1,
    "bitrate": 0,
    "max-diff-group-delay": 2,
    "max-polarization-dependant-loss": 2,
    "pdl-value": 2,
    "available-modulation-type": -1,
    "min-OSNR": 2,
    "rx-ref-channel-power": 2,
    "rx-channel-power-value": 2,
    "min-Q-factor": 2,
    "min-carrier-spacing": 6,
    "available-fec-type": -1,
    "in-band-osnr": 2,
    "out-of-band-osnr": 2,
    "tx-polarization-power-difference": 2,
    "min-central-frequency": 9,
    "max-central-frequency": 9,
    "transceiver-tunability": 6,
    "tx-channel-power-min": 2,
    "tx-channel-power-max": 2,
    "rx-channel-power-min": 2,
    "rx-channel-power-max": 2,
    "rx-total-power-max": 2,
    "tx-channel-power": 2,
    "rx-channel-power": 2,
    "rx-total-power": 2,
    "wavelength-assignment": -1,
    "gsnr-extra-margin": 2,
    "estimated-gsnr": 2,
    "estimated-eol-gsnr": 2,
    "estimated-lowest-gsnr": 2
}
