Move all business logic code under template folder 12/12012/1
authorMartin Skorupski <martin.skorupski@highstreet-technologies.com>
Fri, 3 Nov 2023 15:49:05 +0000 (16:49 +0100)
committerMartin Skorupski <martin.skorupski@highstreet-technologies.com>
Fri, 3 Nov 2023 15:49:13 +0000 (16:49 +0100)
- move all python code
- change references

Issue-ID: OAM-385
Change-Id: I7cef9ec4bff10ccfa81c1bf52d7b6078da460954
Signed-off-by: Martin Skorupski <martin.skorupski@highstreet-technologies.com>
28 files changed:
code/network-generator/network_generation/VERSION [new file with mode: 0644]
code/network-generator/network_generation/base.py [new file with mode: 0644]
code/network-generator/network_generation/controller/network_generator.py [moved from code/network-generator/controller/network_generator.py with 95% similarity]
code/network-generator/network_generation/controller/parameter_validator.py [moved from code/network-generator/controller/parameter_validator.py with 100% similarity]
code/network-generator/network_generation/model/jsonSchema/configuration.schema.json [moved from code/network-generator/model/jsonSchema/configuration.schema.json with 100% similarity]
code/network-generator/network_generation/model/python/countries.py [moved from code/network-generator/model/python/countries.py with 100% similarity]
code/network-generator/network_generation/model/python/cube.py [moved from code/network-generator/model/python/cube.py with 97% similarity]
code/network-generator/network_generation/model/python/geo_location.py [moved from code/network-generator/model/python/geo_location.py with 97% similarity]
code/network-generator/network_generation/model/python/hexagon.py [moved from code/network-generator/model/python/hexagon.py with 99% similarity]
code/network-generator/network_generation/model/python/nr_cell_du.py [moved from code/network-generator/model/python/nr_cell_du.py with 92% similarity]
code/network-generator/network_generation/model/python/o_ran_cloud_du.py [moved from code/network-generator/model/python/o_ran_cloud_du.py with 89% similarity]
code/network-generator/network_generation/model/python/o_ran_cu.py [moved from code/network-generator/model/python/o_ran_cu.py with 89% similarity]
code/network-generator/network_generation/model/python/o_ran_du.py [moved from code/network-generator/model/python/o_ran_du.py with 93% similarity]
code/network-generator/network_generation/model/python/o_ran_near_rt_ric.py [moved from code/network-generator/model/python/o_ran_near_rt_ric.py with 89% similarity]
code/network-generator/network_generation/model/python/o_ran_network.py [moved from code/network-generator/model/python/o_ran_network.py with 91% similarity]
code/network-generator/network_generation/model/python/o_ran_node.py [moved from code/network-generator/model/python/o_ran_node.py with 90% similarity]
code/network-generator/network_generation/model/python/o_ran_object.py [moved from code/network-generator/model/python/o_ran_object.py with 95% similarity]
code/network-generator/network_generation/model/python/o_ran_ru.py [moved from code/network-generator/model/python/o_ran_ru.py with 94% similarity]
code/network-generator/network_generation/model/python/o_ran_smo.py [moved from code/network-generator/model/python/o_ran_smo.py with 89% similarity]
code/network-generator/network_generation/model/python/o_ran_spiral_radius_profile.py [moved from code/network-generator/model/python/o_ran_spiral_radius_profile.py with 98% similarity]
code/network-generator/network_generation/model/python/o_ran_termination_point.py [moved from code/network-generator/model/python/o_ran_termination_point.py with 97% similarity]
code/network-generator/network_generation/model/python/point.py [moved from code/network-generator/model/python/point.py with 100% similarity]
code/network-generator/network_generation/model/python/top.py [moved from code/network-generator/model/python/top.py with 98% similarity]
code/network-generator/network_generation/model/python/tower.py [moved from code/network-generator/model/python/tower.py with 94% similarity]
code/network-generator/network_generation/model/python/type_definitions.py [moved from code/network-generator/model/python/type_definitions.py with 96% similarity]
code/network-generator/network_generation/view/kml.styles.json [moved from code/network-generator/view/kml.styles.json with 100% similarity]
code/network-generator/network_generation/view/network_viewer.py [moved from code/network-generator/view/network_viewer.py with 94% similarity]
code/network-generator/network_generation/view/svg.style.css [moved from code/network-generator/view/svg.style.css with 100% similarity]

