示例#1
0
 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
示例#2
0
    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)
示例#3
0
 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)
示例#4
0
 def test_filters_sha(self):
     for kw in self.kwargs:
         filt = indexfilter_wmo(**kw)
         assert isinstance(filt.sha, str) and len(filt.sha) == 64
示例#5
0
 def test_filters_uri(self):
     for kw in self.kwargs:
         filt = indexfilter_wmo(**kw)
         assert isinstance(filt.uri(), str)
示例#6
0
 def test_creation(self):
     for kw in self.kwargs:
         filt = indexfilter_wmo(**kw)
         assert isinstance(filt, argopy.stores.argo_index.indexfilter_wmo)