def test_file():
    if __file__.startswith("./"):
        fname = "s" + __file__[3:-3] + ".nwb"
    else:
        fname = "s" + __file__[1:-3] + ".nwb"
    create_iface_series(fname, True)
    name1 = "Ones"
    ut.verify_timeseries(fname, name1, "processing/test module/BehavioralEvents", "TimeSeries")
Ejemplo n.º 2
0
def test_nodata_series():
    if __file__.startswith("./"):
        fname = "x" + __file__[3:-3] + ".nwb"
    else:
        fname = "x" + __file__[1:-3] + ".nwb"
    name = "nodata"
    create_nodata_series(fname, name, "acquisition")
    ut.verify_timeseries(fname, name, "acquisition/timeseries", "TimeSeries")
    ut.verify_absent(fname, "acquisition/timeseries/"+name, "data")
Ejemplo n.º 3
0
def test_file():
    if __file__.startswith("./"):
        fname = "s" + __file__[3:-3] + ".nwb"
    else:
        fname = "s" + __file__[1:-3] + ".nwb"
    create_iface_series(fname, True)
    name1 = "Ones"
    ut.verify_timeseries(fname, name1,
                         "processing/test module/BehavioralEvents",
                         "TimeSeries")
Ejemplo n.º 4
0
def test_nodata_series():
    if __file__.startswith("./"):
        fname = "s" + __file__[3:-3] + ".nwb"
    else:
        fname = "s" + __file__[1:-3] + ".nwb"
    name = "nodata"
    # create_nodata_series(fname, name, "acquisition")
    create_nodata_series(fname, name, "/acquisition/timeseries")
    ut.verify_timeseries(fname, name, "acquisition/timeseries", "TimeSeries")
    ut.verify_absent(fname, "acquisition/timeseries/" + name, "data")
Ejemplo n.º 5
0
def test_nodata_series():
    if __file__.startswith("./"):
        fname = "x" + __file__[3:-3] + ".nwb"
    else:
        fname = "x" + __file__[1:-3] + ".nwb"
    name = "starting_time"
    create_startingtime_series(fname, name, "acquisition")
    ut.verify_timeseries(fname, name, "acquisition/timeseries", "TimeSeries")
    ut.verify_absent(fname, "acquisition/timeseries/"+name, "timestamps")
    val = ut.verify_present(fname, "acquisition/timeseries/"+name, "starting_time")
    if val != 0.125:
        ut.error("Checking start time", "Incorrect value")
    val = ut.verify_attribute_present(fname, "acquisition/timeseries/starting_time/"+name, "rate")
    if val != 2:
        ut.error("Checking rate", "Incorrect value")
Ejemplo n.º 6
0
def test_softlink():
    if __file__.startswith("./"):
        fname1 = "x" + __file__[3:-3] + "1" + ".nwb"
        fname2 = "x" + __file__[3:-3] + "2" + ".nwb"
    else:
        fname1 = "x" + __file__[1:-3] + "1" + ".nwb"
        fname2 = "x" + __file__[1:-3] + "2" + ".nwb"
    name1 = "softlink_source"
    name2 = "softlink_reader"
    create_softlink_source(fname1, name1, "acquisition")
    create_softlink_reader(fname2, name2, fname1, name1, "acquisition")
    #
    ut.verify_timeseries(fname1, name1, "acquisition/timeseries", "TimeSeries")
    ut.verify_timeseries(fname2, name2, "acquisition/timeseries", "TimeSeries")
    ##
    val = ut.verify_present(fname2, "acquisition/timeseries/" + name2, "data")
Ejemplo n.º 7
0
def test_softlink():
    if __file__.startswith("./"):
        fname1 = "x" + __file__[3:-3] + "1" + ".nwb"
        fname2 = "x" + __file__[3:-3] + "2" + ".nwb"
    else:
        fname1 = "x" + __file__[1:-3] + "1" + ".nwb"
        fname2 = "x" + __file__[1:-3] + "2" + ".nwb"
    name1 = "softlink_source"
    name2 = "softlink_reader"
    create_softlink_source(fname1, name1, "acquisition")
    create_softlink_reader(fname2, name2, fname1, name1, "acquisition")
    #
    ut.verify_timeseries(fname1, name1, "acquisition/timeseries", "TimeSeries")
    ut.verify_timeseries(fname2, name2, "acquisition/timeseries", "TimeSeries")
    ##
    val = ut.verify_present(fname2, "acquisition/timeseries/"+name2, "data")