diff --git a/code/network-generator/network_generation/VERSION b/code/network-generator/network_generation/VERSION
new file mode 100644 (file)
index 0000000..6e8bf73
--- /dev/null
@@ -0,0 +1 @@
+0.1.0
diff --git a/code/network-generator/network_generation/base.py b/code/network-generator/network_generation/base.py
new file mode 100644 (file)
index 0000000..44927f3
--- /dev/null
@@ -0,0 +1,24 @@
+# Copyright 2023 highstreet technologies GmbH
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# inspired by https://github.com/rochacbruno/python-project-template
+
+"""
+network_generation base module.
+
+This is the principal module of the network_generation project.
+"""
+
+# example constant variable
+NAME = "network_generation"
@@ -17,7 +17,7 @@
 Module containing the Generator class.
 """
 
-from model.python.o_ran_network import ORanNetwork
+from network_generation.model.python.o_ran_network import ORanNetwork
 
 
 class NetworkGenerator:
@@ -15,7 +15,7 @@
 # inspired by http://www.redblobgames.com/grids/hexagons/
 
 #!/usr/bin/python
-from model.python.hexagon import Hex
+from network_generation.model.python.hexagon import Hex
 
 
 class Cube:
@@ -18,7 +18,7 @@
 A collection of TypeDefinitions for a geographical location
 """
 import math
-from model.python.point import Point
+from network_generation.model.python.point import Point
 
 
 class IGeoLocationData:
@@ -22,8 +22,8 @@ import collections
 import math
 from typing import NamedTuple
 
-from model.python.point import Point
-from model.python.geo_location import GeoLocation
+from network_generation.model.python.point import Point
+from network_generation.model.python.geo_location import GeoLocation
 
 
 class Hex:
@@ -19,12 +19,12 @@ A Class representing a 3GPP new radio cell du (NrCellDu)
 """
 from typing import overload
 
-from model.python.o_ran_termination_point import ORanTerminationPoint
-from model.python.o_ran_object import IORanObject
-from model.python.o_ran_node import ORanNode
-import model.python.hexagon as Hexagon
-from model.python.point import Point
-from model.python.geo_location import GeoLocation
+from network_generation.model.python.o_ran_termination_point import ORanTerminationPoint
+from network_generation.model.python.o_ran_object import IORanObject
+from network_generation.model.python.o_ran_node import ORanNode
+import network_generation.model.python.hexagon as Hexagon
+from network_generation.model.python.point import Point
+from network_generation.model.python.geo_location import GeoLocation
 import xml.etree.ElementTree as ET
 
 
@@ -21,13 +21,13 @@ Maybe dedicated hardware is required to host O-DUs, but it is expected
 that the O-Cloud mechanism and concepts can be applied here.
 """
 from typing import overload
-import model.python.hexagon as Hexagon
-from model.python.hexagon import Hex
-from model.python.cube import Cube
-from model.python.tower import Tower
-from model.python.o_ran_object import IORanObject
-from model.python.o_ran_node import ORanNode
-from model.python.o_ran_termination_point import ORanTerminationPoint
+import network_generation.model.python.hexagon as Hexagon
+from network_generation.model.python.hexagon import Hex
+from network_generation.model.python.cube import Cube
+from network_generation.model.python.tower import Tower
+from network_generation.model.python.o_ran_object import IORanObject
+from network_generation.model.python.o_ran_node import ORanNode
+from network_generation.model.python.o_ran_termination_point import ORanTerminationPoint
 import xml.etree.ElementTree as ET
 
 
@@ -19,14 +19,14 @@ A Class representing an O-RAN centralized unit (ORanCu)
 and at the same time a location for an O-Cloud resource pool
 """
 from typing import overload
-from model.python.cube import Cube
-from model.python.hexagon import Hex
-import model.python.hexagon as Hexagon
-from model.python.o_ran_cloud_du import ORanCloudDu
-from model.python.tower import Tower
-from model.python.o_ran_object import IORanObject
-from model.python.o_ran_node import ORanNode
-from model.python.o_ran_termination_point import ORanTerminationPoint
+from network_generation.model.python.cube import Cube
+from network_generation.model.python.hexagon import Hex
+import network_generation.model.python.hexagon as Hexagon
+from network_generation.model.python.o_ran_cloud_du import ORanCloudDu
+from network_generation.model.python.tower import Tower
+from network_generation.model.python.o_ran_object import IORanObject
+from network_generation.model.python.o_ran_node import ORanNode
+from network_generation.model.python.o_ran_termination_point import ORanTerminationPoint
 import xml.etree.ElementTree as ET
 
 
@@ -18,9 +18,9 @@
 A Class representing an O-RAN distributed unit (ORanDu)
 """
 from typing import overload
