# Path: dapbench/jython/util.py
# def generate_subset_requests(variable, partition_dict):
#     """
#     Yields callables which when called makes a subset request
#     to <variable> according to the partitions specified.
# 
#     Made threadsafe with a lock.
# 
#     """
# 
#     def gen():
#         for subset in partition_variable(variable, partition_dict):
#             yield DapVarSubset(variable, subset)
#     
#     return LockedIterator(gen())
# 
# Path: dapbench/jython/netcdf.py
# class Dataset(object):
#     def __init__(self, location):
#         self._ds = NetcdfDataset.openDataset(location)
#         self.variables = VariableDict(self._ds)
#         self.attributes = AttributeDict(self._ds)


from net.grinder.script import Test
from net.grinder.script.Grinder import grinder
from dapbench.jython.util import generate_subset_requests
from dapbench.jython.netcdf import Dataset
import data_urls
"""
Try running sequential scan on a local file.

"""





partition_dict = {'time': 120} 
variable = 'ta'


# Take the first dataset at all 3 bases
tests = []
i = 1
for server in data_urls.DAP_BASES:
    url = data_urls.make_dataset_list(server).next()
    test = Test(i, server)
    i += 1

    print test
    def f(req):
        return req()
    test.record(f)


# Path: dapbench/jython/util.py
# def generate_subset_requests(variable, partition_dict):
#     """
#     Yields callables which when called makes a subset request
#     to <variable> according to the partitions specified.
# 
#     Made threadsafe with a lock.
# 
#     """
# 
#     def gen():
#         for subset in partition_variable(variable, partition_dict):
#             yield DapVarSubset(variable, subset)
#     
#     return LockedIterator(gen())
# 
# Path: dapbench/jython/netcdf.py
# class Dataset(object):
#     def __init__(self, location):
#         self._ds = NetcdfDataset.openDataset(location)
#         self.variables = VariableDict(self._ds)
#         self.attributes = AttributeDict(self._ds)


# Path: grinder/remote_test.py
from net.grinder.script import Test
from net.grinder.script.Grinder import grinder
from dapbench.jython.util import generate_subset_requests
from dapbench.jython.netcdf import Dataset
import data_urls

"""
Try running sequential scan on a local file.

"""





partition_dict = {'time': 120} 
variable = 'ta'


# Take the first dataset at all 3 bases
tests = []
i = 1
for server in data_urls.DAP_BASES:
    url = data_urls.make_dataset_list(server).next()
    test = Test(i, server)
    i += 1

    print test
    def f(req):
        return req()
    test.record(f)


    ds = Dataset(url)