Ejemplo n.º 8
0
def test_nodata_series():
    if __file__.startswith("./"):
        fname = "x" + __file__[3:-3] + ".nwb"
    else:
        fname = "x" + __file__[1:-3] + ".nwb"
    name = "starting_time"
    create_startingtime_series(fname, name, "acquisition")
    ut.verify_timeseries(fname, name, "acquisition/timeseries", "TimeSeries")
    ut.verify_absent(fname, "acquisition/timeseries/" + name, "timestamps")
    val = ut.verify_present(fname, "acquisition/timeseries/" + name,
                            "starting_time")
    if val != 0.125:
        ut.error("Checking start time", "Incorrect value")
    val = ut.verify_attribute_present(
        fname, "acquisition/timeseries/starting_time/" + name, "rate")
    if val != 2:
        ut.error("Checking rate", "Incorrect value")
Ejemplo n.º 9
0
def test_annotation_series():
    if __file__.startswith("./"):
        fname = "x" + __file__[3:-3] + ".nwb"
    else:
        fname = "x" + __file__[1:-3] + ".nwb"
    name = "annot"
    create_annotation_series(fname, name, "acquisition")
    ut.verify_timeseries(fname, name, "acquisition/timeseries", "TimeSeries")
    ut.verify_timeseries(fname, name, "acquisition/timeseries", "AnnotationSeries")
    create_annotation_series(fname, name, "stimulus")
    ut.verify_timeseries(fname, name, "stimulus/presentation", "TimeSeries")
    ut.verify_timeseries(fname, name, "stimulus/presentation", "AnnotationSeries")
Ejemplo n.º 10
0
def test_append():
    if __file__.startswith("./"):
        fname = "x" + __file__[3:-3] + ".nwb"
    else:
        fname = "x" + __file__[1:-3] + ".nwb"
    name1 = "annot1"
    name2 = "annot2"
    create_annotation_series(fname, name1, "acquisition", True)
    create_annotation_series(fname, name2, "acquisition", False)
    ut.verify_timeseries(fname, name1, "acquisition/timeseries", "TimeSeries")
    ut.verify_timeseries(fname, name1, "acquisition/timeseries", "AnnotationSeries")
    ut.verify_timeseries(fname, name2, "acquisition/timeseries", "TimeSeries")
    ut.verify_timeseries(fname, name2, "acquisition/timeseries", "AnnotationSeries")
    ut.verify_attribute_present(fname, "file_create_date", "modification_time")
Ejemplo n.º 11
0
def test_annotation_series():
    if __file__.startswith("./"):
        fname = "x" + __file__[3:-3] + ".nwb"
    else:
        fname = "x" + __file__[1:-3] + ".nwb"
    name = "annot"
    create_annotation_series(fname, name, "acquisition")
    ut.verify_timeseries(fname, name, "acquisition/timeseries", "TimeSeries")
    ut.verify_timeseries(fname, name, "acquisition/timeseries",
                         "AnnotationSeries")
    create_annotation_series(fname, name, "stimulus")
    ut.verify_timeseries(fname, name, "stimulus/presentation", "TimeSeries")
    ut.verify_timeseries(fname, name, "stimulus/presentation",
                         "AnnotationSeries")
Ejemplo n.º 12
0
def test_append():
    if __file__.startswith("./"):
        fname = "s" + __file__[3:-3] + ".nwb"
    else:
        fname = "s" + __file__[1:-3] + ".nwb"
    name1 = "annot1"
    name2 = "annot2"
    # create_annotation_series(fname, name1, "acquisition", True)
    create_annotation_series(fname, name1, "acquisition/timeseries", True)
    # create_annotation_series(fname, name2, "acquisition", False)
    create_annotation_series(fname, name2, "acquisition/timeseries", False)
    ut.verify_timeseries(fname, name1, "acquisition/timeseries", "TimeSeries")
    ut.verify_timeseries(fname, name1, "acquisition/timeseries", "AnnotationSeries")
    ut.verify_timeseries(fname, name2, "acquisition/timeseries", "TimeSeries")
    ut.verify_timeseries(fname, name2, "acquisition/timeseries", "AnnotationSeries")
