def test_filters_run(self): ftproot, flist = argopy.tutorial.open_dataset('localftp') index_file = os.path.sep.join([ftproot, "ar_index_global_prof.txt"]) for kw in self.kwargs: filt = indexfilter_wmo(**kw) with open(index_file, "r") as f: results = filt.run(f) if results: assert isinstance(results, str) else: assert results is None
def init(self, WMO: list = [], CYC=None, **kwargs): """ Create Argo data loader for WMOs Parameters ---------- WMO : list(int) The list of WMOs to load all Argo data for. CYC : int, np.array(int), list(int) The cycle numbers to load. """ if isinstance(WMO, int): WMO = [WMO] # Make sure we deal with a list if isinstance(CYC, int): CYC = np.array((CYC,), dtype='int') # Make sure we deal with an array of integers if isinstance(CYC, list): CYC = np.array(CYC, dtype='int') # Make sure we deal with an array of integers self.WMO = WMO self.CYC = CYC self.fcls = indexfilter_wmo(self.WMO, self.CYC)
def test_search_wmo(self): for kw in self.kwargs_wmo: df = indexstore(cache=0, index_file=self.index_file).open_dataframe( indexfilter_wmo(**kw)) assert isinstance(df, pd.core.frame.DataFrame)
def test_filters_sha(self): for kw in self.kwargs: filt = indexfilter_wmo(**kw) assert isinstance(filt.sha, str) and len(filt.sha) == 64
def test_filters_uri(self): for kw in self.kwargs: filt = indexfilter_wmo(**kw) assert isinstance(filt.uri(), str)
def test_creation(self): for kw in self.kwargs: filt = indexfilter_wmo(**kw) assert isinstance(filt, argopy.stores.argo_index.indexfilter_wmo)