Ejemplo n.º 1
0
def insert_numeric_measurement(epoch, sources, devices, name, data_frame):
    """Inserts a `dict` of Quantities (NumPy) arrays as a numeric `Measurement` on the given `Epoch`

    Parameters
    ----------
    epoch : us.physion.ovation.domain.Epoch
    sources : set
        `Source` names in the `Epoch`
    devices : set
        Device names in the `Epoch's` containing experiment
    name : string
        `Measurement` name
    data_frame : dict of pq.Quantity
        Quantity (NumPy) array with `labels` and `sampling_rate` properties

    Returns
    -------
    measurement : us.physion.ovation.domain.Measurement
         Numeric `Measurement` instance containing the given data frame
    """

    tmp = _make_temp_numeric_file(data_frame, name)

    return epoch.insertMeasurement(name,
                                   to_java_set(sources),
                                   to_java_set(devices),
                                   File(tmp.name).toURI().toURL(),
                                   NumericDataElements.NUMERIC_MEASUREMENT_CONTENT_TYPE)
Ejemplo n.º 2
0
def to_java_set_should_convert_set():
    s = set([1, 2, 'abc'])
    j = to_java_set(s)
    for item in s:
        assert_true(j.contains(box_number(item)))