Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added basic GNPyWrapper.jl functionalities #3

Merged
merged 8 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 113 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,116 @@
[![Build Status](https://github.com/filchristou/GNPyWrapper.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/filchristou/GNPyWrapper.jl/actions/workflows/CI.yml?query=branch%3Amain)
[![](https://img.shields.io/badge/docs-dev-blue.svg)](https://UniStuttgart-IKR.github.io/GNPyWrapper.jl/dev)

## Introduction

The goal of the GNPyWrapper.jl is to increase the programmabilty of the already existing [GNPy Package](https://gnpy.readthedocs.io/en/master/) ([github page](https://github.com/Telecominfraproject/oopt-gnpy), [pip page](https://pypi.org/project/gnpy/)).

It is mainly written in [Julia](https://julialang.org/) because this language has some advantages. For example speed.

The work was inspired by the *gnpy-transmission-example* provided by the developers of GNPy.

The idea of the GNPyWrapper.jl is to only use the core functionalities of the [GNPy Package](https://gnpy.readthedocs.io/en/master/). This is done by:

- Getting rid of:

- the automatic initialization step of the provided *gnpy-transmission-example*

- and thereby getting rid of json data format and merging process


- Providing:

- network element example descriptions in "native" Julia language

- which were created from *gnpy-transmission-example* with json-data

- from which you can generate gnpy objects and vice versa

- Note: RamanFiber not supported (yet?)

- ATTENTION: RIGHT NOW: only initialization of objects supported, not results (after propagating a signal through element)

- a automatic process from which you can generate element and path descriptions

- ATTENTION: RIGHT NOW: properties of attributes are in Python format

- ATTENTION: RIGHT NOW: full Julia conversion is missing

- two examples

1. "example_01.jl"
2. "example_02.jl"

### Advantages

- interface from Julia to Python for GNPy Package and vice versa

- full control over gnpy elements

- also, better "understanding" of what is going on in the core of GNPy



### Disadvantages

right now:

- less automation


## Installation and Initialization of GNPyWrapper.jl

1. git clone this repo from ...
2. run julia
3. activate the GNPyWrapper.jl
4. install julia specifc packages

1. CondaPkg

> add CondaPkg

> conda add python

2. PythonCall

> add PythonCall

5. install GNPy from pip

> conda pip_add gnpy






## Examples

First example

- Set up:

- you need to copy *cli_example_02* and paste it in the correct folder of GNPy (gnpy.core.tools) next to *cli_example*

- From Julia run:

> include("example_01.jl")

Second example

- Set up:

- you need to copy *cli_example_02* and paste it in the correct folder of GNPy (gnpy.core.tools) next to *cli_example*

- From Julia run:

> include("example_02.jl")

## Additional information

Since the GNPyWrapper.jl was developed in two stages:

1. Testing the Wrapper ideas with a GNPyWrapper written in Python (Proof of Concept)
2. Implementing those ideas in the GNPyWrapper.jl in Julia

maybe in the future there will also launch an usable GNPyWrapper written in Python.
85 changes: 85 additions & 0 deletions src/GNPyWrapper.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,96 @@
module GNPyWrapper

using PythonCall

using DocStringExtensions

export DummyStruct
export dummymult10, dummyfunction

export dummyfunction_02



export second_layer_fiber_des

export fiber_des

export transceiver_des

export edfa_des

export roadm_des

export fused_des

#functions for creating
export fiber_obj
# test pythoncall stuff
export fiber_obj_02

export py_dir_funct

export py_dir_funct_02
export py_get_attr
export py_set_attr

export fiber_example_des

export transceiver_obj

export spectral_information_example_des

export spectral_information_obj

export transceiver_example_des

export edfa_operational_obj

export edfa_params_obj

export edfa_obj

export edfa_example_des

export create_full_path_des_from_cli_examples_02

export roadm_obj

export fused_obj

export create_full_real_path




# export fiber_des,fiber_obj
# export transceiver_des, transceiver_obj
# export fused_des, fused_obj
# export roadm_des, roadm_obj
# export edfa_des, edfa_obj

# Write your package code here.
include("examplefile.jl")


# #newly added
# include("a_initialize_phase/create_description.jl")

# include("a_initialize_phase/create_gnpy_object.jl")

# include("a_initialize_phase/from_json_get_list_of_objects_in_path.jl")

include("examplefile_02.jl")

include("a_initialize_phase/examplefile_03.jl")
include("a_initialize_phase/create_description.jl")
include("a_initialize_phase/create_object.jl")
include("z_python_auxiliary_functions/analye_py_obj.jl")
include("examples/gnpy_object_descriptions.jl")

include("a_initialize_phase/create_full_path_description.jl")
include("a_initialize_phase/create_path.jl")

end


Loading
Loading