Ejemplo n.º 13
0
def test_append():
    if __file__.startswith("./"):
        fname = "s" + __file__[3:-3] + ".nwb"
    else:
        fname = "s" + __file__[1:-3] + ".nwb"
    name1 = "annot1"
    name2 = "annot2"
    # create_annotation_series(fname, name1, "acquisition", True)
    create_annotation_series(fname, name1, "acquisition/timeseries", True)
    # create_annotation_series(fname, name2, "acquisition", False)
    create_annotation_series(fname, name2, "acquisition/timeseries", False)
    ut.verify_timeseries(fname, name1, "acquisition/timeseries", "TimeSeries")
    ut.verify_timeseries(fname, name1, "acquisition/timeseries", "AnnotationSeries")
    ut.verify_timeseries(fname, name2, "acquisition/timeseries", "TimeSeries")
    ut.verify_timeseries(fname, name2, "acquisition/timeseries", "AnnotationSeries")
Ejemplo n.º 14
0
def test_append():
    if __file__.startswith("./"):
        fname = "x" + __file__[3:-3] + ".nwb"
    else:
        fname = "x" + __file__[1:-3] + ".nwb"
    name1 = "annot1"
    name2 = "annot2"
    create_annotation_series(fname, name1, "acquisition", True)
    create_annotation_series(fname, name2, "acquisition", False)
    ut.verify_timeseries(fname, name1, "acquisition/timeseries", "TimeSeries")
    ut.verify_timeseries(fname, name1, "acquisition/timeseries",
                         "AnnotationSeries")
    ut.verify_timeseries(fname, name2, "acquisition/timeseries", "TimeSeries")
    ut.verify_timeseries(fname, name2, "acquisition/timeseries",
                         "AnnotationSeries")
    ut.verify_attribute_present(fname, "file_create_date", "modification_time")
Ejemplo n.º 15
0
def test_ts_link():
    if __file__.startswith("./"):
        fname = "s" + __file__[3:-3] + ".nwb"
    else:
        fname = "s" + __file__[1:-3] + ".nwb"
    root = "root"
    create_linked_series(fname, root)
    ut.verify_timeseries(fname, root + "1", "stimulus/templates", "TimeSeries")
    ut.verify_timeseries(fname, root + "2", "stimulus/presentation",
                         "TimeSeries")
    ut.verify_timeseries(fname, root + "3", "acquisition/timeseries",
                         "TimeSeries")
    ##################################################
    # make sure data is present in ts using link
    val = ut.verify_present(fname, "stimulus/presentation/root2", "data")
    if val[0] != 1:
        ut.error("Checking link content", "Incorrect value")
    # make sure link is documented
    val = ut.verify_attribute_present(fname, "stimulus/presentation/root2",
                                      "data_link")
    if not ut.search_for_substring(val, "root1"):
        ut.error("Checking attribute data_link", "Name missing")
    if not ut.search_for_substring(val, "root2"):
        ut.error("Checking attribute data_link", "Name missing")
    val = ut.verify_attribute_present(fname, "stimulus/templates/root1",
                                      "data_link")
    if not ut.search_for_substring(val, "root1"):
        ut.error("Checking attribute data_link", "Name missing")
    if not ut.search_for_substring(val, "root2"):
        ut.error("Checking attribute data_link", "Name missing")
    ##################################################
    # make sure timestamps is present in ts using link
    val = ut.verify_present(fname, "acquisition/timeseries/root3",
                            "timestamps")
    if val[0] != 2:
        ut.error("Checking link content", "Incorrect value")
    # make sure link is documented
    val = ut.verify_attribute_present(fname, "stimulus/presentation/root2",
                                      "timestamp_link")
    if not ut.search_for_substring(val, "root2"):
        ut.error("Checking attribute timestamp_link", "Name missing")
    if not ut.search_for_substring(val, "root3"):
        ut.error("Checking attribute timestamp_link", "Name missing")
    val = ut.verify_attribute_present(fname, "acquisition/timeseries/root3",
                                      "timestamp_link")
    if not ut.search_for_substring(val, "root2"):
        ut.error("Checking attribute timestamp_link", "Name missing")
    if not ut.search_for_substring(val, "root3"):
        ut.error("Checking attribute timestamp_link", "Name missing")
