reorganization: gnpy/{core => topology}/request.py

Change-Id: Ib399549479b56634c681930aa444b657e5f58ca7
This commit is contained in:
Jan Kundrát
2020-05-07 20:21:12 +02:00
parent c7589e0bca
commit 145653df6e
11 changed files with 23 additions and 18 deletions

View File

@@ -11,7 +11,6 @@
.. automodule:: gnpy.core.network
.. automodule:: gnpy.core.node
.. automodule:: gnpy.core.parameters
.. automodule:: gnpy.core.request
.. automodule:: gnpy.core.science_utils
.. automodule:: gnpy.core.service_sheet
.. automodule:: gnpy.core.spectrum_assignment

View File

@@ -0,0 +1,5 @@
``gnpy.topology``
-----------------
.. automodule:: gnpy.topology
.. automodule:: gnpy.topology.request

View File

@@ -10,4 +10,5 @@ API Reference Documentation
.. toctree::
gnpy-api-core
gnpy-api-topology
gnpy-api-tools

View File

@@ -25,15 +25,15 @@ from gnpy.core.network import load_network, build_network, save_network
from gnpy.core.equipment import load_equipment, trx_mode_params, automatic_nch
from gnpy.core.elements import Roadm
from gnpy.core.utils import db2lin, lin2db
from gnpy.core.request import (PathRequest, ResultElement,
propagate, jsontocsv, Disjunction, compute_path_dsjctn,
requests_aggregation, propagate_and_optimize_mode,
BLOCKING_NOPATH, BLOCKING_NOMODE,
find_reversed_path, correct_json_route_list)
from gnpy.core.exceptions import (ConfigurationError, EquipmentConfigError, NetworkTopologyError,
ServiceError, DisjunctionError)
import gnpy.core.ansi_escapes as ansi_escapes
from gnpy.core.spectrum_assignment import (build_oms_list, pth_assign_spectrum)
from gnpy.topology.request import (PathRequest, ResultElement,
propagate, jsontocsv, Disjunction, compute_path_dsjctn,
requests_aggregation, propagate_and_optimize_mode,
BLOCKING_NOPATH, BLOCKING_NOMODE,
find_reversed_path, correct_json_route_list)
from copy import copy, deepcopy
from textwrap import dedent
from math import ceil

View File

@@ -25,12 +25,12 @@ from networkx import (draw_networkx_nodes, draw_networkx_edges,
from gnpy.core.network import load_network, build_network, save_network
from gnpy.core.elements import Transceiver, Fiber, RamanFiber, Edfa, Roadm
from gnpy.core.info import create_input_spectral_information, SpectralInformation, Channel, Power, Pref
from gnpy.core.request import PathRequest, compute_constrained_path, propagate2
from gnpy.core.exceptions import ConfigurationError, EquipmentConfigError, NetworkTopologyError
from gnpy.core.parameters import SimParams
from gnpy.core.science_utils import Simulation
from gnpy.core.utils import load_json
import gnpy.core.ansi_escapes as ansi_escapes
from gnpy.topology.request import PathRequest, compute_constrained_path, propagate2
logger = getLogger(__name__)

View File

@@ -14,8 +14,8 @@ See: draft-ietf-teas-yang-path-computation-01.txt
from argparse import ArgumentParser
from pathlib import Path
from json import loads
from gnpy.core.equipment import load_equipment
from gnpy.core.request import jsontocsv
from gnpy.core.equipment import load_equipment
from gnpy.topology.request import jsontocsv
parser = ArgumentParser(description = 'A function that writes json path results in an excel sheet.')

View File

@@ -2,8 +2,8 @@
# -*- coding: utf-8 -*-
"""
gnpy.core.request
=================
gnpy.topology.request
=====================
This module contains path request functionality.

View File

@@ -19,9 +19,9 @@ import pytest
from gnpy.core.equipment import load_equipment, trx_mode_params, automatic_nch
from gnpy.core.network import load_network, build_network
from examples.path_requests_run import requests_from_json, correct_json_route_list, load_requests
from gnpy.core.request import compute_path_dsjctn, propagate, propagate_and_optimize_mode
from gnpy.core.utils import db2lin, lin2db
from gnpy.core.elements import Roadm
from gnpy.topology.request import compute_path_dsjctn, propagate, propagate_and_optimize_mode
network_file_name = Path(__file__).parent.parent / 'tests/data/testTopology_expected.json'
service_file_name = Path(__file__).parent.parent / 'tests/data/testTopology_testservices.json'
@@ -41,7 +41,7 @@ def test_automaticmodefeature(net,eqpt,serv,expected_mode):
# power density : db2linp(ower_dbm": 0)/power_dbm": 0 * nb channels as defined by
# spacing, f_min and f_max
p_db = equipment['SI']['default'].power_dbm
p_total_db = p_db + lin2db(automatic_nch(equipment['SI']['default'].f_min,\
equipment['SI']['default'].f_max, equipment['SI']['default'].spacing))
build_network(network, equipment, p_db, p_total_db)

View File

@@ -18,11 +18,11 @@ from gnpy.core.equipment import load_equipment, trx_mode_params, automatic_nch
from gnpy.core.network import load_network, build_network
from gnpy.core.exceptions import ServiceError
from examples.path_requests_run import (requests_from_json, load_requests, disjunctions_from_json)
from gnpy.core.request import (compute_path_dsjctn, isdisjoint, find_reversed_path, PathRequest,
correct_json_route_list)
from gnpy.core.utils import lin2db
from gnpy.core.elements import Roadm
from gnpy.core.spectrum_assignment import build_oms_list
from gnpy.topology.request import (compute_path_dsjctn, isdisjoint, find_reversed_path, PathRequest,
correct_json_route_list)
NETWORK_FILE_NAME = Path(__file__).parent.parent / 'tests/data/testTopology_expected.json'
SERVICE_FILE_NAME = Path(__file__).parent.parent / 'tests/data/testTopology_testservices.json'

View File

@@ -27,10 +27,10 @@ from gnpy.core.network import save_network, build_network
from gnpy.core.service_sheet import convert_service_sheet, correct_xls_route_list
from gnpy.core.equipment import load_equipment, automatic_nch
from gnpy.core.network import load_network
from gnpy.core.request import (jsontocsv, requests_aggregation, compute_path_dsjctn,
ResultElement, PathRequest)
from gnpy.core.spectrum_assignment import build_oms_list, pth_assign_spectrum
from gnpy.core.exceptions import ServiceError
from gnpy.topology.request import (jsontocsv, requests_aggregation, compute_path_dsjctn,
ResultElement, PathRequest)
from gnpy.tools.convert import convert_file
from examples.path_requests_run import (requests_from_json, disjunctions_from_json,
correct_disjn, compute_path_with_disjunction)

View File

@@ -22,7 +22,7 @@ from gnpy.core.elements import Roadm, Transceiver
from gnpy.core.spectrum_assignment import (build_oms_list, align_grids, nvalue_to_frequency,
bitmap_sum, Bitmap, spectrum_selection, pth_assign_spectrum)
from gnpy.core.exceptions import SpectrumError
from gnpy.core.request import compute_path_dsjctn, find_reversed_path
from gnpy.topology.request import compute_path_dsjctn, find_reversed_path
from examples.path_requests_run import requests_from_json, disjunctions_from_json, correct_disjn
TEST_DIR = Path(__file__).parent