Clean the folder structure and remove unused files
Main_splitter.py
Can remove unused imports and commented code
rpc method name can be renamed from hello
Add some documentation to the code
Add error handling
Currently only sonataUtilityFunctions is used here? and OSMUtilityFunctions is imported and not used anywhere? not sure what this means.
sonataUtilityFunctions.get_data_sonata this function seems to be redundant, the functionality of this can be put into init of utility. and call the function like this sonataUtilityFunctions = utility(received_file_sonata)
SonataUtilityFunctions.py and OSMUtilityFunctions.py
Refering to the previous comment get_data_sonata function can be removed and the functionality can be put as part of the __init__ function.
call_functions function can also be removed and the functions can be directly called from __init__
Can make the docstrings of the functions according to PEP8, which will help in automated documentation
Add some comments about the for loops about their purpose, like "Extracting nsd here"
Add error handling
SonataSplitter.py and OSMSplitter.py
Fix imports and references. If you want to import so many functions from a module, you should probably import the whole module and dot reference the functions inside. Meaning you can replace from SonataSchema import NSD,NetworkFunction,ConnectionPoint,VirtualLink,ForwardingGraphs,NetworkForwardingPaths,ConnectionPointsGraph with import SonataSchema and then call the functions like SonataSchema.ConnectionPointsGraph
Add error handling
SonataSchema.py and SonataSchema.py
Many classes are defined here with only __init__, maybe this is not the best design unless you have a strong reason.
These classes and class variables are used in SonataSplitter.py mainly for information storage and it is directly altered and used. Is this necessary?
The classes seem to have class variables and instance variables with the same names. I think you can remove these class variables as it is not used anywhere.
__init__ functions are taking too many comma separated values. this will cause issues for further development and looks bad. Use a dict here and pass the dict between functions.
Variable names like id and type are python built-in names, you should avoid this. can be replaced with, for example _id and _type
Fetchfile.py
This can be more modular, can use a class to manage this
Splitter Code Review
Review done on the following commit - https://github.com/CN-UPB/pg-scrambLe/tree/fdba41c7050b4798bc4cfb2a0901b01744edb883/src/splitter
Generic
Main_splitter.py
sonataUtilityFunctions.get_data_sonata
this function seems to be redundant, the functionality of this can be put into init ofutility
. and call the function like thissonataUtilityFunctions = utility(received_file_sonata)
SonataUtilityFunctions.py and OSMUtilityFunctions.py
get_data_sonata
function can be removed and the functionality can be put as part of the__init__
function.call_functions
function can also be removed and the functions can be directly called from__init__
SonataSplitter.py and OSMSplitter.py
from SonataSchema import NSD,NetworkFunction,ConnectionPoint,VirtualLink,ForwardingGraphs,NetworkForwardingPaths,ConnectionPointsGraph
withimport SonataSchema
and then call the functions likeSonataSchema.ConnectionPointsGraph
SonataSchema.py and SonataSchema.py
__init__
, maybe this is not the best design unless you have a strong reason.SonataSplitter.py
mainly for information storage and it is directly altered and used. Is this necessary?__init__
functions are taking too many comma separated values. this will cause issues for further development and looks bad. Use a dict here and pass the dict between functions.id
andtype
are python built-in names, you should avoid this. can be replaced with, for example_id
and_type
Fetchfile.py