-from model.python.o_ran_object import IORanObject
-from model.python.o_ran_node import ORanNode
-from model.python.o_ran_termination_point import ORanTerminationPoint
+from network_generation.model.python.o_ran_object import IORanObject
+from network_generation.model.python.o_ran_node import ORanNode
+from network_generation.model.python.o_ran_termination_point import ORanTerminationPoint
 import xml.etree.ElementTree as ET
 
 
 A Class representing an O-RAN Near real-time intelligent controller (ORanNearRtRic)
 """
 from typing import overload
-from model.python.tower import Tower
-from model.python.o_ran_cu import ORanCu
-from model.python.o_ran_object import IORanObject
-from model.python.o_ran_node import ORanNode
-from model.python.o_ran_termination_point import ORanTerminationPoint
-from model.python.hexagon import Hex
-import model.python.hexagon as Hexagon
+from network_generation.model.python.tower import Tower
+from network_generation.model.python.o_ran_cu import ORanCu
+from network_generation.model.python.o_ran_object import IORanObject
+from network_generation.model.python.o_ran_node import ORanNode
+from network_generation.model.python.o_ran_termination_point import ORanTerminationPoint
+from network_generation.model.python.hexagon import Hex
+import network_generation.model.python.hexagon as Hexagon
 import xml.etree.ElementTree as ET
 
 
 """
 Module for a class representing a O-RAN Network
 """
-from model.python.o_ran_smo import ORanSmo
-from model.python.o_ran_spiral_radius_profile import SpiralRadiusProfile
-from model.python.o_ran_object import IORanObject, ORanObject
-import model.python.hexagon as Hexagon
-from model.python.hexagon import Layout
-from model.python.point import Point
+from network_generation.model.python.o_ran_smo import ORanSmo
+from network_generation.model.python.o_ran_spiral_radius_profile import SpiralRadiusProfile
+from network_generation.model.python.o_ran_object import IORanObject, ORanObject
+import network_generation.model.python.hexagon as Hexagon
+from network_generation.model.python.hexagon import Layout
+from network_generation.model.python.point import Point
 import xml.etree.ElementTree as ET
 
 
@@ -21,14 +21,14 @@ from abc import abstractmethod, abstractproperty
 from typing import Any
 import xml.etree.ElementTree as ET
 import json
-from model.python.geo_location import GeoLocation
-from model.python.o_ran_object import IORanObject, ORanObject
-import model.python.hexagon as Hexagon
-from model.python.hexagon import Hex, Layout
-from model.python.point import Point
-from model.python.o_ran_spiral_radius_profile import SpiralRadiusProfile
-from model.python.o_ran_termination_point import ORanTerminationPoint
-from model.python.type_definitions import (
+from network_generation.model.python.geo_location import GeoLocation
+from network_generation.model.python.o_ran_object import IORanObject, ORanObject
+import network_generation.model.python.hexagon as Hexagon
+from network_generation.model.python.hexagon import Hex, Layout
+from network_generation.model.python.point import Point
+from network_generation.model.python.o_ran_spiral_radius_profile import SpiralRadiusProfile
+from network_generation.model.python.o_ran_termination_point import ORanTerminationPoint
+from network_generation.model.python.type_definitions import (
     AddressType,
 )
 
@@ -17,7 +17,7 @@
 """
 An abstract Class for O-RAN Objects
 """
-from model.python.top import ITop, Top
+from network_generation.model.python.top import ITop, Top
 
 
 # Define the "IORanObject" interface
@@ -19,11 +19,11 @@ A Class representing an O-RAN radio unit (ORanRu)
 """
 from typing import overload
 
