Commit edfb5c3c authored by BO ZHANG's avatar BO ZHANG 🏀
Browse files

remove duplicated methods

parent dd1cdf01
Loading
Loading
Loading
Loading
Loading
+0 −27
Original line number Diff line number Diff line
@@ -288,33 +288,6 @@ class Pipeline:
        joblib.dump(ccds_refs_dump, os.path.join(dir_dump, "ccds_refs.joblib"))
        return ccds_refs_dump

    def dump_dfs_file(self, file_path: str, dir_dst: str = None) -> str:
        """Copy DFS file to output directory."""
        # by default, dump file to output directory
        if dir_dst is None:
            dir_dst = self.dir_output

        # if use OSS,
        if self.use_oss:
            # download OSS file to dst directory
            return self.download_oss_file(file_path, dir_dst)
        else:
            # copy DFS file to dst directory
            local_file_path = os.path.join(dir_dst, os.path.basename(file_path))
            self.copy(self.abspath(file_path), local_file_path)
            return local_file_path

    def dump_ccds_refs(self, refs: dict, dir_dst: str = None) -> dict:
        """Copy raw file from CCDS to output directory."""
        if dir_dst is None:
            dir_dst = self.dir_output

        local_refs = {}
        for ref_name, ref_path in refs.items():
            local_file_path = os.path.join(dir_dst, os.path.basename(ref_path))
            local_refs[ref_name] = self.copy(self.abspath(ref_path), local_file_path)
        return local_refs

    # time operations
    @staticmethod
    def now() -> str: