Move all business logic code under template folder
- move all python code
- change references
Issue-ID: OAM-385
Change-Id: I7cef9ec4bff10ccfa81c1bf52d7b6078da460954
Signed-off-by: Martin Skorupski <martin.skorupski@highstreet-technologies.com>
diff --git a/code/network-generator/network_generation/VERSION b/code/network-generator/network_generation/VERSION
new file mode 100644
index 0000000..6e8bf73
--- /dev/null
+++ b/code/network-generator/network_generation/VERSION
@@ -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
index 0000000..44927f3
--- /dev/null
+++ b/code/network-generator/network_generation/base.py
@@ -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"
diff --git a/code/network-generator/controller/network_generator.py b/code/network-generator/network_generation/controller/network_generator.py
similarity index 95%
rename from code/network-generator/controller/network_generator.py
rename to code/network-generator/network_generation/controller/network_generator.py
index 429d82b..6c5759b 100644
--- a/code/network-generator/controller/network_generator.py
+++ b/code/network-generator/network_generation/controller/network_generator.py
@@ -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:
diff --git a/code/network-generator/controller/parameter_validator.py b/code/network-generator/network_generation/controller/parameter_validator.py
similarity index 100%
rename from code/network-generator/controller/parameter_validator.py
rename to code/network-generator/network_generation/controller/parameter_validator.py
diff --git a/code/network-generator/model/jsonSchema/configuration.schema.json b/code/network-generator/network_generation/model/jsonSchema/configuration.schema.json
similarity index 100%
rename from code/network-generator/model/jsonSchema/configuration.schema.json
rename to code/network-generator/network_generation/model/jsonSchema/configuration.schema.json
diff --git a/code/network-generator/model/python/countries.py b/code/network-generator/network_generation/model/python/countries.py
similarity index 100%
rename from code/network-generator/model/python/countries.py
rename to code/network-generator/network_generation/model/python/countries.py
diff --git a/code/network-generator/model/python/cube.py b/code/network-generator/network_generation/model/python/cube.py
similarity index 97%
rename from code/network-generator/model/python/cube.py
rename to code/network-generator/network_generation/model/python/cube.py
index f709bd7..0d4e2a3 100644
--- a/code/network-generator/model/python/cube.py
+++ b/code/network-generator/network_generation/model/python/cube.py
@@ -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:
diff --git a/code/network-generator/model/python/geo_location.py b/code/network-generator/network_generation/model/python/geo_location.py
similarity index 98%
rename from code/network-generator/model/python/geo_location.py
rename to code/network-generator/network_generation/model/python/geo_location.py
index 0dd344b..a94d5e7 100644
--- a/code/network-generator/model/python/geo_location.py
+++ b/code/network-generator/network_generation/model/python/geo_location.py
@@ -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:
diff --git a/code/network-generator/model/python/hexagon.py b/code/network-generator/network_generation/model/python/hexagon.py
similarity index 98%
rename from code/network-generator/model/python/hexagon.py
rename to code/network-generator/network_generation/model/python/hexagon.py
index e268187..489b294 100644
--- a/code/network-generator/model/python/hexagon.py
+++ b/code/network-generator/network_generation/model/python/hexagon.py
@@ -22,8 +22,8 @@
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:
diff --git a/code/network-generator/model/python/nr_cell_du.py b/code/network-generator/network_generation/model/python/nr_cell_du.py
similarity index 91%
rename from code/network-generator/model/python/nr_cell_du.py
rename to code/network-generator/network_generation/model/python/nr_cell_du.py
index 3f090ae..b104267 100644
--- a/code/network-generator/model/python/nr_cell_du.py
+++ b/code/network-generator/network_generation/model/python/nr_cell_du.py
@@ -19,12 +19,12 @@
"""
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
diff --git a/code/network-generator/model/python/o_ran_cloud_du.py b/code/network-generator/network_generation/model/python/o_ran_cloud_du.py
similarity index 89%
rename from code/network-generator/model/python/o_ran_cloud_du.py
rename to code/network-generator/network_generation/model/python/o_ran_cloud_du.py
index 2581920..ab72f72 100644
--- a/code/network-generator/model/python/o_ran_cloud_du.py
+++ b/code/network-generator/network_generation/model/python/o_ran_cloud_du.py
@@ -21,13 +21,13 @@
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
diff --git a/code/network-generator/model/python/o_ran_cu.py b/code/network-generator/network_generation/model/python/o_ran_cu.py
similarity index 89%
rename from code/network-generator/model/python/o_ran_cu.py
rename to code/network-generator/network_generation/model/python/o_ran_cu.py
index e2f5520..484fc00 100644
--- a/code/network-generator/model/python/o_ran_cu.py
+++ b/code/network-generator/network_generation/model/python/o_ran_cu.py
@@ -19,14 +19,14 @@
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
diff --git a/code/network-generator/model/python/o_ran_du.py b/code/network-generator/network_generation/model/python/o_ran_du.py
similarity index 93%
rename from code/network-generator/model/python/o_ran_du.py
rename to code/network-generator/network_generation/model/python/o_ran_du.py
index 7f1e5c6..96baab1 100644
--- a/code/network-generator/model/python/o_ran_du.py
+++ b/code/network-generator/network_generation/model/python/o_ran_du.py
@@ -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
diff --git a/code/network-generator/model/python/o_ran_near_rt_ric.py b/code/network-generator/network_generation/model/python/o_ran_near_rt_ric.py
similarity index 89%
rename from code/network-generator/model/python/o_ran_near_rt_ric.py
rename to code/network-generator/network_generation/model/python/o_ran_near_rt_ric.py
index f533328..b556f3c 100644
--- a/code/network-generator/model/python/o_ran_near_rt_ric.py
+++ b/code/network-generator/network_generation/model/python/o_ran_near_rt_ric.py
@@ -18,13 +18,13 @@
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
diff --git a/code/network-generator/model/python/o_ran_network.py b/code/network-generator/network_generation/model/python/o_ran_network.py
similarity index 91%
rename from code/network-generator/model/python/o_ran_network.py
rename to code/network-generator/network_generation/model/python/o_ran_network.py
index 4576530..be61796 100644
--- a/code/network-generator/model/python/o_ran_network.py
+++ b/code/network-generator/network_generation/model/python/o_ran_network.py
@@ -16,12 +16,12 @@
"""
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
diff --git a/code/network-generator/model/python/o_ran_node.py b/code/network-generator/network_generation/model/python/o_ran_node.py
similarity index 90%
rename from code/network-generator/model/python/o_ran_node.py
rename to code/network-generator/network_generation/model/python/o_ran_node.py
index 219b2c4..ba9b0e8 100644
--- a/code/network-generator/model/python/o_ran_node.py
+++ b/code/network-generator/network_generation/model/python/o_ran_node.py
@@ -21,14 +21,14 @@
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,
)
diff --git a/code/network-generator/model/python/o_ran_object.py b/code/network-generator/network_generation/model/python/o_ran_object.py
similarity index 94%
rename from code/network-generator/model/python/o_ran_object.py
rename to code/network-generator/network_generation/model/python/o_ran_object.py
index 3cc8a81..3e367a6 100644
--- a/code/network-generator/model/python/o_ran_object.py
+++ b/code/network-generator/network_generation/model/python/o_ran_object.py
@@ -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
diff --git a/code/network-generator/model/python/o_ran_ru.py b/code/network-generator/network_generation/model/python/o_ran_ru.py
similarity index 93%
rename from code/network-generator/model/python/o_ran_ru.py
rename to code/network-generator/network_generation/model/python/o_ran_ru.py
index 02ad0c2..7783d87 100644
--- a/code/network-generator/model/python/o_ran_ru.py
+++ b/code/network-generator/network_generation/model/python/o_ran_ru.py
@@ -19,11 +19,11 @@
"""
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
diff --git a/code/network-generator/model/python/o_ran_smo.py b/code/network-generator/network_generation/model/python/o_ran_smo.py
similarity index 89%
rename from code/network-generator/model/python/o_ran_smo.py
rename to code/network-generator/network_generation/model/python/o_ran_smo.py
index ee0de31..7320bad 100644
--- a/code/network-generator/model/python/o_ran_smo.py
+++ b/code/network-generator/network_generation/model/python/o_ran_smo.py
@@ -18,13 +18,13 @@
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
diff --git a/code/network-generator/model/python/o_ran_spiral_radius_profile.py b/code/network-generator/network_generation/model/python/o_ran_spiral_radius_profile.py
similarity index 98%
rename from code/network-generator/model/python/o_ran_spiral_radius_profile.py
rename to code/network-generator/network_generation/model/python/o_ran_spiral_radius_profile.py
index a47a486..185c0f2 100644
--- a/code/network-generator/model/python/o_ran_spiral_radius_profile.py
+++ b/code/network-generator/network_generation/model/python/o_ran_spiral_radius_profile.py
@@ -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:
diff --git a/code/network-generator/model/python/o_ran_termination_point.py b/code/network-generator/network_generation/model/python/o_ran_termination_point.py
similarity index 96%
rename from code/network-generator/model/python/o_ran_termination_point.py
rename to code/network-generator/network_generation/model/python/o_ran_termination_point.py
index 6d575e7..e7fe98a 100644
--- a/code/network-generator/model/python/o_ran_termination_point.py
+++ b/code/network-generator/network_generation/model/python/o_ran_termination_point.py
@@ -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
diff --git a/code/network-generator/model/python/point.py b/code/network-generator/network_generation/model/python/point.py
similarity index 100%
rename from code/network-generator/model/python/point.py
rename to code/network-generator/network_generation/model/python/point.py
diff --git a/code/network-generator/model/python/top.py b/code/network-generator/network_generation/model/python/top.py
similarity index 98%
rename from code/network-generator/model/python/top.py
rename to code/network-generator/network_generation/model/python/top.py
index 82701e5..214a773 100644
--- a/code/network-generator/model/python/top.py
+++ b/code/network-generator/network_generation/model/python/top.py
@@ -19,7 +19,7 @@
"""
import uuid
from abc import ABC
-from model.python.type_definitions import (
+from network_generation.model.python.type_definitions import (
AdministrativeState,
OperationalState,
UsageState,
diff --git a/code/network-generator/model/python/tower.py b/code/network-generator/network_generation/model/python/tower.py
similarity index 93%
rename from code/network-generator/model/python/tower.py
rename to code/network-generator/network_generation/model/python/tower.py
index d012e32..f7135ee 100644
--- a/code/network-generator/model/python/tower.py
+++ b/code/network-generator/network_generation/model/python/tower.py
@@ -20,10 +20,10 @@
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
diff --git a/code/network-generator/model/python/type_definitions.py b/code/network-generator/network_generation/model/python/type_definitions.py
similarity index 96%
rename from code/network-generator/model/python/type_definitions.py
rename to code/network-generator/network_generation/model/python/type_definitions.py
index fa91596..43a7162 100644
--- a/code/network-generator/model/python/type_definitions.py
+++ b/code/network-generator/network_generation/model/python/type_definitions.py
@@ -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
diff --git a/code/network-generator/view/kml.styles.json b/code/network-generator/network_generation/view/kml.styles.json
similarity index 100%
rename from code/network-generator/view/kml.styles.json
rename to code/network-generator/network_generation/view/kml.styles.json
diff --git a/code/network-generator/view/network_viewer.py b/code/network-generator/network_generation/view/network_viewer.py
similarity index 94%
rename from code/network-generator/view/network_viewer.py
rename to code/network-generator/network_generation/view/network_viewer.py
index 8e0fa0e..6610251 100644
--- a/code/network-generator/view/network_viewer.py
+++ b/code/network-generator/network_generation/view/network_viewer.py
@@ -18,7 +18,7 @@
"""
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 @@
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 @@
: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
diff --git a/code/network-generator/view/svg.style.css b/code/network-generator/network_generation/view/svg.style.css
similarity index 100%
rename from code/network-generator/view/svg.style.css
rename to code/network-generator/network_generation/view/svg.style.css