-from model.python.o_ran_du import ORanDu
-from model.python.o_ran_termination_point import ORanTerminationPoint
-from model.python.nr_cell_du import NrCellDu
-from model.python.o_ran_object import IORanObject
-from model.python.o_ran_node import ORanNode
+from network_generation.model.python.o_ran_du import ORanDu
+from network_generation.model.python.o_ran_termination_point import ORanTerminationPoint
+from network_generation.model.python.nr_cell_du import NrCellDu
+from network_generation.model.python.o_ran_object import IORanObject
+from network_generation.model.python.o_ran_node import ORanNode
 import xml.etree.ElementTree as ET
 
 
 A Class representing an O-RAN Service Management and Orchestration Framework (SMO)
 """
 from typing import overload
-from model.python.tower import Tower
-from model.python.o_ran_near_rt_ric import ORanNearRtRic
-from model.python.o_ran_object import IORanObject
-from model.python.o_ran_node import ORanNode
-from model.python.hexagon import Hex
-from model.python.o_ran_termination_point import ORanTerminationPoint
-import model.python.hexagon as Hexagon
+from network_generation.model.python.tower import Tower
+from network_generation.model.python.o_ran_near_rt_ric import ORanNearRtRic
+from network_generation.model.python.o_ran_object import IORanObject
+from network_generation.model.python.o_ran_node import ORanNode
+from network_generation.model.python.hexagon import Hex
+from network_generation.model.python.o_ran_termination_point import ORanTerminationPoint
+import network_generation.model.python.hexagon as Hexagon
 import xml.etree.ElementTree as ET
 
 
@@ -14,9 +14,9 @@
 
 #!/usr/bin/python
 
-from model.python.cube import Cube
-from model.python.hexagon import Hex
-import model.python.hexagon as Hexagon
+from network_generation.model.python.cube import Cube
+from network_generation.model.python.hexagon import Hex
+import network_generation.model.python.hexagon as Hexagon
 
 
 class SpiralRadiusProfile:
@@ -18,7 +18,7 @@
 An abstract Class for O-RAN TerminationPoint
 """
 from abc import abstractmethod
-from model.python.o_ran_object import IORanObject, ORanObject
+from network_generation.model.python.o_ran_object import IORanObject, ORanObject
 
 
 # Define the "IORanObject" interface
@@ -19,7 +19,7 @@ An abstract Class for all classes
 """
 import uuid
 from abc import ABC
-from model.python.type_definitions import (
+from network_generation.model.python.type_definitions import (
     AdministrativeState,
     OperationalState,
     UsageState,
@@ -20,10 +20,10 @@ It can be interpreted as 'resource pool' for physical network
 functions.
 """
 from typing import overload
-from model.python.o_ran_object import IORanObject
-from model.python.o_ran_ru import ORanRu
-from model.python.o_ran_node import ORanNode
-from model.python.o_ran_termination_point import ORanTerminationPoint
+from network_generation.model.python.o_ran_object import IORanObject
+from network_generation.model.python.o_ran_ru import ORanRu
+from network_generation.model.python.o_ran_node import ORanNode
+from network_generation.model.python.o_ran_termination_point import ORanTerminationPoint
 import xml.etree.ElementTree as ET
 
 
@@ -18,7 +18,7 @@
 A collection of TypeDefinitions
 """
 from enum import Enum
-from model.python.countries import Country
+from network_generation.model.python.countries import Country
 
 
 # Define AdministrativeState enum
@@ -18,7 +18,7 @@ Provides functions to convert the Network into different formats
 """
 
 import json
-from model.python.o_ran_network import ORanNetwork
+from network_generation.model.python.o_ran_network import ORanNetwork
 import xml.etree.ElementTree as ET
 
 
@@ -70,7 +70,7 @@ class NetworkViewer:
         Method reading the css styles from known file
         return: content of the file as string
         """
-        with open("view/svg.style.css") as styles:
+        with open("network_generation/view/svg.style.css") as styles:
             content = styles.read()
             return content
 
@@ -96,7 +96,7 @@ class NetworkViewer:
         :type filename: string
         """
         root = self.__network.toKml()
-        with open("view/kml.styles.json") as kml_styles:
+        with open("network_generation/view/kml.styles.json") as kml_styles:
             styles: dict[str, dict] = json.load(kml_styles)
             for key, value in styles.items():
                 # add style