sql_queries module

sql_queries.generate_data_query(where_clause: ColumnElement, value_label: str = 'value', vectorName: bool = False, moduleName: bool = True, simtimeRaw: bool = True, eventNumber: bool = False)[source]
sql_queries.generate_scalar_data_query(where_clause: ColumnElement, value_label: str = 'scalarValue', runId: bool = True, moduleName: bool = True, scalarName: bool = False, scalarId: bool = False)[source]
sql_queries.generate_scalar_like_query(scalar_name: str, value_label: str = 'scalarValue', runId: bool = True, moduleName: bool = True, scalarName: bool = False, scalarId: bool = False)[source]
sql_queries.generate_scalar_query(scalar_name: str, value_label: str = 'scalarValue', runId: bool = True, moduleName: bool = True, scalarName: bool = False, scalarId: bool = False)[source]
sql_queries.generate_signal_for_module_query(signal_name: str, module_name: str, value_label='value', moduleName: bool = True, simtimeRaw: bool = True, eventNumber: bool = False)[source]

Extract the data for the signal given by signal_name for the given moduleName only

sql_queries.generate_signal_like_query(signal_name_pattern: str, value_label: str = 'value', vectorName: bool = False, moduleName: bool = True, simtimeRaw: bool = True, eventNumber: bool = False)[source]
sql_queries.generate_signal_query(signal_name: str, value_label: str = 'value', moduleName: bool = True, simtimeRaw: bool = True, eventNumber: bool = False)[source]
sql_queries.generate_statistic_data_query(where_clause: ColumnElement, statId: bool = True, runId: bool = True, moduleName: bool = True, statName: bool = True, isHistogram: bool = True, isWeighted: bool = True, statCount: bool = True, statMean: bool = True, statStddev: bool = True, statSum: bool = True, statSqrsum: bool = True, statMin: bool = True, statMax: bool = True, statWeights: bool = True, statWeightedSum: bool = True, statSqrSumWeights: bool = True, statWeightedSqrSum: bool = True)[source]
sql_queries.generate_statistic_query(statistic_name: str, statId: bool = True, runId: bool = True, moduleName: bool = True, statName: bool = True, isHistogram: bool = True, isWeighted: bool = True, statCount: bool = True, statMean: bool = True, statStddev: bool = True, statSum: bool = True, statSqrsum: bool = True, statMin: bool = True, statMax: bool = True, statWeights: bool = True, statWeightedSum: bool = True, statSqrSumWeights: bool = True, statWeightedSqrSum: bool = True)[source]
sql_queries.get_signal_with_position(x_signal: str, y_signal: str, value_label_px: str, value_label_py: str, signal_name: str, value_label: str, restriction: tuple | None = None, moduleName: bool = True, simtimeRaw: bool = True, eventNumber: bool = False)[source]

Get all the signal data for the signal with the name signal_name within the rectangle described by the tuple given in restriction.

The equivalent SQL query:

WITH pxvids
AS (SELECT vectorId, moduleName FROM vector AS v WHERE vectorName == '<positionX>'),
pyvids
AS (SELECT vectorId, moduleName FROM vector AS v WHERE vectorName == '<positionY>'),
pys AS
    (SELECT moduleName, eventNumber, simtimeRaw, value AS posY
     FROM
        pyvids
     JOIN vectorData AS vd
        ON vd.vectorId == pyvids.vectorId
    WHERE vd.value < <y_max> AND vd.value > <y_min>
    ),
pxs AS
    (SELECT moduleName, eventNumber, simtimeRaw, value AS posX
     FROM
        pxvids
     JOIN vectorData AS vd
        ON vd.vectorId == pxvids.vectorId
    WHERE vd.value < <x_max> AND vd.value > <x_min>
     ),
pos AS
    (SELECT pxs.moduleName, pxs.eventNumber, pxs.simtimeRaw, posX, posY
     FROM
         pxs
     JOIN
         pys
         ON pxs.eventNumber == pys.eventNumber
    ),
val AS
    (SELECT vd.vectorId, vd.eventNumber, vd.value
     FROM vector AS v
     JOIN vectorData AS vd
        ON v.vectorId == vd.vectorId
     WHERE v.vectorName == '<signal_name>'
    )
SELECT p.moduleName, p.eventNumber, p.simtimeRaw, posX, posY, v.value
FROM pos AS p
JOIN val AS v
    ON p.vectorId == v.vectorId
        AND p.eventNumber == v.eventNumber
    ;
Parameters:
x_signalstr

The name of the signal containing the x-coordinate data

y_signalstr

The name of the signal containing the y-coordinate data

value_label_pxstr

The name for the x-coordinate in the output

value_label_pystr

The name for the y-coordinate in the output

signal_namestr

The name of the signal to extract

value_labelstr

The name for the signal in the output

restrictiontuple

The selection rectangle, defined as (x_min, y_min, x_max, y_max)

moduleNamebool

Whether to include the moduleName in the output

simtimeRawbool

Whether to include the simtimeRaw in the output

eventNumberbool

Whether to include the eventNumber in the output

sql_queries.run_attr_query = <sqlalchemy.sql.selectable.Select object>

Query the runParam table and return all the rows contained in it. The equivalent SQL query:

SELECT paramKey, paramValue FROM runParam;
sql_queries.run_config_query = <sqlalchemy.sql.selectable.Select object>

Query the vector table and return all the `vectorName`s contained in it. The equivalent SQL query:

SELECT vectorName FROM vector_table;
sql_queries.run_param_query = <sqlalchemy.sql.selectable.Select object>

Query the runConfig table and return all the rows contained in it. For OMNeT++ versions >= 6. The equivalent SQL query:

SELECT configKey, configValue FROM runConfig;
sql_queries.scalar_table_query = <sqlalchemy.sql.selectable.Select object>

Query the scalar table and return all the rows contained in it. The equivalent SQL query:

SELECT * FROM statistic;
sql_queries.signal_names_query = <sqlalchemy.sql.selectable.Select object>

Query the scalar table and return all the rows contained in it. The equivalent SQL query:

SELECT * FROM scalar;