Example #1
0
def test_scripts():
    """Test if all datasets are working well.

    The dataset list is in the version.txt and includes one extra line for the version

    """
    os.chdir(retriever_root_dir)
    input_file = "version.txt"
    if sys.version_info >= (3, 0, 0):
        input_obj = io.open(input_file, 'rU')
    else:
        input_obj = io.open(input_file, encoding=ENCODING)
    abs_list = [line.strip() for line in input_obj.readlines()]
    assert len([data_set for data_set in datasets()]) == len(abs_list) - 1
Example #2
0
def test_datasets_licenses():
    """Check if datasets lookup on license includes a known value"""
    datasets = rt.datasets(licenses=['CC0-1.0'])
    dataset_names = [dataset.name for dataset in datasets]
    assert 'amniote-life-hist' in dataset_names
Example #3
0
def test_datasets_keywords():
    """Check if datasets lookup on keyword includes a known value"""
    datasets = rt.datasets(keywords=['mammals'])
    dataset_names = [dataset.name for dataset in datasets]
    assert 'mammal-masses' in dataset_names
Example #4
0
def test_datasets_licenses():
    """Check if datasets lookup on license includes a known value"""
    datasets = rt.datasets(licenses=['CC0-1.0'])
    dataset_names = [dataset.name for dataset in datasets]
    assert 'amniote-life-hist' in dataset_names
Example #5
0
def test_datasets_keywords():
    """Check if datasets lookup on keyword includes a known value"""
    datasets = rt.datasets(keywords=['mammals'])
    dataset_names = [dataset.name for dataset in datasets]
    assert 'mammal-masses' in dataset_names
# -*- coding: utf-8 -*-

# Copyright (C) 2019  David Arroyo Menéndez

# Author: David Arroyo Menéndez <*****@*****.**>
# Maintainer: David Arroyo Menéndez <*****@*****.**>

# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.

# This file is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with GNU Emacs; see the file COPYING.  If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301 USA,

import retriever as rt
print(rt.dataset_names())
for dataset in rt.datasets():
    print(dataset.name)

print(rt.check_for_updates())

print(rt.install_sqlite('iris'))
Example #7
0
def test_datasets():
    """Check if datasets lookup includes a known value"""
    datasets = rt.datasets(keywords=['mammals'])
    dataset_names = [dataset.name for dataset in datasets['offline']]
    dataset_names.extend(datasets['online'])
    assert 'mammal-masses' in dataset_names
Example #8
0
def run():
    create_dirs()
    pool = Pool(processes=3)
    pool.map(check_dataset, [dataset for dataset in datasets()])