Exemplo n.º 1
0
    def setUpClass(cls):
        super(Test_ISMN_Interface_CeopUnzipped, cls).setUpClass()

        testdata = os.path.join(testdata_root,
                                "Data_seperate_files_20170810_20180809")
        metadata_path = os.path.join(testdata, "python_metadata")

        cleanup(metadata_path)
        ds = ISMN_Interface(testdata, network=[], parallel=True)
        assert ds.networks == OrderedDict()
        cls.testdata = testdata
Exemplo n.º 2
0
    def setUpClass(cls):
        super(Test_ISMN_Interface_HeaderValuesZipped, cls).setUpClass()

        testdata_path = os.path.join(testdata_root, "zip_archives", "header")
        testdata_zip_path = os.path.join(
            testdata_path, "Data_seperate_files_header_20170810_20180809.zip")
        # clean up existing metadata
        metadata_path = os.path.join(testdata_path, "python_metadata")
        cleanup(metadata_path)

        ISMN_Interface(testdata_zip_path)

        cls.testdata_zip_path = testdata_zip_path
Exemplo n.º 3
0
    def setUpClass(cls):
        super(Test_ISMN_Interface_CeopZipped, cls).setUpClass()

        testdata_path = os.path.join(testdata_root, 'zip_archives', 'ceop')
        testdata_zip_path = os.path.join(testdata_path,
            'Data_seperate_files_20170810_20180809.zip')
        # clean up existing metadata
        metadata_path = os.path.join(testdata_path, 'python_metadata')
        cleanup(metadata_path)

        ISMN_Interface(testdata_zip_path)

        cls.testdata_zip_path = testdata_zip_path
Exemplo n.º 4
0
    def setUpClass(cls):
        super(Test_ISMN_Interface_HeaderValuesUnzipped, cls).setUpClass()

        testdata_path_unzipped = os.path.join(
            testdata_root, "Data_seperate_files_header_20170810_20180809")
        # clean existing metadata

        metadata_path = os.path.join(testdata_path_unzipped, "python_metadata")

        cleanup(metadata_path)

        ISMN_Interface(testdata_path_unzipped)

        cls.testdata = testdata_path_unzipped
Exemplo n.º 5
0
def test_metadata_dataframe():
    # make sure that metadata.index represents same values as get_dataset_ids
    testdata = os.path.join(testdata_root,
                            "Data_seperate_files_20170810_20180809")
    metadata_path = os.path.join(testdata, "python_metadata")
    cleanup(metadata_path)
    ds_one = ISMN_Interface(testdata,
                            meta_path=metadata_path,
                            network='FR_Aqui')

    assert np.all(ds_one.metadata.index.values == ds_one.get_dataset_ids(
        None, -np.inf, np.inf))
    ids = ds_one.get_dataset_ids('soil_moisture')
    assert ids == ds_one.metadata.index.values
    assert ds_one.metadata.loc[ids[0], 'variable']['val'] == 'soil_moisture'
    assert ds_one.metadata.loc[ids[0], 'network']['val'] == 'FR_Aqui'
    ds_one.close_files()