Skip to content

Upload API Parametric filters

APIUploadParametric

Bases: APIUploadInternal

Exposes functions for uploading parametric filters to the server.

Source code in src/rmlab/api/upload/parametric/filters.py
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
class APIUploadParametric(APIUploadInternal):
    """Exposes functions for uploading parametric filters to the server."""

    async def upload_parametric_filters(self, scen_id: int, filters: Union[str, list]) -> None:
        """Upload a set of parametric filters defined in a file.

        ```json
        {"json": "example"}
        ```

        Args:
            scen_id (int): Scenario ID
            filters: Parametric filters as file (csv or json) or as json list

        Raises:
            ValueError: If file extension is invalid
            FileNotFoundError: If file does not exist
        """

        await self._upload_bounded_items(
            scen_id=scen_id, category=PFilter, items=filters
        )

upload_parametric_filters(scen_id, filters) async

Upload a set of parametric filters defined in a file.

{"json": "example"}

Parameters:

NameTypeDescriptionDefault
scen_idint

Scenario ID

required
filtersUnion[str, list]

Parametric filters as file (csv or json) or as json list

required

Raises:

TypeDescription
ValueError

If file extension is invalid

FileNotFoundError

If file does not exist

Source code in src/rmlab/api/upload/parametric/filters.py
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
async def upload_parametric_filters(self, scen_id: int, filters: Union[str, list]) -> None:
    """Upload a set of parametric filters defined in a file.

    ```json
    {"json": "example"}
    ```

    Args:
        scen_id (int): Scenario ID
        filters: Parametric filters as file (csv or json) or as json list

    Raises:
        ValueError: If file extension is invalid
        FileNotFoundError: If file does not exist
    """

    await self._upload_bounded_items(
        scen_id=scen_id, category=PFilter, items=filters
    )