Commit 50b2af9e authored by Adrian Pino's avatar Adrian Pino Committed by GitHub
Browse files

Merge pull request #90 from SunriseOpenOperatorPlatform/hotfix/import-and-docs-cleanup

Hotfix/import and docs cleanup
parents 8bbf5647 f2041548
Loading
Loading
Loading
Loading
+11 −37
Original line number Diff line number Diff line
@@ -54,45 +54,24 @@ pip install sunrise6g-opensdk
If you plan to modify the SDK:

```bash
git clone https://github.com/<your-org>/sunrise6g-opensdk.git
cd sunrise6g-opensdk
git clone https://github.com/SunriseOpenOperatorPlatform/open-sdk.git
cd open-sdk
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pip intall -e .
```

### Basic Usage

You can use the SDK by simply specifying the adapters to be used. E.g. i2Edge and Open5gs
You can use the SDK by simply specifying the adapters to be used. E.g. Edge Cloud Platform: i2Edge, 5G core: Open5Gs

Example available in [`/examples/example.py`](examples/example.py)

```python
from sunrise6g_opensdk import Sdk as sdkclient

def main():
    client_specs = {
        "edgecloud": {
            "client_name": "i2edge",
            "base_url": "http://IP:PORT",
        },
        "network": {
            "client_name": "open5gs",
            "base_url": "http://IP:PORT",
            "scs_as_id": "id_example",
        },
    }

    clients = sdkclient.create_clients_from(client_specs)
    edgecloud_client = clients.get("edgecloud")
    network_client = clients.get("network")

    print(edgecloud_client.get_edge_cloud_zones())
    print(network_client.get_qod_session(session_id="example_session_id"))


if __name__ == "__main__":
    main()
python3 -m examples.example
```

Example available in [`/examples/example.py`](examples/example.py)

---

## How to Contribute
@@ -107,16 +86,11 @@ To get started:
4. Ensure all tests and pre-commit checks pass.
5. Submit a pull request with a clear description.

Please follow our full [Contributing Guidelines](docs/CONTRIBUTING.md) for details on:
- Directory structure
- Branch naming conventions
- Coding standards (PEP8, docstrings)
- Pre-commit setup
- Reporting issues
Please follow our full [Contributing Guidelines](docs/CONTRIBUTING.md) for further details.

---

## Example Workflow (Mermaid)
## Example Workflow

```mermaid
sequenceDiagram
+2 −1
Original line number Diff line number Diff line
from sunrise6g_opensdk import Sdk as sdkclient
# from sunrise6g_opensdk import Sdk as sdkclient # For PyPI users
from sunrise6g_opensdk.common.sdk import Sdk as sdkclient  # For developers


def main():
+2 −2
Original line number Diff line number Diff line
@@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"

[project]
name = "sunrise6g-opensdk"
version = "0.9.2"
description = "Open source SDK to abstract CAMARA/GSMA Transformation Functions (TFs) for Edge Cloud platforms, 5G network cores and Open RAN."
version = "0.0.1"
description = "Open source SDK to abstract CAMARA/GSMA Transformation Functions (TFs) for Edge Cloud platforms, 5G network cores and Open RAN solutions."
keywords = [
  "Federation",
  "Transformation Functions",
+3 −3
Original line number Diff line number Diff line
# -*- coding: utf-8 -*-
import pytest

from sunrise6g_opensdk.common.sdk_catalog_client import SdkCatalogClient
from sunrise6g_opensdk.common.sdk import Sdk as sdkclient
from sunrise6g_opensdk.network.clients.open5gs.client import NetworkManager

OPEN5GS_TEST_CASES = [
@@ -21,7 +21,7 @@ OPEN5GS_TEST_CASES = [
    ids=["open5gs"],
)
def test_valid_input_open5gs(client_specs):
    network_client: NetworkManager = SdkCatalogClient.create_clients_from(client_specs)[
    network_client: NetworkManager = sdkclient.create_clients_from(client_specs)[
        "network"
    ]

@@ -46,7 +46,7 @@ def test_valid_input_open5gs(client_specs):
    ids=["open5gs"],
)
def test_create_qod_session_open5gs(client_specs):
    network_client: NetworkManager = SdkCatalogClient.create_clients_from(client_specs)[
    network_client: NetworkManager = sdkclient.create_clients_from(client_specs)[
        "network"
    ]

+3 −7
Original line number Diff line number Diff line
# # -*- coding: utf-8 -*-
import pytest

from sunrise6g_opensdk.network.core.network_factory import NetworkClientFactory
from sunrise6g_opensdk.common.sdk import Sdk as sdkclient

test_cases = [("oai", "http://127.0.0.1/", "scs-oai")]


@pytest.mark.parametrize("client_name, base_url, scs_as_id", test_cases)
def test_valid_input(client_name, base_url, scs_as_id):
    network_client = NetworkClientFactory.create_network_client(
        client_name, base_url, scs_as_id
    )
    network_client = sdkclient.create_network_client(client_name, base_url, scs_as_id)

    ti_session = {
        "device": {
@@ -26,9 +24,7 @@ def test_valid_input(client_name, base_url, scs_as_id):

@pytest.mark.parametrize("client_name, base_url, scs_as_id", test_cases)
def test_create_traffic_influence(client_name, base_url, scs_as_id):
    network_client = NetworkClientFactory.create_network_client(
        client_name, base_url, scs_as_id
    )
    network_client = sdkclient.create_network_client(client_name, base_url, scs_as_id)

    ti_session = {
        "device": {