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

set Pipeline.build to int

parent 0a8ba937
Loading
Loading
Loading
Loading
Loading
+9 −7
Original line number Original line Diff line number Diff line
@@ -16,7 +16,7 @@ import os
import shutil
import shutil
import traceback
import traceback
import warnings
import warnings
from typing import Callable, NamedTuple, Optional, Any
from typing import Callable, NamedTuple, Optional, Any, Union
from astropy.time import Time, TimeDelta
from astropy.time import Time, TimeDelta
from astropy.io import fits
from astropy.io import fits


@@ -83,7 +83,7 @@ class Pipeline:


        # get pipeline information from env vars
        # get pipeline information from env vars
        self.pipeline_id: str = os.getenv("PIPELINE_ID", "-")
        self.pipeline_id: str = os.getenv("PIPELINE_ID", "-")
        self.build: str = os.getenv("BUILD", "-")
        self.build: int = int(os.getenv("BUILD", "0"))
        self.created: str = os.getenv("CREATED", "-")
        self.created: str = os.getenv("CREATED", "-")
        self.verbose: bool = bool(os.getenv("VERBOSE", ""))
        self.verbose: bool = bool(os.getenv("VERBOSE", ""))


@@ -123,13 +123,15 @@ class Pipeline:
        # self.error_trace = ErrorTrace(os.path.join(self.dir_output, "error_trace"))
        # self.error_trace = ErrorTrace(os.path.join(self.dir_output, "error_trace"))


        if dfs:
        if dfs:
            self.dfs = DFS()
            self.dfs: Union[DFS | None] = DFS()
        else:
        else:
            self.dfs = None
            self.dfs: Union[DFS | None] = None
        if ccds:
        if ccds:
            self.ccds = CCDS(ccds_root=ccds_root, ccds_cache=ccds_cache)
            self.ccds: Union[CCDS | None] = CCDS(
                ccds_root=ccds_root, ccds_cache=ccds_cache
            )
        else:
        else:
            self.ccds = None
            self.ccds: Union[CCDS | None] = None


        if filter_warnings:
        if filter_warnings:
            self.filter_warnings()
            self.filter_warnings()
@@ -148,7 +150,7 @@ class Pipeline:
        h.set("PIPELINE_ID", self.pipeline_id, comment="pipeline ID")
        h.set("PIPELINE_ID", self.pipeline_id, comment="pipeline ID")
        h.set("BUILD", self.build, comment="pipeline build number")
        h.set("BUILD", self.build, comment="pipeline build number")
        h.set("CREATED", self.pipeline_id, comment="pipeline build time")
        h.set("CREATED", self.pipeline_id, comment="pipeline build time")
        return reformat_header(h, strip=False, comment="Pipeline summary")
        return reformat_header(h, strip=False, comment="Pipeline info")


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