Ejemplo n.º 16
0
def test_notime_series():
    if __file__.startswith("./"):
        fname = "x" + __file__[3:-3] + ".nwb"
    else:
        fname = "x" + __file__[1:-3] + ".nwb"
    name = "notime"
    create_notime_series(fname, name, "acquisition")
    ut.verify_timeseries(fname, name, "acquisition/timeseries", "TimeSeries")
    ut.verify_absent(fname, "acquisition/timeseries/"+name, "timestamps")
    ut.verify_absent(fname, "acquisition/timeseries/"+name, "starting_time")

    create_notime_series(fname, name, "stimulus")
    ut.verify_timeseries(fname, name, "stimulus/presentation", "TimeSeries")
    create_notime_series(fname, name, "template")
    ut.verify_timeseries(fname, name, "stimulus/templates", "TimeSeries")
Ejemplo n.º 17
0
def test_notime_series():
    if __file__.startswith("./"):
        fname = "x" + __file__[3:-3] + ".nwb"
    else:
        fname = "x" + __file__[1:-3] + ".nwb"
    name = "notime"
    create_notime_series(fname, name, "acquisition")
    ut.verify_timeseries(fname, name, "acquisition/timeseries", "TimeSeries")
    ut.verify_absent(fname, "acquisition/timeseries/" + name, "timestamps")
    ut.verify_absent(fname, "acquisition/timeseries/" + name, "starting_time")

    create_notime_series(fname, name, "stimulus")
    ut.verify_timeseries(fname, name, "stimulus/presentation", "TimeSeries")
    create_notime_series(fname, name, "template")
    ut.verify_timeseries(fname, name, "stimulus/templates", "TimeSeries")
Ejemplo n.º 18
0
def test_ts_link():
    if __file__.startswith("./"):
        fname = "s" + __file__[3:-3] + ".nwb"
    else:
        fname = "s" + __file__[1:-3] + ".nwb"
    root = "root"
    create_linked_series(fname, root)
    ut.verify_timeseries(fname, root+"1", "stimulus/templates", "TimeSeries")
    ut.verify_timeseries(fname, root+"2", "stimulus/presentation", "TimeSeries")
    ut.verify_timeseries(fname, root+"3", "acquisition/timeseries", "TimeSeries")
    ##################################################
    # make sure data is present in ts using link
    val = ut.verify_present(fname, "stimulus/presentation/root2", "data")
    if val[0] != 1:
        ut.error("Checking link content", "Incorrect value")
    # make sure link is documented
    val = ut.verify_attribute_present(fname, "stimulus/presentation/root2", "data_link")
    if not ut.search_for_substring(val, "root1"):
        ut.error("Checking attribute data_link", "Name missing")
    if not ut.search_for_substring(val, "root2"):
        ut.error("Checking attribute data_link", "Name missing")
    val = ut.verify_attribute_present(fname, "stimulus/templates/root1", "data_link")
    if not ut.search_for_substring(val, "root1"):
        ut.error("Checking attribute data_link", "Name missing")
    if not ut.search_for_substring(val, "root2"):
        ut.error("Checking attribute data_link", "Name missing")
    ##################################################
    # make sure timestamps is present in ts using link
    val = ut.verify_present(fname, "acquisition/timeseries/root3", "timestamps")
    if val[0] != 2:
        ut.error("Checking link content", "Incorrect value")
    # make sure link is documented
    val = ut.verify_attribute_present(fname, "stimulus/presentation/root2", "timestamp_link")
    if not ut.search_for_substring(val, "root2"):
        ut.error("Checking attribute timestamp_link", "Name missing")
    if not ut.search_for_substring(val, "root3"):
        ut.error("Checking attribute timestamp_link", "Name missing")
    val = ut.verify_attribute_present(fname, "acquisition/timeseries/root3", "timestamp_link")
    if not ut.search_for_substring(val, "root2"):
        ut.error("Checking attribute timestamp_link", "Name missing")
    if not ut.search_for_substring(val, "root3"):
        ut.error("Checking attribute timestamp_link", "Name missing")