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 Diff line number Diff line
@@ -16,7 +16,7 @@ import os
import shutil
import traceback
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.io import fits

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

        # get pipeline information from env vars
        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.verbose: bool = bool(os.getenv("VERBOSE", ""))

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

        if dfs:
            self.dfs = DFS()
            self.dfs: Union[DFS | None] = DFS()
        else:
            self.dfs = None
            self.dfs: Union[DFS | None] = None
        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:
            self.ccds = None
            self.ccds: Union[CCDS | None] = None

        if filter_warnings:
            self.filter_warnings()
@@ -148,7 +150,7 @@ class Pipeline:
        h.set("PIPELINE_ID", self.pipeline_id, comment="pipeline ID")
        h.set("BUILD", self.build, comment="pipeline build number")
        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):
        """Summarize this run."""