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

refactor Pipeline.info

parent 00950c15
Loading
Loading
Loading
Loading
Loading
+12 −5
Original line number Diff line number Diff line
@@ -33,14 +33,16 @@ class Pipeline:
    """
    CSST pipeline configuration class.

    It should be used for every pipeline to initialize environment.
    It is used for each pipeline to initialize environment.

    Parameters
    ----------
    dir_input : str
        Input path.
        Input directory.
    dir_output : str
        Output path.
        Output directory.
    dir_temp : str
        Temp directory.
    dir_aux : str
        Aux path.
    dfs_root : str
@@ -129,14 +131,15 @@ class Pipeline:
        if filter_warnings:
            self.filter_warnings()

    def inspect(self):
    def info(self):
        """List environment variables such as `PIPELINE_ID`, etc."""
        print(f"PIPELINE_ID={self.pipeline_id}")
        print(f"BUILD={self.build}")
        print(f"CREATED={self.created}")
        print(f"VERBOSE={self.verbose}")

    def summary(self) -> fits.Header:
    @property
    def info_header(self) -> fits.Header:
        """Summarize pipeline info into a `astropy.io.fits.Header`."""
        h = fits.Header()
        h.set("PIPELINE_ID", self.pipeline_id, comment="pipeline ID")
@@ -144,6 +147,10 @@ class Pipeline:
        h.set("CREATED", self.pipeline_id, comment="pipeline build time")
        return reformat_header(h, strip=False, comment="Pipeline summary")

    def summarize(self):
        """Summarize this run."""
        pass

    def clean_output(self):
        """Clean output directory."""
        self.clean_directory(self.dir_output)