示例#1
0
def bing_ebank(bingham_dataset, tmpdir_factory):
    """
    Create a copy of the bingham_test data set. Then return an inited event bank
    using the temporary bingham_test bank
    """
    new = Path(str(tmpdir_factory.mktemp("bingham_test")))
    copy_dataset("bingham_test", new)
    path = new / "bingham_test" / "events"
    ebank = EventBank(path)
    ebank.update_index()
    return ebank
示例#2
0
 def test_all_files_copied(self, tmp_path):
     """
     When the download logic fires all files in the source
     should be copied.
     """
     ds = obsplus.copy_dataset("default_test", tmp_path)
     # iterate top level files and assert each was copied
     for tlf in ds.data_files:
         expected = ds.data_path / tlf.name
         assert expected.exists()
示例#3
0
    def copy_to(self, destination: Optional[Union[str, Path]] = None):
        """
        Copy the dataset to a destination.

        Parameters
        ----------
        destination
            The destination to copy the dataset. It will be created if it
            doesnt exist. If None is provided use tmpfile to create a temporary
            directory.

        Returns
        -------
        A new dataset object which refers to the copied files.
        """
        return copy_dataset(self, destination)