From 0c4e3fff18e6c53c82987887fdbf24c0821abe67 Mon Sep 17 00:00:00 2001 From: Diego Rodriguez Date: Thu, 30 Nov 2023 11:57:29 -0300 Subject: [PATCH 1/2] feat(magstats-step): calculate deltajd --- libs/db-plugins/db_plugins/db/mongo/models.py | 1 + magstats_step/magstats_step/core/_base.py | 57 +- magstats_step/magstats_step/core/magstats.py | 78 ++- magstats_step/magstats_step/core/objstats.py | 60 +- magstats_step/magstats_step/step.py | 30 +- magstats_step/poetry.lock | 363 +++++----- magstats_step/pyproject.toml | 15 +- magstats_step/scribe_schema.avsc | 5 - magstats_step/tests/integration/conftest.py | 12 +- magstats_step/tests/integration/test_step.py | 12 +- .../tests/unittests/test_magstats.py | 642 +++++++++++++++--- .../tests/unittests/test_objstats.py | 174 ++++- magstats_step/tests/unittests/test_step.py | 12 +- 13 files changed, 1092 insertions(+), 369 deletions(-) delete mode 100644 magstats_step/scribe_schema.avsc diff --git a/libs/db-plugins/db_plugins/db/mongo/models.py b/libs/db-plugins/db_plugins/db/mongo/models.py index 9f32a1302..3952dc555 100644 --- a/libs/db-plugins/db_plugins/db/mongo/models.py +++ b/libs/db-plugins/db_plugins/db/mongo/models.py @@ -45,6 +45,7 @@ class Object(BaseModel): stellar = Field() firstmjd = Field() lastmjd = Field() + deltajd = Field() ndet = Field() meanra = Field() sigmara = Field() diff --git a/magstats_step/magstats_step/core/_base.py b/magstats_step/magstats_step/core/_base.py index d322333ce..e0a6d60cd 100644 --- a/magstats_step/magstats_step/core/_base.py +++ b/magstats_step/magstats_step/core/_base.py @@ -15,15 +15,21 @@ class BaseStatistics(abc.ABC): def __init__(self, detections: List[dict]): try: - self._detections = pd.DataFrame.from_records(detections, exclude=["extra_fields"]) + self._detections = pd.DataFrame.from_records( + detections, exclude=["extra_fields"] + ) except KeyError: # extra_fields is not present self._detections = pd.DataFrame.from_records(detections) - self._detections = self._detections.drop_duplicates("candid").set_index("candid") + self._detections = self._detections.drop_duplicates( + "candid" + ).set_index("candid") # Select only non-forced detections self._detections = self._detections[~self._detections["forced"]] @classmethod - def _group(cls, df: Union[pd.DataFrame, pd.Series]) -> Union[DataFrameGroupBy, SeriesGroupBy]: + def _group( + cls, df: Union[pd.DataFrame, pd.Series] + ) -> Union[DataFrameGroupBy, SeriesGroupBy]: return df.groupby(cls._JOIN) @lru_cache(10) @@ -40,8 +46,14 @@ def _surveys_mask(self, surveys: Tuple[str] = None) -> pd.Series: return pd.Series(True, index=self._detections.index) @lru_cache(6) - def _select_detections(self, *, surveys: Tuple[str] = None, corrected: bool = False) -> pd.Series: - mask = self._detections["corrected"] if corrected else pd.Series(True, index=self._detections.index) + def _select_detections( + self, *, surveys: Tuple[str] = None, corrected: bool = False + ) -> pd.Series: + mask = ( + self._detections["corrected"] + if corrected + else pd.Series(True, index=self._detections.index) + ) return self._detections[self._surveys_mask(surveys) & mask] @lru_cache(12) @@ -58,7 +70,9 @@ def _grouped_index( function = "idxmax" else: raise ValueError(f"Unrecognized value for 'which': {which}") - return self._grouped_detections(surveys=surveys, corrected=corrected)["mjd"].agg(function) + return self._grouped_detections(surveys=surveys, corrected=corrected)[ + "mjd" + ].agg(function) @lru_cache(36) def _grouped_value( @@ -69,24 +83,43 @@ def _grouped_value( surveys: Tuple[str] = None, corrected: bool = False, ) -> pd.Series: - idx = self._grouped_index(which=which, surveys=surveys, corrected=corrected) + idx = self._grouped_index( + which=which, surveys=surveys, corrected=corrected + ) df = self._select_detections(surveys=surveys, corrected=corrected) return df[column][idx].set_axis(idx.index) @lru_cache(6) - def _grouped_detections(self, *, surveys: Tuple[str] = None, corrected: bool = False) -> DataFrameGroupBy: - return self._group(self._select_detections(surveys=surveys, corrected=corrected)) + def _grouped_detections( + self, *, surveys: Tuple[str] = None, corrected: bool = False + ) -> DataFrameGroupBy: + return self._group( + self._select_detections(surveys=surveys, corrected=corrected) + ) def calculate_ndet(self) -> pd.DataFrame: - return pd.DataFrame({"ndet": self._detections.value_counts(subset=self._JOIN, sort=False)}) + return pd.DataFrame( + { + "ndet": self._detections.value_counts( + subset=self._JOIN, sort=False + ) + } + ) def generate_statistics(self, exclude: Set[str] = None) -> pd.DataFrame: exclude = exclude or set() # Empty default # Add prefix to exclude, unless already provided - exclude = {name if name.startswith(self._PREFIX) else f"{self._PREFIX}{name}" for name in exclude} + exclude = { + name if name.startswith(self._PREFIX) else f"{self._PREFIX}{name}" + for name in exclude + } # Select all methods that start with prefix unless excluded - methods = {name for name in dir(self) if name.startswith(self._PREFIX) and name not in exclude} + methods = { + name + for name in dir(self) + if name.startswith(self._PREFIX) and name not in exclude + } # Compute all statistics and join into single dataframe stats = [getattr(self, method)() for method in methods] diff --git a/magstats_step/magstats_step/core/magstats.py b/magstats_step/magstats_step/core/magstats.py index ee23b45c7..db960c305 100644 --- a/magstats_step/magstats_step/core/magstats.py +++ b/magstats_step/magstats_step/core/magstats.py @@ -11,10 +11,14 @@ class MagnitudeStatistics(BaseStatistics): # Saturation threshold for each survey (only applies to corrected magnitudes) _THRESHOLD = {"ZTF": 13.2} - def __init__(self, detections: List[dict], non_detections: List[dict] = None): + def __init__( + self, detections: List[dict], non_detections: List[dict] = None + ): super().__init__(detections) if non_detections: - self._non_detections = pd.DataFrame.from_records(non_detections).drop_duplicates(["oid", "fid", "mjd"]) + self._non_detections = pd.DataFrame.from_records( + non_detections + ).drop_duplicates(["oid", "fid", "mjd"]) else: self._non_detections = pd.DataFrame() @@ -29,44 +33,68 @@ def _calculate_stats(self, corrected: bool = False) -> pd.DataFrame: stats = grouped[in_label].agg(**functions) # Pandas std requires additional kwarg, that's why it needs to be added apart return stats.join( - grouped[in_label].agg("std", ddof=0).rename(out_label.format("sigma")), + grouped[in_label] + .agg("std", ddof=0) + .rename(out_label.format("sigma")), how="outer", ) - def _calculate_stats_over_time(self, corrected: bool = False) -> pd.DataFrame: + def _calculate_stats_over_time( + self, corrected: bool = False + ) -> pd.DataFrame: suffix = "_corr" if corrected else "" in_label, out_label = f"mag{suffix}", f"mag{{}}{suffix}" - first = self._grouped_value(in_label, which="first", corrected=corrected) + first = self._grouped_value( + in_label, which="first", corrected=corrected + ) last = self._grouped_value(in_label, which="last", corrected=corrected) - return pd.DataFrame({out_label.format("first"): first, out_label.format("last"): last}) + return pd.DataFrame( + {out_label.format("first"): first, out_label.format("last"): last} + ) def calculate_statistics(self) -> pd.DataFrame: stats = self._calculate_stats(corrected=False) - stats = stats.join(self._calculate_stats_over_time(corrected=False), how="outer") + stats = stats.join( + self._calculate_stats_over_time(corrected=False), how="outer" + ) stats = stats.join(self._calculate_stats(corrected=True), how="outer") - return stats.join(self._calculate_stats_over_time(corrected=True), how="outer") + return stats.join( + self._calculate_stats_over_time(corrected=True), how="outer" + ) def calculate_firstmjd(self) -> pd.DataFrame: - return pd.DataFrame({"firstmjd": self._grouped_value("mjd", which="first")}) + return pd.DataFrame( + {"firstmjd": self._grouped_value("mjd", which="first")} + ) def calculate_lastmjd(self) -> pd.DataFrame: - return pd.DataFrame({"lastmjd": self._grouped_value("mjd", which="last")}) + return pd.DataFrame( + {"lastmjd": self._grouped_value("mjd", which="last")} + ) def calculate_corrected(self) -> pd.DataFrame: - return pd.DataFrame({"corrected": self._grouped_value("corrected", which="first")}) + return pd.DataFrame( + {"corrected": self._grouped_value("corrected", which="first")} + ) def calculate_stellar(self) -> pd.DataFrame: - return pd.DataFrame({"stellar": self._grouped_value("stellar", which="first")}) + return pd.DataFrame( + {"stellar": self._grouped_value("stellar", which="first")} + ) def calculate_ndubious(self) -> pd.DataFrame: - return pd.DataFrame({"ndubious": self._grouped_detections()["dubious"].sum()}) + return pd.DataFrame( + {"ndubious": self._grouped_detections()["dubious"].sum()} + ) def calculate_saturation_rate(self) -> pd.DataFrame: total = self._grouped_detections()["corrected"].sum() saturated = pd.Series(index=total.index, dtype=float) for survey, threshold in self._THRESHOLD.items(): - sat = self._grouped_detections(surveys=(survey,))["mag_corr"].agg(lambda x: (x < threshold).sum()) + sat = self._grouped_detections(surveys=(survey,))["mag_corr"].agg( + lambda x: (x < threshold).sum() + ) saturated.loc[sat.index] = sat rate = np.where(total.ne(0), saturated.astype(float) / total, np.nan) @@ -76,13 +104,17 @@ def calculate_dmdt(self) -> pd.DataFrame: dt_min = 0.5 if self._non_detections.size == 0: # Handle no non-detection case - return pd.DataFrame(columns=["dt_first", "dm_first", "sigmadm_first", "dmdt_first"]) + return pd.DataFrame( + columns=["dt_first", "dm_first", "sigmadm_first", "dmdt_first"] + ) first_mag = self._grouped_value("mag", which="first") first_e_mag = self._grouped_value("e_mag", which="first") first_mjd = self._grouped_value("mjd", which="first") - nd = self._non_detections.set_index(self._JOIN) # Index by join to compute based on it + nd = self._non_detections.set_index( + self._JOIN + ) # Index by join to compute based on it dt = first_mjd - nd["mjd"] dm = first_mag - nd["diffmaglim"] @@ -90,10 +122,18 @@ def calculate_dmdt(self) -> pd.DataFrame: dmdt = (first_mag + first_e_mag - nd["diffmaglim"]) / dt # Include back fid for grouping and unique identification - results = pd.DataFrame({"dt": dt, "dm": dm, "sigmadm": sigmadm, "dmdt": dmdt}).reset_index() + results = pd.DataFrame( + {"dt": dt, "dm": dm, "sigmadm": sigmadm, "dmdt": dmdt} + ).reset_index() # Only include non-detections before dt_min - idx = self._group(results[results["dt"] > dt_min])["dmdt"].idxmin().dropna() + idx = ( + self._group(results[results["dt"] > dt_min])["dmdt"] + .idxmin() + .dropna() + ) # Drop NaN, since they result from no non-detection before first detection results = results.dropna().loc[idx].set_index(self._JOIN) - return results.rename(columns={c: f"{c}_first" for c in results.columns}) + return results.rename( + columns={c: f"{c}_first" for c in results.columns} + ) diff --git a/magstats_step/magstats_step/core/objstats.py b/magstats_step/magstats_step/core/objstats.py index a2076163c..d021e7666 100644 --- a/magstats_step/magstats_step/core/objstats.py +++ b/magstats_step/magstats_step/core/objstats.py @@ -13,16 +13,24 @@ def __init__(self, detections: List[dict]): super().__init__(detections) @staticmethod - def _arcsec2deg(values: Union[pd.Series, float]) -> Union[pd.Series, float]: + def _arcsec2deg( + values: Union[pd.Series, float] + ) -> Union[pd.Series, float]: return values / 3600.0 @staticmethod - def _deg2arcsec(values: Union[pd.Series, float]) -> Union[pd.Series, float]: + def _deg2arcsec( + values: Union[pd.Series, float] + ) -> Union[pd.Series, float]: return values * 3600.0 @staticmethod - def _compute_weights(sigmas: Union[pd.Series, float]) -> Union[pd.Series, float]: - return sigmas.astype(float) ** -2 # Integers cannot be raised to negative powers + def _compute_weights( + sigmas: Union[pd.Series, float] + ) -> Union[pd.Series, float]: + return ( + sigmas.astype(float) ** -2 + ) # Integers cannot be raised to negative powers @classmethod def _weighted_mean(cls, values: pd.Series, sigmas: pd.Series) -> float: @@ -32,7 +40,9 @@ def _weighted_mean(cls, values: pd.Series, sigmas: pd.Series) -> float: def _weighted_mean_error(cls, sigmas: pd.Series) -> float: return np.sqrt(1 / np.sum(cls._compute_weights(sigmas))) - def _calculate_coordinates(self, label: Literal["ra", "dec"]) -> pd.DataFrame: + def _calculate_coordinates( + self, label: Literal["ra", "dec"] + ) -> pd.DataFrame: def average(series): # Needs wrapper to use the sigmas in the agg call return self._weighted_mean(series, sigmas.loc[series.index]) @@ -41,12 +51,16 @@ def average(series): # Needs wrapper to use the sigmas in the agg call return pd.DataFrame( { f"mean{label}": self._grouped_detections()[label].agg(average), - f"sigma{label}": self._deg2arcsec(grouped_sigmas.agg(self._weighted_mean_error)), + f"sigma{label}": self._deg2arcsec( + grouped_sigmas.agg(self._weighted_mean_error) + ), } ) def _calculate_unique(self, label: str) -> pd.DataFrame: - return pd.DataFrame({label: self._grouped_detections()[label].unique().apply(list)}) + return pd.DataFrame( + {label: self._grouped_detections()[label].unique().apply(list)} + ) def calculate_ra(self) -> pd.DataFrame: return self._calculate_coordinates("ra") @@ -55,10 +69,22 @@ def calculate_dec(self) -> pd.DataFrame: return self._calculate_coordinates("dec") def calculate_firstmjd(self) -> pd.DataFrame: - return pd.DataFrame({"firstmjd": self._grouped_value("mjd", which="first")}) + return pd.DataFrame( + {"firstmjd": self._grouped_value("mjd", which="first")} + ) def calculate_lastmjd(self) -> pd.DataFrame: - return pd.DataFrame({"lastmjd": self._grouped_value("mjd", which="last")}) + return pd.DataFrame( + {"lastmjd": self._grouped_value("mjd", which="last")} + ) + + def calculate_deltajd(self) -> pd.DataFrame: + return pd.DataFrame( + { + "deltajd": self._grouped_value("mjd", which="last") + - self._grouped_value("mjd", which="first") + } + ) def calculate_oid(self) -> pd.DataFrame: return self._calculate_unique("oid") @@ -70,7 +96,19 @@ def calculate_sid(self) -> pd.DataFrame: return self._calculate_unique("sid") def calculate_corrected(self) -> pd.DataFrame: - return pd.DataFrame({"corrected": self._grouped_value("corrected", which="first", surveys=self._CORRECTED)}) + return pd.DataFrame( + { + "corrected": self._grouped_value( + "corrected", which="first", surveys=self._CORRECTED + ) + } + ) def calculate_stellar(self) -> pd.DataFrame: - return pd.DataFrame({"stellar": self._grouped_value("stellar", which="first", surveys=self._STELLAR)}) + return pd.DataFrame( + { + "stellar": self._grouped_value( + "stellar", which="first", surveys=self._STELLAR + ) + } + ) diff --git a/magstats_step/magstats_step/step.py b/magstats_step/magstats_step/step.py index 85e3449a9..9ff9431be 100644 --- a/magstats_step/magstats_step/step.py +++ b/magstats_step/magstats_step/step.py @@ -26,11 +26,15 @@ def pre_execute(cls, messages: List[dict]) -> dict: def _execute(self, messages: dict): obj_calculator = ObjectStatistics(messages["detections"]) - stats = obj_calculator.generate_statistics(self.excluded).replace({np.nan: None}) + stats = obj_calculator.generate_statistics(self.excluded).replace( + {np.nan: None} + ) stats = stats.to_dict("index") magstats_calculator = MagnitudeStatistics(**messages) - magstats = magstats_calculator.generate_statistics(self.excluded).reset_index() + magstats = magstats_calculator.generate_statistics( + self.excluded + ).reset_index() magstats = magstats.set_index("aid").replace({np.nan: None}) for aid in stats: try: @@ -41,15 +45,24 @@ def _execute(self, messages: dict): return stats def _execute_ztf(self, messages: dict): - ztf_detections = list(filter(lambda d: d["sid"] == "ZTF", messages["detections"])) + ztf_detections = list( + filter(lambda d: d["sid"] == "ZTF", messages["detections"]) + ) if not len(ztf_detections): return {} obj_calculator = ObjectStatistics(ztf_detections) - stats = obj_calculator.generate_statistics(self.excluded).replace({np.nan: None}) + stats = obj_calculator.generate_statistics(self.excluded).replace( + {np.nan: None} + ) stats = stats.to_dict("index") - magstats_calculator = MagnitudeStatistics(detections=ztf_detections, non_detections=messages["non_detections"]) - magstats = magstats_calculator.generate_statistics(self.excluded).reset_index() + magstats_calculator = MagnitudeStatistics( + detections=ztf_detections, + non_detections=messages["non_detections"], + ) + magstats = magstats_calculator.generate_statistics( + self.excluded + ).reset_index() magstats = magstats.set_index("aid").replace({np.nan: None}) for aid in stats: try: @@ -76,7 +89,10 @@ def produce_scribe(self, result: dict): | { "loc": { "type": "Point", - "coordinates": [stats["meanra"] - 180, stats["meandec"]], + "coordinates": [ + stats["meanra"] - 180, + stats["meandec"], + ], } }, "options": {"upsert": True}, diff --git a/magstats_step/poetry.lock b/magstats_step/poetry.lock index b711594b8..0ebda9920 100644 --- a/magstats_step/poetry.lock +++ b/magstats_step/poetry.lock @@ -69,7 +69,6 @@ mypy-extensions = ">=0.4.3" pathspec = ">=0.9.0" platformdirs = ">=2" tomli = {version = ">=1.1.0", markers = "python_full_version < \"3.11.0a7\""} -typing-extensions = {version = ">=3.10.0.0", markers = "python_version < \"3.10\""} [package.extras] colorama = ["colorama (>=0.4.3)"] @@ -117,75 +116,63 @@ crt = ["awscrt (==0.16.9)"] [[package]] name = "cffi" -version = "1.15.1" +version = "1.16.0" description = "Foreign Function Interface for Python calling C code." optional = false -python-versions = "*" +python-versions = ">=3.8" files = [ - {file = "cffi-1.15.1-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:a66d3508133af6e8548451b25058d5812812ec3798c886bf38ed24a98216fab2"}, - {file = "cffi-1.15.1-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:470c103ae716238bbe698d67ad020e1db9d9dba34fa5a899b5e21577e6d52ed2"}, - {file = "cffi-1.15.1-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:9ad5db27f9cabae298d151c85cf2bad1d359a1b9c686a275df03385758e2f914"}, - {file = "cffi-1.15.1-cp27-cp27m-win32.whl", hash = "sha256:b3bbeb01c2b273cca1e1e0c5df57f12dce9a4dd331b4fa1635b8bec26350bde3"}, - {file = "cffi-1.15.1-cp27-cp27m-win_amd64.whl", hash = "sha256:e00b098126fd45523dd056d2efba6c5a63b71ffe9f2bbe1a4fe1716e1d0c331e"}, - {file = "cffi-1.15.1-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:d61f4695e6c866a23a21acab0509af1cdfd2c013cf256bbf5b6b5e2695827162"}, - {file = "cffi-1.15.1-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:ed9cb427ba5504c1dc15ede7d516b84757c3e3d7868ccc85121d9310d27eed0b"}, - {file = "cffi-1.15.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:39d39875251ca8f612b6f33e6b1195af86d1b3e60086068be9cc053aa4376e21"}, - {file = "cffi-1.15.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:285d29981935eb726a4399badae8f0ffdff4f5050eaa6d0cfc3f64b857b77185"}, - {file = "cffi-1.15.1-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3eb6971dcff08619f8d91607cfc726518b6fa2a9eba42856be181c6d0d9515fd"}, - {file = "cffi-1.15.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:21157295583fe8943475029ed5abdcf71eb3911894724e360acff1d61c1d54bc"}, - {file = "cffi-1.15.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5635bd9cb9731e6d4a1132a498dd34f764034a8ce60cef4f5319c0541159392f"}, - {file = "cffi-1.15.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2012c72d854c2d03e45d06ae57f40d78e5770d252f195b93f581acf3ba44496e"}, - {file = "cffi-1.15.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd86c085fae2efd48ac91dd7ccffcfc0571387fe1193d33b6394db7ef31fe2a4"}, - {file = "cffi-1.15.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:fa6693661a4c91757f4412306191b6dc88c1703f780c8234035eac011922bc01"}, - {file = "cffi-1.15.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:59c0b02d0a6c384d453fece7566d1c7e6b7bae4fc5874ef2ef46d56776d61c9e"}, - {file = "cffi-1.15.1-cp310-cp310-win32.whl", hash = "sha256:cba9d6b9a7d64d4bd46167096fc9d2f835e25d7e4c121fb2ddfc6528fb0413b2"}, - {file = "cffi-1.15.1-cp310-cp310-win_amd64.whl", hash = "sha256:ce4bcc037df4fc5e3d184794f27bdaab018943698f4ca31630bc7f84a7b69c6d"}, - {file = "cffi-1.15.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:3d08afd128ddaa624a48cf2b859afef385b720bb4b43df214f85616922e6a5ac"}, - {file = "cffi-1.15.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3799aecf2e17cf585d977b780ce79ff0dc9b78d799fc694221ce814c2c19db83"}, - {file = "cffi-1.15.1-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a591fe9e525846e4d154205572a029f653ada1a78b93697f3b5a8f1f2bc055b9"}, - {file = "cffi-1.15.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3548db281cd7d2561c9ad9984681c95f7b0e38881201e157833a2342c30d5e8c"}, - {file = "cffi-1.15.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:91fc98adde3d7881af9b59ed0294046f3806221863722ba7d8d120c575314325"}, - {file = "cffi-1.15.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:94411f22c3985acaec6f83c6df553f2dbe17b698cc7f8ae751ff2237d96b9e3c"}, - {file = "cffi-1.15.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:03425bdae262c76aad70202debd780501fabeaca237cdfddc008987c0e0f59ef"}, - {file = "cffi-1.15.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:cc4d65aeeaa04136a12677d3dd0b1c0c94dc43abac5860ab33cceb42b801c1e8"}, - {file = "cffi-1.15.1-cp311-cp311-win32.whl", hash = "sha256:a0f100c8912c114ff53e1202d0078b425bee3649ae34d7b070e9697f93c5d52d"}, - {file = "cffi-1.15.1-cp311-cp311-win_amd64.whl", hash = "sha256:04ed324bda3cda42b9b695d51bb7d54b680b9719cfab04227cdd1e04e5de3104"}, - {file = "cffi-1.15.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:50a74364d85fd319352182ef59c5c790484a336f6db772c1a9231f1c3ed0cbd7"}, - {file = "cffi-1.15.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e263d77ee3dd201c3a142934a086a4450861778baaeeb45db4591ef65550b0a6"}, - {file = "cffi-1.15.1-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:cec7d9412a9102bdc577382c3929b337320c4c4c4849f2c5cdd14d7368c5562d"}, - {file = "cffi-1.15.1-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4289fc34b2f5316fbb762d75362931e351941fa95fa18789191b33fc4cf9504a"}, - {file = "cffi-1.15.1-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:173379135477dc8cac4bc58f45db08ab45d228b3363adb7af79436135d028405"}, - {file = "cffi-1.15.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:6975a3fac6bc83c4a65c9f9fcab9e47019a11d3d2cf7f3c0d03431bf145a941e"}, - {file = "cffi-1.15.1-cp36-cp36m-win32.whl", hash = "sha256:2470043b93ff09bf8fb1d46d1cb756ce6132c54826661a32d4e4d132e1977adf"}, - {file = "cffi-1.15.1-cp36-cp36m-win_amd64.whl", hash = "sha256:30d78fbc8ebf9c92c9b7823ee18eb92f2e6ef79b45ac84db507f52fbe3ec4497"}, - {file = "cffi-1.15.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:198caafb44239b60e252492445da556afafc7d1e3ab7a1fb3f0584ef6d742375"}, - {file = "cffi-1.15.1-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5ef34d190326c3b1f822a5b7a45f6c4535e2f47ed06fec77d3d799c450b2651e"}, - {file = "cffi-1.15.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8102eaf27e1e448db915d08afa8b41d6c7ca7a04b7d73af6514df10a3e74bd82"}, - {file = "cffi-1.15.1-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5df2768244d19ab7f60546d0c7c63ce1581f7af8b5de3eb3004b9b6fc8a9f84b"}, - {file = "cffi-1.15.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a8c4917bd7ad33e8eb21e9a5bbba979b49d9a97acb3a803092cbc1133e20343c"}, - {file = "cffi-1.15.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0e2642fe3142e4cc4af0799748233ad6da94c62a8bec3a6648bf8ee68b1c7426"}, - {file = "cffi-1.15.1-cp37-cp37m-win32.whl", hash = "sha256:e229a521186c75c8ad9490854fd8bbdd9a0c9aa3a524326b55be83b54d4e0ad9"}, - {file = "cffi-1.15.1-cp37-cp37m-win_amd64.whl", hash = "sha256:a0b71b1b8fbf2b96e41c4d990244165e2c9be83d54962a9a1d118fd8657d2045"}, - {file = "cffi-1.15.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:320dab6e7cb2eacdf0e658569d2575c4dad258c0fcc794f46215e1e39f90f2c3"}, - {file = "cffi-1.15.1-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1e74c6b51a9ed6589199c787bf5f9875612ca4a8a0785fb2d4a84429badaf22a"}, - {file = "cffi-1.15.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a5c84c68147988265e60416b57fc83425a78058853509c1b0629c180094904a5"}, - {file = "cffi-1.15.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3b926aa83d1edb5aa5b427b4053dc420ec295a08e40911296b9eb1b6170f6cca"}, - {file = "cffi-1.15.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:87c450779d0914f2861b8526e035c5e6da0a3199d8f1add1a665e1cbc6fc6d02"}, - {file = "cffi-1.15.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4f2c9f67e9821cad2e5f480bc8d83b8742896f1242dba247911072d4fa94c192"}, - {file = "cffi-1.15.1-cp38-cp38-win32.whl", hash = "sha256:8b7ee99e510d7b66cdb6c593f21c043c248537a32e0bedf02e01e9553a172314"}, - {file = "cffi-1.15.1-cp38-cp38-win_amd64.whl", hash = "sha256:00a9ed42e88df81ffae7a8ab6d9356b371399b91dbdf0c3cb1e84c03a13aceb5"}, - {file = "cffi-1.15.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:54a2db7b78338edd780e7ef7f9f6c442500fb0d41a5a4ea24fff1c929d5af585"}, - {file = "cffi-1.15.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:fcd131dd944808b5bdb38e6f5b53013c5aa4f334c5cad0c72742f6eba4b73db0"}, - {file = "cffi-1.15.1-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7473e861101c9e72452f9bf8acb984947aa1661a7704553a9f6e4baa5ba64415"}, - {file = "cffi-1.15.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6c9a799e985904922a4d207a94eae35c78ebae90e128f0c4e521ce339396be9d"}, - {file = "cffi-1.15.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3bcde07039e586f91b45c88f8583ea7cf7a0770df3a1649627bf598332cb6984"}, - {file = "cffi-1.15.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:33ab79603146aace82c2427da5ca6e58f2b3f2fb5da893ceac0c42218a40be35"}, - {file = "cffi-1.15.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5d598b938678ebf3c67377cdd45e09d431369c3b1a5b331058c338e201f12b27"}, - {file = "cffi-1.15.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:db0fbb9c62743ce59a9ff687eb5f4afbe77e5e8403d6697f7446e5f609976f76"}, - {file = "cffi-1.15.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:98d85c6a2bef81588d9227dde12db8a7f47f639f4a17c9ae08e773aa9c697bf3"}, - {file = "cffi-1.15.1-cp39-cp39-win32.whl", hash = "sha256:40f4774f5a9d4f5e344f31a32b5096977b5d48560c5592e2f3d2c4374bd543ee"}, - {file = "cffi-1.15.1-cp39-cp39-win_amd64.whl", hash = "sha256:70df4e3b545a17496c9b3f41f5115e69a4f2e77e94e1d2a8e1070bc0c38c8a3c"}, - {file = "cffi-1.15.1.tar.gz", hash = "sha256:d400bfb9a37b1351253cb402671cea7e89bdecc294e8016a707f6d1d8ac934f9"}, + {file = "cffi-1.16.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6b3d6606d369fc1da4fd8c357d026317fbb9c9b75d36dc16e90e84c26854b088"}, + {file = "cffi-1.16.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ac0f5edd2360eea2f1daa9e26a41db02dd4b0451b48f7c318e217ee092a213e9"}, + {file = "cffi-1.16.0-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7e61e3e4fa664a8588aa25c883eab612a188c725755afff6289454d6362b9673"}, + {file = "cffi-1.16.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a72e8961a86d19bdb45851d8f1f08b041ea37d2bd8d4fd19903bc3083d80c896"}, + {file = "cffi-1.16.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5b50bf3f55561dac5438f8e70bfcdfd74543fd60df5fa5f62d94e5867deca684"}, + {file = "cffi-1.16.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7651c50c8c5ef7bdb41108b7b8c5a83013bfaa8a935590c5d74627c047a583c7"}, + {file = "cffi-1.16.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e4108df7fe9b707191e55f33efbcb2d81928e10cea45527879a4749cbe472614"}, + {file = "cffi-1.16.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:32c68ef735dbe5857c810328cb2481e24722a59a2003018885514d4c09af9743"}, + {file = "cffi-1.16.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:673739cb539f8cdaa07d92d02efa93c9ccf87e345b9a0b556e3ecc666718468d"}, + {file = "cffi-1.16.0-cp310-cp310-win32.whl", hash = "sha256:9f90389693731ff1f659e55c7d1640e2ec43ff725cc61b04b2f9c6d8d017df6a"}, + {file = "cffi-1.16.0-cp310-cp310-win_amd64.whl", hash = "sha256:e6024675e67af929088fda399b2094574609396b1decb609c55fa58b028a32a1"}, + {file = "cffi-1.16.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b84834d0cf97e7d27dd5b7f3aca7b6e9263c56308ab9dc8aae9784abb774d404"}, + {file = "cffi-1.16.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1b8ebc27c014c59692bb2664c7d13ce7a6e9a629be20e54e7271fa696ff2b417"}, + {file = "cffi-1.16.0-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ee07e47c12890ef248766a6e55bd38ebfb2bb8edd4142d56db91b21ea68b7627"}, + {file = "cffi-1.16.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d8a9d3ebe49f084ad71f9269834ceccbf398253c9fac910c4fd7053ff1386936"}, + {file = "cffi-1.16.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e70f54f1796669ef691ca07d046cd81a29cb4deb1e5f942003f401c0c4a2695d"}, + {file = "cffi-1.16.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5bf44d66cdf9e893637896c7faa22298baebcd18d1ddb6d2626a6e39793a1d56"}, + {file = "cffi-1.16.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7b78010e7b97fef4bee1e896df8a4bbb6712b7f05b7ef630f9d1da00f6444d2e"}, + {file = "cffi-1.16.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:c6a164aa47843fb1b01e941d385aab7215563bb8816d80ff3a363a9f8448a8dc"}, + {file = "cffi-1.16.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e09f3ff613345df5e8c3667da1d918f9149bd623cd9070c983c013792a9a62eb"}, + {file = "cffi-1.16.0-cp311-cp311-win32.whl", hash = "sha256:2c56b361916f390cd758a57f2e16233eb4f64bcbeee88a4881ea90fca14dc6ab"}, + {file = "cffi-1.16.0-cp311-cp311-win_amd64.whl", hash = "sha256:db8e577c19c0fda0beb7e0d4e09e0ba74b1e4c092e0e40bfa12fe05b6f6d75ba"}, + {file = "cffi-1.16.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:fa3a0128b152627161ce47201262d3140edb5a5c3da88d73a1b790a959126956"}, + {file = "cffi-1.16.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:68e7c44931cc171c54ccb702482e9fc723192e88d25a0e133edd7aff8fcd1f6e"}, + {file = "cffi-1.16.0-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:abd808f9c129ba2beda4cfc53bde801e5bcf9d6e0f22f095e45327c038bfe68e"}, + {file = "cffi-1.16.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:88e2b3c14bdb32e440be531ade29d3c50a1a59cd4e51b1dd8b0865c54ea5d2e2"}, + {file = "cffi-1.16.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fcc8eb6d5902bb1cf6dc4f187ee3ea80a1eba0a89aba40a5cb20a5087d961357"}, + {file = "cffi-1.16.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b7be2d771cdba2942e13215c4e340bfd76398e9227ad10402a8767ab1865d2e6"}, + {file = "cffi-1.16.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e715596e683d2ce000574bae5d07bd522c781a822866c20495e52520564f0969"}, + {file = "cffi-1.16.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:2d92b25dbf6cae33f65005baf472d2c245c050b1ce709cc4588cdcdd5495b520"}, + {file = "cffi-1.16.0-cp312-cp312-win32.whl", hash = "sha256:b2ca4e77f9f47c55c194982e10f058db063937845bb2b7a86c84a6cfe0aefa8b"}, + {file = "cffi-1.16.0-cp312-cp312-win_amd64.whl", hash = "sha256:68678abf380b42ce21a5f2abde8efee05c114c2fdb2e9eef2efdb0257fba1235"}, + {file = "cffi-1.16.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:0c9ef6ff37e974b73c25eecc13952c55bceed9112be2d9d938ded8e856138bcc"}, + {file = "cffi-1.16.0-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a09582f178759ee8128d9270cd1344154fd473bb77d94ce0aeb2a93ebf0feaf0"}, + {file = "cffi-1.16.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e760191dd42581e023a68b758769e2da259b5d52e3103c6060ddc02c9edb8d7b"}, + {file = "cffi-1.16.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:80876338e19c951fdfed6198e70bc88f1c9758b94578d5a7c4c91a87af3cf31c"}, + {file = "cffi-1.16.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a6a14b17d7e17fa0d207ac08642c8820f84f25ce17a442fd15e27ea18d67c59b"}, + {file = "cffi-1.16.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6602bc8dc6f3a9e02b6c22c4fc1e47aa50f8f8e6d3f78a5e16ac33ef5fefa324"}, + {file = "cffi-1.16.0-cp38-cp38-win32.whl", hash = "sha256:131fd094d1065b19540c3d72594260f118b231090295d8c34e19a7bbcf2e860a"}, + {file = "cffi-1.16.0-cp38-cp38-win_amd64.whl", hash = "sha256:31d13b0f99e0836b7ff893d37af07366ebc90b678b6664c955b54561fc36ef36"}, + {file = "cffi-1.16.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:582215a0e9adbe0e379761260553ba11c58943e4bbe9c36430c4ca6ac74b15ed"}, + {file = "cffi-1.16.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:b29ebffcf550f9da55bec9e02ad430c992a87e5f512cd63388abb76f1036d8d2"}, + {file = "cffi-1.16.0-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dc9b18bf40cc75f66f40a7379f6a9513244fe33c0e8aa72e2d56b0196a7ef872"}, + {file = "cffi-1.16.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9cb4a35b3642fc5c005a6755a5d17c6c8b6bcb6981baf81cea8bfbc8903e8ba8"}, + {file = "cffi-1.16.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b86851a328eedc692acf81fb05444bdf1891747c25af7529e39ddafaf68a4f3f"}, + {file = "cffi-1.16.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c0f31130ebc2d37cdd8e44605fb5fa7ad59049298b3f745c74fa74c62fbfcfc4"}, + {file = "cffi-1.16.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8f8e709127c6c77446a8c0a8c8bf3c8ee706a06cd44b1e827c3e6a2ee6b8c098"}, + {file = "cffi-1.16.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:748dcd1e3d3d7cd5443ef03ce8685043294ad6bd7c02a38d1bd367cfd968e000"}, + {file = "cffi-1.16.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:8895613bcc094d4a1b2dbe179d88d7fb4a15cee43c052e8885783fac397d91fe"}, + {file = "cffi-1.16.0-cp39-cp39-win32.whl", hash = "sha256:ed86a35631f7bfbb28e108dd96773b9d5a6ce4811cf6ea468bb6a359b256b1e4"}, + {file = "cffi-1.16.0-cp39-cp39-win_amd64.whl", hash = "sha256:3686dffb02459559c74dd3d81748269ffb0eb027c39a6fc99502de37d501faa8"}, + {file = "cffi-1.16.0.tar.gz", hash = "sha256:bcb3ef43e58665bbda2fb198698fcae6776483e0c4a631aa5647806c25e02cc0"}, ] [package.dependencies] @@ -193,13 +180,13 @@ pycparser = "*" [[package]] name = "click" -version = "8.1.6" +version = "8.1.7" description = "Composable command line interface toolkit" optional = false python-versions = ">=3.7" files = [ - {file = "click-8.1.6-py3-none-any.whl", hash = "sha256:fa244bb30b3b5ee2cae3da8f55c9e5e0c0e86093306301fb418eb9dc40fbded5"}, - {file = "click-8.1.6.tar.gz", hash = "sha256:48ee849951919527a045bfe3bf7baa8a959c423134e1a5b98c05c20ba75a1cbd"}, + {file = "click-8.1.7-py3-none-any.whl", hash = "sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28"}, + {file = "click-8.1.7.tar.gz", hash = "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de"}, ] [package.dependencies] @@ -264,71 +251,63 @@ schema-registry = ["requests"] [[package]] name = "coverage" -version = "7.2.7" +version = "7.3.2" description = "Code coverage measurement for Python" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "coverage-7.2.7-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d39b5b4f2a66ccae8b7263ac3c8170994b65266797fb96cbbfd3fb5b23921db8"}, - {file = "coverage-7.2.7-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:6d040ef7c9859bb11dfeb056ff5b3872436e3b5e401817d87a31e1750b9ae2fb"}, - {file = "coverage-7.2.7-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ba90a9563ba44a72fda2e85302c3abc71c5589cea608ca16c22b9804262aaeb6"}, - {file = "coverage-7.2.7-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e7d9405291c6928619403db1d10bd07888888ec1abcbd9748fdaa971d7d661b2"}, - {file = "coverage-7.2.7-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:31563e97dae5598556600466ad9beea39fb04e0229e61c12eaa206e0aa202063"}, - {file = "coverage-7.2.7-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:ebba1cd308ef115925421d3e6a586e655ca5a77b5bf41e02eb0e4562a111f2d1"}, - {file = "coverage-7.2.7-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:cb017fd1b2603ef59e374ba2063f593abe0fc45f2ad9abdde5b4d83bd922a353"}, - {file = "coverage-7.2.7-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:d62a5c7dad11015c66fbb9d881bc4caa5b12f16292f857842d9d1871595f4495"}, - {file = "coverage-7.2.7-cp310-cp310-win32.whl", hash = "sha256:ee57190f24fba796e36bb6d3aa8a8783c643d8fa9760c89f7a98ab5455fbf818"}, - {file = "coverage-7.2.7-cp310-cp310-win_amd64.whl", hash = "sha256:f75f7168ab25dd93110c8a8117a22450c19976afbc44234cbf71481094c1b850"}, - {file = "coverage-7.2.7-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:06a9a2be0b5b576c3f18f1a241f0473575c4a26021b52b2a85263a00f034d51f"}, - {file = "coverage-7.2.7-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:5baa06420f837184130752b7c5ea0808762083bf3487b5038d68b012e5937dbe"}, - {file = "coverage-7.2.7-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fdec9e8cbf13a5bf63290fc6013d216a4c7232efb51548594ca3631a7f13c3a3"}, - {file = "coverage-7.2.7-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:52edc1a60c0d34afa421c9c37078817b2e67a392cab17d97283b64c5833f427f"}, - {file = "coverage-7.2.7-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:63426706118b7f5cf6bb6c895dc215d8a418d5952544042c8a2d9fe87fcf09cb"}, - {file = "coverage-7.2.7-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:afb17f84d56068a7c29f5fa37bfd38d5aba69e3304af08ee94da8ed5b0865833"}, - {file = "coverage-7.2.7-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:48c19d2159d433ccc99e729ceae7d5293fbffa0bdb94952d3579983d1c8c9d97"}, - {file = "coverage-7.2.7-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:0e1f928eaf5469c11e886fe0885ad2bf1ec606434e79842a879277895a50942a"}, - {file = "coverage-7.2.7-cp311-cp311-win32.whl", hash = "sha256:33d6d3ea29d5b3a1a632b3c4e4f4ecae24ef170b0b9ee493883f2df10039959a"}, - {file = "coverage-7.2.7-cp311-cp311-win_amd64.whl", hash = "sha256:5b7540161790b2f28143191f5f8ec02fb132660ff175b7747b95dcb77ac26562"}, - {file = "coverage-7.2.7-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:f2f67fe12b22cd130d34d0ef79206061bfb5eda52feb6ce0dba0644e20a03cf4"}, - {file = "coverage-7.2.7-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a342242fe22407f3c17f4b499276a02b01e80f861f1682ad1d95b04018e0c0d4"}, - {file = "coverage-7.2.7-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:171717c7cb6b453aebac9a2ef603699da237f341b38eebfee9be75d27dc38e01"}, - {file = "coverage-7.2.7-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:49969a9f7ffa086d973d91cec8d2e31080436ef0fb4a359cae927e742abfaaa6"}, - {file = "coverage-7.2.7-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:b46517c02ccd08092f4fa99f24c3b83d8f92f739b4657b0f146246a0ca6a831d"}, - {file = "coverage-7.2.7-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:a3d33a6b3eae87ceaefa91ffdc130b5e8536182cd6dfdbfc1aa56b46ff8c86de"}, - {file = "coverage-7.2.7-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:976b9c42fb2a43ebf304fa7d4a310e5f16cc99992f33eced91ef6f908bd8f33d"}, - {file = "coverage-7.2.7-cp312-cp312-win32.whl", hash = "sha256:8de8bb0e5ad103888d65abef8bca41ab93721647590a3f740100cd65c3b00511"}, - {file = "coverage-7.2.7-cp312-cp312-win_amd64.whl", hash = "sha256:9e31cb64d7de6b6f09702bb27c02d1904b3aebfca610c12772452c4e6c21a0d3"}, - {file = "coverage-7.2.7-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:58c2ccc2f00ecb51253cbe5d8d7122a34590fac9646a960d1430d5b15321d95f"}, - {file = "coverage-7.2.7-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d22656368f0e6189e24722214ed8d66b8022db19d182927b9a248a2a8a2f67eb"}, - {file = "coverage-7.2.7-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a895fcc7b15c3fc72beb43cdcbdf0ddb7d2ebc959edac9cef390b0d14f39f8a9"}, - {file = "coverage-7.2.7-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e84606b74eb7de6ff581a7915e2dab7a28a0517fbe1c9239eb227e1354064dcd"}, - {file = "coverage-7.2.7-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:0a5f9e1dbd7fbe30196578ca36f3fba75376fb99888c395c5880b355e2875f8a"}, - {file = "coverage-7.2.7-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:419bfd2caae268623dd469eff96d510a920c90928b60f2073d79f8fe2bbc5959"}, - {file = "coverage-7.2.7-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:2aee274c46590717f38ae5e4650988d1af340fe06167546cc32fe2f58ed05b02"}, - {file = "coverage-7.2.7-cp37-cp37m-win32.whl", hash = "sha256:61b9a528fb348373c433e8966535074b802c7a5d7f23c4f421e6c6e2f1697a6f"}, - {file = "coverage-7.2.7-cp37-cp37m-win_amd64.whl", hash = "sha256:b1c546aca0ca4d028901d825015dc8e4d56aac4b541877690eb76490f1dc8ed0"}, - {file = "coverage-7.2.7-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:54b896376ab563bd38453cecb813c295cf347cf5906e8b41d340b0321a5433e5"}, - {file = "coverage-7.2.7-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:3d376df58cc111dc8e21e3b6e24606b5bb5dee6024f46a5abca99124b2229ef5"}, - {file = "coverage-7.2.7-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5e330fc79bd7207e46c7d7fd2bb4af2963f5f635703925543a70b99574b0fea9"}, - {file = "coverage-7.2.7-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1e9d683426464e4a252bf70c3498756055016f99ddaec3774bf368e76bbe02b6"}, - {file = "coverage-7.2.7-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8d13c64ee2d33eccf7437961b6ea7ad8673e2be040b4f7fd4fd4d4d28d9ccb1e"}, - {file = "coverage-7.2.7-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:b7aa5f8a41217360e600da646004f878250a0d6738bcdc11a0a39928d7dc2050"}, - {file = "coverage-7.2.7-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:8fa03bce9bfbeeef9f3b160a8bed39a221d82308b4152b27d82d8daa7041fee5"}, - {file = "coverage-7.2.7-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:245167dd26180ab4c91d5e1496a30be4cd721a5cf2abf52974f965f10f11419f"}, - {file = "coverage-7.2.7-cp38-cp38-win32.whl", hash = "sha256:d2c2db7fd82e9b72937969bceac4d6ca89660db0a0967614ce2481e81a0b771e"}, - {file = "coverage-7.2.7-cp38-cp38-win_amd64.whl", hash = "sha256:2e07b54284e381531c87f785f613b833569c14ecacdcb85d56b25c4622c16c3c"}, - {file = "coverage-7.2.7-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:537891ae8ce59ef63d0123f7ac9e2ae0fc8b72c7ccbe5296fec45fd68967b6c9"}, - {file = "coverage-7.2.7-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:06fb182e69f33f6cd1d39a6c597294cff3143554b64b9825d1dc69d18cc2fff2"}, - {file = "coverage-7.2.7-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:201e7389591af40950a6480bd9edfa8ed04346ff80002cec1a66cac4549c1ad7"}, - {file = "coverage-7.2.7-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f6951407391b639504e3b3be51b7ba5f3528adbf1a8ac3302b687ecababf929e"}, - {file = "coverage-7.2.7-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6f48351d66575f535669306aa7d6d6f71bc43372473b54a832222803eb956fd1"}, - {file = "coverage-7.2.7-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:b29019c76039dc3c0fd815c41392a044ce555d9bcdd38b0fb60fb4cd8e475ba9"}, - {file = "coverage-7.2.7-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:81c13a1fc7468c40f13420732805a4c38a105d89848b7c10af65a90beff25250"}, - {file = "coverage-7.2.7-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:975d70ab7e3c80a3fe86001d8751f6778905ec723f5b110aed1e450da9d4b7f2"}, - {file = "coverage-7.2.7-cp39-cp39-win32.whl", hash = "sha256:7ee7d9d4822c8acc74a5e26c50604dff824710bc8de424904c0982e25c39c6cb"}, - {file = "coverage-7.2.7-cp39-cp39-win_amd64.whl", hash = "sha256:eb393e5ebc85245347950143969b241d08b52b88a3dc39479822e073a1a8eb27"}, - {file = "coverage-7.2.7-pp37.pp38.pp39-none-any.whl", hash = "sha256:b7b4c971f05e6ae490fef852c218b0e79d4e52f79ef0c8475566584a8fb3e01d"}, - {file = "coverage-7.2.7.tar.gz", hash = "sha256:924d94291ca674905fe9481f12294eb11f2d3d3fd1adb20314ba89e94f44ed59"}, + {file = "coverage-7.3.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d872145f3a3231a5f20fd48500274d7df222e291d90baa2026cc5152b7ce86bf"}, + {file = "coverage-7.3.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:310b3bb9c91ea66d59c53fa4989f57d2436e08f18fb2f421a1b0b6b8cc7fffda"}, + {file = "coverage-7.3.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f47d39359e2c3779c5331fc740cf4bce6d9d680a7b4b4ead97056a0ae07cb49a"}, + {file = "coverage-7.3.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:aa72dbaf2c2068404b9870d93436e6d23addd8bbe9295f49cbca83f6e278179c"}, + {file = "coverage-7.3.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:beaa5c1b4777f03fc63dfd2a6bd820f73f036bfb10e925fce067b00a340d0f3f"}, + {file = "coverage-7.3.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:dbc1b46b92186cc8074fee9d9fbb97a9dd06c6cbbef391c2f59d80eabdf0faa6"}, + {file = "coverage-7.3.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:315a989e861031334d7bee1f9113c8770472db2ac484e5b8c3173428360a9148"}, + {file = "coverage-7.3.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:d1bc430677773397f64a5c88cb522ea43175ff16f8bfcc89d467d974cb2274f9"}, + {file = "coverage-7.3.2-cp310-cp310-win32.whl", hash = "sha256:a889ae02f43aa45032afe364c8ae84ad3c54828c2faa44f3bfcafecb5c96b02f"}, + {file = "coverage-7.3.2-cp310-cp310-win_amd64.whl", hash = "sha256:c0ba320de3fb8c6ec16e0be17ee1d3d69adcda99406c43c0409cb5c41788a611"}, + {file = "coverage-7.3.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:ac8c802fa29843a72d32ec56d0ca792ad15a302b28ca6203389afe21f8fa062c"}, + {file = "coverage-7.3.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:89a937174104339e3a3ffcf9f446c00e3a806c28b1841c63edb2b369310fd074"}, + {file = "coverage-7.3.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e267e9e2b574a176ddb983399dec325a80dbe161f1a32715c780b5d14b5f583a"}, + {file = "coverage-7.3.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2443cbda35df0d35dcfb9bf8f3c02c57c1d6111169e3c85fc1fcc05e0c9f39a3"}, + {file = "coverage-7.3.2-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4175e10cc8dda0265653e8714b3174430b07c1dca8957f4966cbd6c2b1b8065a"}, + {file = "coverage-7.3.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:0cbf38419fb1a347aaf63481c00f0bdc86889d9fbf3f25109cf96c26b403fda1"}, + {file = "coverage-7.3.2-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:5c913b556a116b8d5f6ef834038ba983834d887d82187c8f73dec21049abd65c"}, + {file = "coverage-7.3.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:1981f785239e4e39e6444c63a98da3a1db8e971cb9ceb50a945ba6296b43f312"}, + {file = "coverage-7.3.2-cp311-cp311-win32.whl", hash = "sha256:43668cabd5ca8258f5954f27a3aaf78757e6acf13c17604d89648ecc0cc66640"}, + {file = "coverage-7.3.2-cp311-cp311-win_amd64.whl", hash = "sha256:e10c39c0452bf6e694511c901426d6b5ac005acc0f78ff265dbe36bf81f808a2"}, + {file = "coverage-7.3.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:4cbae1051ab791debecc4a5dcc4a1ff45fc27b91b9aee165c8a27514dd160836"}, + {file = "coverage-7.3.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:12d15ab5833a997716d76f2ac1e4b4d536814fc213c85ca72756c19e5a6b3d63"}, + {file = "coverage-7.3.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3c7bba973ebee5e56fe9251300c00f1579652587a9f4a5ed8404b15a0471f216"}, + {file = "coverage-7.3.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:fe494faa90ce6381770746077243231e0b83ff3f17069d748f645617cefe19d4"}, + {file = "coverage-7.3.2-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f6e9589bd04d0461a417562649522575d8752904d35c12907d8c9dfeba588faf"}, + {file = "coverage-7.3.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:d51ac2a26f71da1b57f2dc81d0e108b6ab177e7d30e774db90675467c847bbdf"}, + {file = "coverage-7.3.2-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:99b89d9f76070237975b315b3d5f4d6956ae354a4c92ac2388a5695516e47c84"}, + {file = "coverage-7.3.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:fa28e909776dc69efb6ed975a63691bc8172b64ff357e663a1bb06ff3c9b589a"}, + {file = "coverage-7.3.2-cp312-cp312-win32.whl", hash = "sha256:289fe43bf45a575e3ab10b26d7b6f2ddb9ee2dba447499f5401cfb5ecb8196bb"}, + {file = "coverage-7.3.2-cp312-cp312-win_amd64.whl", hash = "sha256:7dbc3ed60e8659bc59b6b304b43ff9c3ed858da2839c78b804973f613d3e92ed"}, + {file = "coverage-7.3.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:f94b734214ea6a36fe16e96a70d941af80ff3bfd716c141300d95ebc85339738"}, + {file = "coverage-7.3.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:af3d828d2c1cbae52d34bdbb22fcd94d1ce715d95f1a012354a75e5913f1bda2"}, + {file = "coverage-7.3.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:630b13e3036e13c7adc480ca42fa7afc2a5d938081d28e20903cf7fd687872e2"}, + {file = "coverage-7.3.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c9eacf273e885b02a0273bb3a2170f30e2d53a6d53b72dbe02d6701b5296101c"}, + {file = "coverage-7.3.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d8f17966e861ff97305e0801134e69db33b143bbfb36436efb9cfff6ec7b2fd9"}, + {file = "coverage-7.3.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:b4275802d16882cf9c8b3d057a0839acb07ee9379fa2749eca54efbce1535b82"}, + {file = "coverage-7.3.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:72c0cfa5250f483181e677ebc97133ea1ab3eb68645e494775deb6a7f6f83901"}, + {file = "coverage-7.3.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:cb536f0dcd14149425996821a168f6e269d7dcd2c273a8bff8201e79f5104e76"}, + {file = "coverage-7.3.2-cp38-cp38-win32.whl", hash = "sha256:307adb8bd3abe389a471e649038a71b4eb13bfd6b7dd9a129fa856f5c695cf92"}, + {file = "coverage-7.3.2-cp38-cp38-win_amd64.whl", hash = "sha256:88ed2c30a49ea81ea3b7f172e0269c182a44c236eb394718f976239892c0a27a"}, + {file = "coverage-7.3.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:b631c92dfe601adf8f5ebc7fc13ced6bb6e9609b19d9a8cd59fa47c4186ad1ce"}, + {file = "coverage-7.3.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:d3d9df4051c4a7d13036524b66ecf7a7537d14c18a384043f30a303b146164e9"}, + {file = "coverage-7.3.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5f7363d3b6a1119ef05015959ca24a9afc0ea8a02c687fe7e2d557705375c01f"}, + {file = "coverage-7.3.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2f11cc3c967a09d3695d2a6f03fb3e6236622b93be7a4b5dc09166a861be6d25"}, + {file = "coverage-7.3.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:149de1d2401ae4655c436a3dced6dd153f4c3309f599c3d4bd97ab172eaf02d9"}, + {file = "coverage-7.3.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:3a4006916aa6fee7cd38db3bfc95aa9c54ebb4ffbfc47c677c8bba949ceba0a6"}, + {file = "coverage-7.3.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:9028a3871280110d6e1aa2df1afd5ef003bab5fb1ef421d6dc748ae1c8ef2ebc"}, + {file = "coverage-7.3.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:9f805d62aec8eb92bab5b61c0f07329275b6f41c97d80e847b03eb894f38d083"}, + {file = "coverage-7.3.2-cp39-cp39-win32.whl", hash = "sha256:d1c88ec1a7ff4ebca0219f5b1ef863451d828cccf889c173e1253aa84b1e07ce"}, + {file = "coverage-7.3.2-cp39-cp39-win_amd64.whl", hash = "sha256:b4767da59464bb593c07afceaddea61b154136300881844768037fd5e859353f"}, + {file = "coverage-7.3.2-pp38.pp39.pp310-none-any.whl", hash = "sha256:ae97af89f0fbf373400970c0a21eef5aa941ffeed90aee43650b81f7d7f47637"}, + {file = "coverage-7.3.2.tar.gz", hash = "sha256:be32ad29341b0170e795ca590e1c07e81fc061cb5b10c74ce7203491484404ef"}, ] [package.dependencies] @@ -339,13 +318,13 @@ toml = ["tomli"] [[package]] name = "exceptiongroup" -version = "1.1.2" +version = "1.2.0" description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" files = [ - {file = "exceptiongroup-1.1.2-py3-none-any.whl", hash = "sha256:e346e69d186172ca7cf029c8c1d16235aa0e04035e5750b4b95039e65204328f"}, - {file = "exceptiongroup-1.1.2.tar.gz", hash = "sha256:12c3e887d6485d16943a309616de20ae5582633e0a2eda17f4e10fd61c1e8af5"}, + {file = "exceptiongroup-1.2.0-py3-none-any.whl", hash = "sha256:4bfd3996ac73b41e9b9628b04e079f193850720ea5945fc96a08633c66912f14"}, + {file = "exceptiongroup-1.2.0.tar.gz", hash = "sha256:91f5c769735f051a4290d52edd0858999b57e5876e9f85937691bd4c9fa3ed68"}, ] [package.extras] @@ -353,27 +332,28 @@ test = ["pytest (>=6)"] [[package]] name = "fastavro" -version = "1.4.12" +version = "1.6.1" description = "Fast read/write of AVRO files" optional = false python-versions = ">=3.7" files = [ - {file = "fastavro-1.4.12-cp310-cp310-macosx_10_14_x86_64.whl", hash = "sha256:97c47004fb7e6a1f38d729124e9607128577a15ee5a4d10c7f680251f1a4f204"}, - {file = "fastavro-1.4.12-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a38a954a45422fffedd1f65283b3ed8f32965a8399f545189d0b75e450407ff2"}, - {file = "fastavro-1.4.12-cp310-cp310-win_amd64.whl", hash = "sha256:fee2240cff5a249458df604893abcc571efa178fa9b01f4ae0fa824295da3b54"}, - {file = "fastavro-1.4.12-cp37-cp37m-macosx_10_15_x86_64.whl", hash = "sha256:bc41b3495a34a17e17e77c7bc82ddaa5edaec82e103e763d0fb60cbb4d0efff0"}, - {file = "fastavro-1.4.12-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6326d763939a2a9de560dd88035a9902660145745b6dda2060be5caee3d8e779"}, - {file = "fastavro-1.4.12-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2a9d418dbcba12e85ae1fd395d92917d592544b0dfe64db13ffebeb4959dd67f"}, - {file = "fastavro-1.4.12-cp37-cp37m-win_amd64.whl", hash = "sha256:e5888f81600c7cd62aeb9ed86b63d6e63dc9ad040b404c0ab42f4194f170d2b6"}, - {file = "fastavro-1.4.12-cp38-cp38-macosx_10_15_x86_64.whl", hash = "sha256:7a8f273ac00f20adebfa394aea4219caf76844134ea21b53d393a1ae9a54f828"}, - {file = "fastavro-1.4.12-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e88cc1f73421d3f60c21fa982fdb91411ac068506442d3a984a2b6ea400ae9dc"}, - {file = "fastavro-1.4.12-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4e4b81c09346d6f47153b3c391e8f65bef0fc4dfd19b0e2bc7843f00e07ee1be"}, - {file = "fastavro-1.4.12-cp38-cp38-win_amd64.whl", hash = "sha256:3b04882e04192a64c06a8487a168e289f71cd31e51e1275bd34bb19d70669b48"}, - {file = "fastavro-1.4.12-cp39-cp39-macosx_10_15_x86_64.whl", hash = "sha256:1df7cd4248c0dbbd0c9be4643eb416f6e4f058211b6eaf4e15286813ab2a70ff"}, - {file = "fastavro-1.4.12-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:772527b59c4294f44f42328a4d2defe67a6db5f203f65257e698a1ff5b476a2f"}, - {file = "fastavro-1.4.12-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4fca5343950963545c1dd9db17e0451daf19fa50ac9e44313abd20e88cef3e48"}, - {file = "fastavro-1.4.12-cp39-cp39-win_amd64.whl", hash = "sha256:b289e4ed691f0fc5919ffc1c8d4bcb626055deaf75a5a2bca9015dc2367d95af"}, - {file = "fastavro-1.4.12.tar.gz", hash = "sha256:28c0d63eb286e64e9da79e083e299c33f1df65a490a1d79444dc453950daca40"}, + {file = "fastavro-1.6.1-cp310-cp310-macosx_10_14_x86_64.whl", hash = "sha256:de244146a3d7bc4e60c7be11f317054ee0e57ca807d85923bd8407981488ff18"}, + {file = "fastavro-1.6.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1ed84fb27672e54b0bafecae1f128f6e2950828f451e59f93bb74eeccb31b496"}, + {file = "fastavro-1.6.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:98df91eff0c061ffeb722732ba61d4ea9c7afd0f5403534991a984e75e3b2272"}, + {file = "fastavro-1.6.1-cp310-cp310-win_amd64.whl", hash = "sha256:fd60999204f60d5bcc4e9a4461ce867efb23d271e955684b36c04970750e2ccb"}, + {file = "fastavro-1.6.1-cp37-cp37m-macosx_10_15_x86_64.whl", hash = "sha256:19d4e83bf952fc2893d11d4c82cf04c3938c921a7c5bf277256cda1005e59f16"}, + {file = "fastavro-1.6.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:945d5f6e7a3076758b52fe1cebecfd86b66e6925a3a38732e93f3e1eab955256"}, + {file = "fastavro-1.6.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:315084c45339845273193545a50f3d616787eb3231b0b1f3df229196b22f192e"}, + {file = "fastavro-1.6.1-cp37-cp37m-win_amd64.whl", hash = "sha256:3ef81602dc6ecac3d646d64fe13aeb11252f75b76141b5b3d755bbf548313718"}, + {file = "fastavro-1.6.1-cp38-cp38-macosx_10_15_x86_64.whl", hash = "sha256:462c3177aa231f8b023d4af0a73f41517df8160399564fc750a711faa0889b59"}, + {file = "fastavro-1.6.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3dd8c98d410fbb46a475242cea1b86061d2568db89919eb9079a9a183f04d444"}, + {file = "fastavro-1.6.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b8b77e8f33e55d8f63d65f58a2b2c99248093e2da2e8a86f58320f5715fc3f54"}, + {file = "fastavro-1.6.1-cp38-cp38-win_amd64.whl", hash = "sha256:ac31f490e3030a6c608fffa6e337bd3f1b00f227bcb098df88a6e3e38982dfa5"}, + {file = "fastavro-1.6.1-cp39-cp39-macosx_10_15_x86_64.whl", hash = "sha256:3e479b9e4b5e6184b57daab57f1992e649590e902d26b7e2ef50a605626e9053"}, + {file = "fastavro-1.6.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f2ec2fa5f100e0f1010f550de6de8b1019a683c5034613772b4444d7c85bdb57"}, + {file = "fastavro-1.6.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1b34c4d33e22ada2fa19566a43976b3f5ca937ab6e054e65e1467bf67353f352"}, + {file = "fastavro-1.6.1-cp39-cp39-win_amd64.whl", hash = "sha256:18f0ddf3cc4f09839c08eec67ed3be3d391894874cb87f856a0362540d18df17"}, + {file = "fastavro-1.6.1.tar.gz", hash = "sha256:bc37a6edbde7a04a9df28ab838b94df7527e5eea648d61633233abba59205146"}, ] [package.extras] @@ -547,13 +527,13 @@ files = [ [[package]] name = "packaging" -version = "23.1" +version = "23.2" description = "Core utilities for Python packages" optional = false python-versions = ">=3.7" files = [ - {file = "packaging-23.1-py3-none-any.whl", hash = "sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61"}, - {file = "packaging-23.1.tar.gz", hash = "sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f"}, + {file = "packaging-23.2-py3-none-any.whl", hash = "sha256:8c491190033a9af7e1d931d0b5dacc2ef47509b34dd0de67ed209b5203fc88c7"}, + {file = "packaging-23.2.tar.gz", hash = "sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5"}, ] [[package]] @@ -593,7 +573,10 @@ files = [ ] [package.dependencies] -numpy = {version = ">=1.20.3", markers = "python_version < \"3.10\""} +numpy = [ + {version = ">=1.21.0", markers = "python_version >= \"3.10\""}, + {version = ">=1.23.2", markers = "python_version >= \"3.11\""}, +] python-dateutil = ">=2.8.1" pytz = ">=2020.1" @@ -602,39 +585,39 @@ test = ["hypothesis (>=5.5.3)", "pytest (>=6.0)", "pytest-xdist (>=1.31)"] [[package]] name = "pathspec" -version = "0.11.1" +version = "0.11.2" description = "Utility library for gitignore style pattern matching of file paths." optional = false python-versions = ">=3.7" files = [ - {file = "pathspec-0.11.1-py3-none-any.whl", hash = "sha256:d8af70af76652554bd134c22b3e8a1cc46ed7d91edcdd721ef1a0c51a84a5293"}, - {file = "pathspec-0.11.1.tar.gz", hash = "sha256:2798de800fa92780e33acca925945e9a19a133b715067cf165b8866c15a31687"}, + {file = "pathspec-0.11.2-py3-none-any.whl", hash = "sha256:1d6ed233af05e679efb96b1851550ea95bbb64b7c490b0f5aa52996c11e92a20"}, + {file = "pathspec-0.11.2.tar.gz", hash = "sha256:e0d8d0ac2f12da61956eb2306b69f9469b42f4deb0f3cb6ed47b9cce9996ced3"}, ] [[package]] name = "platformdirs" -version = "3.9.1" +version = "4.0.0" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." optional = false python-versions = ">=3.7" files = [ - {file = "platformdirs-3.9.1-py3-none-any.whl", hash = "sha256:ad8291ae0ae5072f66c16945166cb11c63394c7a3ad1b1bc9828ca3162da8c2f"}, - {file = "platformdirs-3.9.1.tar.gz", hash = "sha256:1b42b450ad933e981d56e59f1b97495428c9bd60698baab9f3eb3d00d5822421"}, + {file = "platformdirs-4.0.0-py3-none-any.whl", hash = "sha256:118c954d7e949b35437270383a3f2531e99dd93cf7ce4dc8340d3356d30f173b"}, + {file = "platformdirs-4.0.0.tar.gz", hash = "sha256:cb633b2bcf10c51af60beb0ab06d2f1d69064b43abf4c185ca6b28865f3f9731"}, ] [package.extras] -docs = ["furo (>=2023.5.20)", "proselint (>=0.13)", "sphinx (>=7.0.1)", "sphinx-autodoc-typehints (>=1.23,!=1.23.4)"] -test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.3.1)", "pytest-cov (>=4.1)", "pytest-mock (>=3.10)"] +docs = ["furo (>=2023.7.26)", "proselint (>=0.13)", "sphinx (>=7.1.1)", "sphinx-autodoc-typehints (>=1.24)"] +test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4)", "pytest-cov (>=4.1)", "pytest-mock (>=3.11.1)"] [[package]] name = "pluggy" -version = "1.2.0" +version = "1.3.0" description = "plugin and hook calling mechanisms for python" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "pluggy-1.2.0-py3-none-any.whl", hash = "sha256:c2fd55a7d7a3863cba1a013e4e2414658b1d07b6bc57b3919e0c63c9abb99849"}, - {file = "pluggy-1.2.0.tar.gz", hash = "sha256:d12f0c4b579b15f5e054301bb226ee85eeeba08ffec228092f8defbaa3a4c4b3"}, + {file = "pluggy-1.3.0-py3-none-any.whl", hash = "sha256:d89c696a773f8bd377d18e5ecda92b7a3793cbe66c87060a6fb58c7b6e1061f7"}, + {file = "pluggy-1.3.0.tar.gz", hash = "sha256:cf61ae8f126ac6f7c451172cf30e3e43d3ca77615509771b3a984a0730651e12"}, ] [package.extras] @@ -685,13 +668,13 @@ cffi = ">=1.6.0" [[package]] name = "pytest" -version = "7.4.0" +version = "7.4.3" description = "pytest: simple powerful testing with Python" optional = false python-versions = ">=3.7" files = [ - {file = "pytest-7.4.0-py3-none-any.whl", hash = "sha256:78bf16451a2eb8c7a2ea98e32dc119fd2aa758f1d5d66dbf0a59d69a3969df32"}, - {file = "pytest-7.4.0.tar.gz", hash = "sha256:b4bf8c45bd59934ed84001ad51e11b4ee40d40a1229d2c79f9c592b0a3f6bd8a"}, + {file = "pytest-7.4.3-py3-none-any.whl", hash = "sha256:0d009c083ea859a71b76adf7c1d502e4bc170b80a8ef002da5806527b9591fac"}, + {file = "pytest-7.4.3.tar.gz", hash = "sha256:d989d136982de4e3b29dabcc838ad581c64e8ed52c11fbe86ddebd9da0818cd5"}, ] [package.dependencies] @@ -758,13 +741,13 @@ six = ">=1.5" [[package]] name = "pytz" -version = "2023.3" +version = "2023.3.post1" description = "World timezone definitions, modern and historical" optional = false python-versions = "*" files = [ - {file = "pytz-2023.3-py2.py3-none-any.whl", hash = "sha256:a151b3abb88eda1d4e34a9814df37de2a80e301e68ba0fd856fb9b46bfbbbffb"}, - {file = "pytz-2023.3.tar.gz", hash = "sha256:1d8ce29db189191fb55338ee6d0387d82ab59f3d00eac103412d64e0ebd0c588"}, + {file = "pytz-2023.3.post1-py2.py3-none-any.whl", hash = "sha256:ce42d816b81b68506614c11e8937d3aa9e41007ceb50bfdcb0749b921bf646c7"}, + {file = "pytz-2023.3.post1.tar.gz", hash = "sha256:7b4fddbeb94a1eba4b557da24f19fdf9db575192544270a9101d8509f9f43d7b"}, ] [[package]] @@ -818,13 +801,13 @@ files = [ [[package]] name = "s3transfer" -version = "0.6.1" +version = "0.6.2" description = "An Amazon S3 Transfer Manager" optional = false python-versions = ">= 3.7" files = [ - {file = "s3transfer-0.6.1-py3-none-any.whl", hash = "sha256:3c0da2d074bf35d6870ef157158641178a4204a6e689e82546083e31e0311346"}, - {file = "s3transfer-0.6.1.tar.gz", hash = "sha256:640bb492711f4c0c0905e1f62b6aaeb771881935ad27884852411f8e9cacbca9"}, + {file = "s3transfer-0.6.2-py3-none-any.whl", hash = "sha256:b014be3a8a2aab98cfe1abc7229cc5a9a0cf05eb9c1f2b86b230fd8df3f78084"}, + {file = "s3transfer-0.6.2.tar.gz", hash = "sha256:cab66d3380cca3e70939ef2255d01cd8aece6a4907a9528740f668c4b0611861"}, ] [package.dependencies] @@ -855,30 +838,19 @@ files = [ {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, ] -[[package]] -name = "typing-extensions" -version = "4.7.1" -description = "Backported and Experimental Type Hints for Python 3.7+" -optional = false -python-versions = ">=3.7" -files = [ - {file = "typing_extensions-4.7.1-py3-none-any.whl", hash = "sha256:440d5dd3af93b060174bf433bccd69b0babc3b15b1a8dca43789fd7f61514b36"}, - {file = "typing_extensions-4.7.1.tar.gz", hash = "sha256:b75ddc264f0ba5615db7ba217daeb99701ad295353c45f9e95963337ceeeffb2"}, -] - [[package]] name = "urllib3" -version = "1.26.16" +version = "1.26.18" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" files = [ - {file = "urllib3-1.26.16-py2.py3-none-any.whl", hash = "sha256:8d36afa7616d8ab714608411b4a3b13e58f463aee519024578e062e141dce20f"}, - {file = "urllib3-1.26.16.tar.gz", hash = "sha256:8f135f6502756bde6b2a9b28989df5fbe87c9970cecaa69041edcce7f0589b14"}, + {file = "urllib3-1.26.18-py2.py3-none-any.whl", hash = "sha256:34b97092d7e0a3a8cf7cd10e386f401b3737364026c45e622aa02903dffe0f07"}, + {file = "urllib3-1.26.18.tar.gz", hash = "sha256:f8ecc1bba5667413457c529ab955bf8c67b45db799d159066261719e328580a0"}, ] [package.extras] -brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)", "brotlipy (>=0.6.0)"] +brotli = ["brotli (==1.0.9)", "brotli (>=1.0.9)", "brotlicffi (>=0.8.0)", "brotlipy (>=0.6.0)"] secure = ["certifi", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "ipaddress", "pyOpenSSL (>=0.14)", "urllib3-secure-extra"] socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] @@ -899,10 +871,7 @@ six = ">=1.11.0" doc = ["sphinx"] test = ["pytest (>=4.6.7)", "pytest-cov (>=2.6.1)"] -[extras] -apf = ["apf-base", "confluent-kafka", "fastavro", "prometheus-client"] - [metadata] lock-version = "2.0" -python-versions = "~3.9.0" -content-hash = "7012bd54a9e28b8cf7ca7d9d73ac65a9d04a8cd17cc8b2411e59fc8200f7515c" +python-versions = "^3.10" +content-hash = "4a8d70a10b15fa8074c3228db0b117b1a7b977b5dc63de2683f97519159def90" diff --git a/magstats_step/pyproject.toml b/magstats_step/pyproject.toml index f97cf755a..fe949f131 100644 --- a/magstats_step/pyproject.toml +++ b/magstats_step/pyproject.toml @@ -2,22 +2,16 @@ name = "magstats-step" version = "6.2.1a190" description = "" -authors = ["ASHuenchuleo "] +authors = ["ASHuenchuleo ", "Pablo Castellanos"] readme = "README.md" packages = [{include = "magstats_step"}] [tool.poetry.dependencies] -python = "~3.9.0" +python = "^3.10" apf-base = { path = "../libs/apf", develop = true } methodtools = "^0.4.7" numpy = "~1.24.2" pandas = "~1.5.3" -fastavro = { version = "~1.4.12", optional = true } -prometheus-client = { version = "~0.16.0", optional = true } -confluent-kafka = { version = "~2.0.2", optional = true } - -[tool.poetry.extras] -apf = ["fastavro", "prometheus-client", "confluent-kafka", "apf_base"] [tool.poetry.group.dev.dependencies] black = "^22.12.0" @@ -28,10 +22,7 @@ pytest-cov = "^4.0.0" pytest-docker = "^1.0.1" [tool.black] -line-length = 120 - -[tool.poetry.scripts] -step = { callable = "scripts.run_step:step_factory()", extras = ["apf"] } +line-length = 79 [build-system] requires = ["poetry-core"] diff --git a/magstats_step/scribe_schema.avsc b/magstats_step/scribe_schema.avsc deleted file mode 100644 index a18665874..000000000 --- a/magstats_step/scribe_schema.avsc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "type": "record", - "name": "scribe_message", - "fields": [{ "name": "payload", "type": "string" }] -} diff --git a/magstats_step/tests/integration/conftest.py b/magstats_step/tests/integration/conftest.py index 8576096c9..842bf118f 100644 --- a/magstats_step/tests/integration/conftest.py +++ b/magstats_step/tests/integration/conftest.py @@ -10,7 +10,9 @@ @pytest.fixture(scope="session") def docker_compose_file(pytestconfig): - return os.path.join(str(pytestconfig.rootdir), "tests/integration", "docker-compose.yaml") + return os.path.join( + str(pytestconfig.rootdir), "tests/integration", "docker-compose.yaml" + ) @pytest.fixture(scope="session") @@ -42,7 +44,9 @@ def kafka_service(docker_ip, docker_services): """Ensure that Kafka service is up and responsive.""" port = docker_services.port_for("kafka", 9092) server = f"{docker_ip}:{port}" - docker_services.wait_until_responsive(timeout=30.0, pause=0.1, check=lambda: is_responsive_kafka(server)) + docker_services.wait_until_responsive( + timeout=30.0, pause=0.1, check=lambda: is_responsive_kafka(server) + ) return server @@ -91,7 +95,9 @@ def produce_messages(topic): { "PARAMS": {"bootstrap.servers": "localhost:9092"}, "TOPIC": topic, - "SCHEMA_PATH": os.path.join(os.path.dirname(__file__), "../../schema.avsc"), + "SCHEMA_PATH": os.path.join( + os.path.dirname(__file__), "../../schema.avsc" + ), } ) diff --git a/magstats_step/tests/integration/test_step.py b/magstats_step/tests/integration/test_step.py index 13e6ace25..4941b9cf3 100644 --- a/magstats_step/tests/integration/test_step.py +++ b/magstats_step/tests/integration/test_step.py @@ -16,7 +16,17 @@ def assert_message_schema(command): def assert_command_data_schema(data): - expected_fields = ["lastmjd", "meandec", "meanra", "sigmadec", "corrected", "firstmjd", "magstats"] + expected_fields = [ + "lastmjd", + "meandec", + "meanra", + "sigmadec", + "corrected", + "firstmjd", + "lastmjd", + "deltajd", + "magstats", + ] for field in expected_fields: assert field in data diff --git a/magstats_step/tests/unittests/test_magstats.py b/magstats_step/tests/unittests/test_magstats.py index bb04cb9d4..237d8f891 100644 --- a/magstats_step/tests/unittests/test_magstats.py +++ b/magstats_step/tests/unittests/test_magstats.py @@ -8,12 +8,54 @@ def test_calculate_uncorrected_stats_gives_statistics_for_magnitudes_per_aid_and_fid(): detections = [ - {"aid": "AID1", "sid": "SURVEY", "fid": 1, "mag": 2, "candid": "a", "forced": False}, - {"aid": "AID1", "sid": "SURVEY", "fid": 1, "mag": 2, "candid": "b", "forced": False}, - {"aid": "AID1", "sid": "SURVEY", "fid": 1, "mag": 5, "candid": "c", "forced": False}, - {"aid": "AID2", "sid": "SURVEY", "fid": 1, "mag": 1, "candid": "d", "forced": False}, - {"aid": "AID1", "sid": "SURVEY", "fid": 2, "mag": 1, "candid": "e", "forced": False}, - {"aid": "AID1", "sid": "SURVEY", "fid": 2, "mag": 2, "candid": "f", "forced": False}, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 1, + "mag": 2, + "candid": "a", + "forced": False, + }, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 1, + "mag": 2, + "candid": "b", + "forced": False, + }, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 1, + "mag": 5, + "candid": "c", + "forced": False, + }, + { + "aid": "AID2", + "sid": "SURVEY", + "fid": 1, + "mag": 1, + "candid": "d", + "forced": False, + }, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 2, + "mag": 1, + "candid": "e", + "forced": False, + }, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 2, + "mag": 2, + "candid": "f", + "forced": False, + }, ] calculator = MagnitudeStatistics(detections) result = calculator._calculate_stats(False) @@ -30,19 +72,85 @@ def test_calculate_uncorrected_stats_gives_statistics_for_magnitudes_per_aid_and "fid": [1, 1, 2], } ) - assert_frame_equal(result, expected.set_index(["aid", "sid", "fid"]), check_like=True) + assert_frame_equal( + result, expected.set_index(["aid", "sid", "fid"]), check_like=True + ) def test_calculate_corrected_stats_gives_statistics_for_corrected_magnitudes_per_aid_and_fid(): detections = [ - {"aid": "AID1", "sid": "SURVEY", "fid": 1, "mag_corr": 2, "corrected": True, "candid": "a", "forced": False}, - {"aid": "AID1", "sid": "SURVEY", "fid": 1, "mag_corr": 2, "corrected": True, "candid": "b", "forced": False}, - {"aid": "AID1", "sid": "SURVEY", "fid": 1, "mag_corr": 5, "corrected": True, "candid": "c", "forced": False}, - {"aid": "AID1", "sid": "SURVEY", "fid": 1, "mag_corr": 5, "corrected": False, "candid": "c1", "forced": False}, - {"aid": "AID2", "sid": "SURVEY", "fid": 1, "mag_corr": 1, "corrected": True, "candid": "d", "forced": False}, - {"aid": "AID1", "sid": "SURVEY", "fid": 2, "mag_corr": 1, "corrected": True, "candid": "e", "forced": False}, - {"aid": "AID1", "sid": "SURVEY", "fid": 2, "mag_corr": 2, "corrected": True, "candid": "f", "forced": False}, - {"aid": "AID2", "sid": "SURVEY", "fid": 2, "mag_corr": 2, "corrected": False, "candid": "f1", "forced": False}, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 1, + "mag_corr": 2, + "corrected": True, + "candid": "a", + "forced": False, + }, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 1, + "mag_corr": 2, + "corrected": True, + "candid": "b", + "forced": False, + }, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 1, + "mag_corr": 5, + "corrected": True, + "candid": "c", + "forced": False, + }, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 1, + "mag_corr": 5, + "corrected": False, + "candid": "c1", + "forced": False, + }, + { + "aid": "AID2", + "sid": "SURVEY", + "fid": 1, + "mag_corr": 1, + "corrected": True, + "candid": "d", + "forced": False, + }, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 2, + "mag_corr": 1, + "corrected": True, + "candid": "e", + "forced": False, + }, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 2, + "mag_corr": 2, + "corrected": True, + "candid": "f", + "forced": False, + }, + { + "aid": "AID2", + "sid": "SURVEY", + "fid": 2, + "mag_corr": 2, + "corrected": False, + "candid": "f1", + "forced": False, + }, ] calculator = MagnitudeStatistics(detections) result = calculator._calculate_stats(True) @@ -59,14 +167,40 @@ def test_calculate_corrected_stats_gives_statistics_for_corrected_magnitudes_per "fid": [1, 1, 2], } ) - assert_frame_equal(result, expected.set_index(["aid", "sid", "fid"]), check_like=True) + assert_frame_equal( + result, expected.set_index(["aid", "sid", "fid"]), check_like=True + ) def test_calculate_uncorrected_stats_over_time_gives_first_and_last_magnitude_per_aid_and_fid(): detections = [ - {"aid": "AID1", "sid": "SURVEY", "fid": 1, "mjd": 3, "mag": 1, "candid": "a", "forced": False}, # last - {"aid": "AID1", "sid": "SURVEY", "fid": 1, "mjd": 1, "mag": 2, "candid": "b", "forced": False}, # first - {"aid": "AID1", "sid": "SURVEY", "fid": 1, "mjd": 2, "mag": 3, "candid": "c", "forced": False}, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 1, + "mjd": 3, + "mag": 1, + "candid": "a", + "forced": False, + }, # last + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 1, + "mjd": 1, + "mag": 2, + "candid": "b", + "forced": False, + }, # first + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 1, + "mjd": 2, + "mag": 3, + "candid": "c", + "forced": False, + }, { "aid": "AID2", "sid": "SURVEY", @@ -76,8 +210,24 @@ def test_calculate_uncorrected_stats_over_time_gives_first_and_last_magnitude_pe "candid": "d", "forced": False, }, # last and first - {"aid": "AID1", "sid": "SURVEY", "fid": 2, "mjd": 1, "mag": 1, "candid": "e", "forced": False}, # first - {"aid": "AID1", "sid": "SURVEY", "fid": 2, "mjd": 2, "mag": 2, "candid": "f", "forced": False}, # last + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 2, + "mjd": 1, + "mag": 1, + "candid": "e", + "forced": False, + }, # first + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 2, + "mjd": 2, + "mag": 2, + "candid": "f", + "forced": False, + }, # last ] calculator = MagnitudeStatistics(detections) result = calculator._calculate_stats_over_time(False) @@ -91,7 +241,9 @@ def test_calculate_uncorrected_stats_over_time_gives_first_and_last_magnitude_pe "fid": [1, 1, 2], } ) - assert_frame_equal(result, expected.set_index(["aid", "sid", "fid"]), check_like=True) + assert_frame_equal( + result, expected.set_index(["aid", "sid", "fid"]), check_like=True + ) def test_calculate_corrected_stats_over_time_gives_first_and_last_corrected_magnitude_per_aid_and_fid(): @@ -189,7 +341,9 @@ def test_calculate_corrected_stats_over_time_gives_first_and_last_corrected_magn "fid": [1, 1, 2], } ) - assert_frame_equal(result, expected.set_index(["aid", "sid", "fid"]), check_like=True) + assert_frame_equal( + result, expected.set_index(["aid", "sid", "fid"]), check_like=True + ) def test_calculate_statistics_calls_stats_and_stats_over_time_with_both_corrected_and_full_magnitudes(): @@ -208,12 +362,54 @@ def test_calculate_statistics_calls_stats_and_stats_over_time_with_both_correcte def test_calculate_firstmjd_gives_first_date_per_aid_and_fid(): detections = [ - {"aid": "AID1", "sid": "SURVEY", "fid": 1, "mjd": 3, "candid": "a", "forced": False}, - {"aid": "AID1", "sid": "SURVEY", "fid": 1, "mjd": 0, "candid": "b", "forced": False}, - {"aid": "AID1", "sid": "SURVEY", "fid": 1, "mjd": 2, "candid": "c", "forced": False}, - {"aid": "AID2", "sid": "SURVEY", "fid": 1, "mjd": 0.5, "candid": "d", "forced": False}, - {"aid": "AID1", "sid": "SURVEY", "fid": 2, "mjd": 1, "candid": "e", "forced": False}, - {"aid": "AID1", "sid": "SURVEY", "fid": 2, "mjd": 2, "candid": "f", "forced": False}, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 1, + "mjd": 3, + "candid": "a", + "forced": False, + }, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 1, + "mjd": 0, + "candid": "b", + "forced": False, + }, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 1, + "mjd": 2, + "candid": "c", + "forced": False, + }, + { + "aid": "AID2", + "sid": "SURVEY", + "fid": 1, + "mjd": 0.5, + "candid": "d", + "forced": False, + }, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 2, + "mjd": 1, + "candid": "e", + "forced": False, + }, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 2, + "mjd": 2, + "candid": "f", + "forced": False, + }, ] calculator = MagnitudeStatistics(detections) result = calculator.calculate_firstmjd() @@ -226,35 +422,134 @@ def test_calculate_firstmjd_gives_first_date_per_aid_and_fid(): "fid": [1, 1, 2], } ) - assert_frame_equal(result, expected.set_index(["aid", "sid", "fid"]), check_like=True) + assert_frame_equal( + result, expected.set_index(["aid", "sid", "fid"]), check_like=True + ) def test_calculate_lastmjd_gives_last_date_per_aid_and_fid(): detections = [ - {"aid": "AID1", "sid": "SURVEY", "fid": 1, "mjd": 3, "candid": "a", "forced": False}, - {"aid": "AID1", "sid": "SURVEY", "fid": 1, "mjd": 1, "candid": "b", "forced": False}, - {"aid": "AID1", "sid": "SURVEY", "fid": 1, "mjd": 2, "candid": "c", "forced": False}, - {"aid": "AID2", "sid": "SURVEY", "fid": 1, "mjd": 1, "candid": "d", "forced": False}, - {"aid": "AID1", "sid": "SURVEY", "fid": 2, "mjd": 1, "candid": "e", "forced": False}, - {"aid": "AID1", "sid": "SURVEY", "fid": 2, "mjd": 2, "candid": "f", "forced": False}, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 1, + "mjd": 3, + "candid": "a", + "forced": False, + }, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 1, + "mjd": 1, + "candid": "b", + "forced": False, + }, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 1, + "mjd": 2, + "candid": "c", + "forced": False, + }, + { + "aid": "AID2", + "sid": "SURVEY", + "fid": 1, + "mjd": 1, + "candid": "d", + "forced": False, + }, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 2, + "mjd": 1, + "candid": "e", + "forced": False, + }, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 2, + "mjd": 2, + "candid": "f", + "forced": False, + }, ] calculator = MagnitudeStatistics(detections) result = calculator.calculate_lastmjd() expected = pd.DataFrame( - {"lastmjd": [3, 1, 2], "aid": ["AID1", "AID2", "AID1"], "sid": ["SURVEY", "SURVEY", "SURVEY"], "fid": [1, 1, 2]} + { + "lastmjd": [3, 1, 2], + "aid": ["AID1", "AID2", "AID1"], + "sid": ["SURVEY", "SURVEY", "SURVEY"], + "fid": [1, 1, 2], + } + ) + assert_frame_equal( + result, expected.set_index(["aid", "sid", "fid"]), check_like=True ) - assert_frame_equal(result, expected.set_index(["aid", "sid", "fid"]), check_like=True) def test_calculate_corrected_gives_whether_first_detection_per_aid_and_fid_is_corrected(): detections = [ - {"aid": "AID1", "sid": "SURVEY", "fid": 1, "mjd": 3, "corrected": True, "candid": "a", "forced": False}, - {"aid": "AID1", "sid": "SURVEY", "fid": 1, "mjd": 1, "corrected": False, "candid": "b", "forced": False}, - {"aid": "AID1", "sid": "SURVEY", "fid": 1, "mjd": 2, "corrected": True, "candid": "c", "forced": False}, - {"aid": "AID2", "sid": "SURVEY", "fid": 1, "mjd": 1, "corrected": True, "candid": "d", "forced": False}, - {"aid": "AID1", "sid": "SURVEY", "fid": 2, "mjd": 1, "corrected": True, "candid": "e", "forced": False}, - {"aid": "AID1", "sid": "SURVEY", "fid": 2, "mjd": 2, "corrected": False, "candid": "f", "forced": False}, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 1, + "mjd": 3, + "corrected": True, + "candid": "a", + "forced": False, + }, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 1, + "mjd": 1, + "corrected": False, + "candid": "b", + "forced": False, + }, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 1, + "mjd": 2, + "corrected": True, + "candid": "c", + "forced": False, + }, + { + "aid": "AID2", + "sid": "SURVEY", + "fid": 1, + "mjd": 1, + "corrected": True, + "candid": "d", + "forced": False, + }, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 2, + "mjd": 1, + "corrected": True, + "candid": "e", + "forced": False, + }, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 2, + "mjd": 2, + "corrected": False, + "candid": "f", + "forced": False, + }, ] calculator = MagnitudeStatistics(detections) result = calculator.calculate_corrected() @@ -267,17 +562,67 @@ def test_calculate_corrected_gives_whether_first_detection_per_aid_and_fid_is_co "fid": [1, 1, 2], } ) - assert_frame_equal(result, expected.set_index(["aid", "sid", "fid"]), check_like=True) + assert_frame_equal( + result, expected.set_index(["aid", "sid", "fid"]), check_like=True + ) def test_calculate_stellar_gives_whether_first_detection_per_aid_and_fid_is_stellar(): detections = [ - {"aid": "AID1", "sid": "SURVEY", "fid": 1, "mjd": 3, "stellar": True, "candid": "a", "forced": False}, - {"aid": "AID1", "sid": "SURVEY", "fid": 1, "mjd": 1, "stellar": False, "candid": "b", "forced": False}, - {"aid": "AID1", "sid": "SURVEY", "fid": 1, "mjd": 2, "stellar": True, "candid": "c", "forced": False}, - {"aid": "AID2", "sid": "SURVEY", "fid": 1, "mjd": 1, "stellar": True, "candid": "d", "forced": False}, - {"aid": "AID1", "sid": "SURVEY", "fid": 2, "mjd": 1, "stellar": True, "candid": "e", "forced": False}, - {"aid": "AID1", "sid": "SURVEY", "fid": 2, "mjd": 2, "stellar": False, "candid": "f", "forced": False}, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 1, + "mjd": 3, + "stellar": True, + "candid": "a", + "forced": False, + }, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 1, + "mjd": 1, + "stellar": False, + "candid": "b", + "forced": False, + }, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 1, + "mjd": 2, + "stellar": True, + "candid": "c", + "forced": False, + }, + { + "aid": "AID2", + "sid": "SURVEY", + "fid": 1, + "mjd": 1, + "stellar": True, + "candid": "d", + "forced": False, + }, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 2, + "mjd": 1, + "stellar": True, + "candid": "e", + "forced": False, + }, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 2, + "mjd": 2, + "stellar": False, + "candid": "f", + "forced": False, + }, ] calculator = MagnitudeStatistics(detections) result = calculator.calculate_stellar() @@ -290,35 +635,122 @@ def test_calculate_stellar_gives_whether_first_detection_per_aid_and_fid_is_stel "fid": [1, 1, 2], } ) - assert_frame_equal(result, expected.set_index(["aid", "sid", "fid"]), check_like=True) + assert_frame_equal( + result, expected.set_index(["aid", "sid", "fid"]), check_like=True + ) def test_calculate_ndet_gives_number_of_detections_per_aid_and_fid(): detections = [ - {"aid": "AID1", "sid": "SURVEY", "fid": 1, "candid": "a", "forced": False}, - {"aid": "AID1", "sid": "SURVEY", "fid": 1, "candid": "b", "forced": False}, - {"aid": "AID1", "sid": "SURVEY", "fid": 1, "candid": "c", "forced": False}, - {"aid": "AID2", "sid": "SURVEY", "fid": 1, "candid": "d", "forced": False}, - {"aid": "AID1", "sid": "SURVEY", "fid": 2, "candid": "e", "forced": False}, - {"aid": "AID1", "sid": "SURVEY", "fid": 2, "candid": "f", "forced": False}, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 1, + "candid": "a", + "forced": False, + }, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 1, + "candid": "b", + "forced": False, + }, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 1, + "candid": "c", + "forced": False, + }, + { + "aid": "AID2", + "sid": "SURVEY", + "fid": 1, + "candid": "d", + "forced": False, + }, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 2, + "candid": "e", + "forced": False, + }, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 2, + "candid": "f", + "forced": False, + }, ] calculator = MagnitudeStatistics(detections) result = calculator.calculate_ndet() expected = pd.DataFrame( - {"ndet": [3, 1, 2], "aid": ["AID1", "AID2", "AID1"], "sid": ["SURVEY", "SURVEY", "SURVEY"], "fid": [1, 1, 2]} + { + "ndet": [3, 1, 2], + "aid": ["AID1", "AID2", "AID1"], + "sid": ["SURVEY", "SURVEY", "SURVEY"], + "fid": [1, 1, 2], + } + ) + assert_frame_equal( + result, expected.set_index(["aid", "sid", "fid"]), check_like=True ) - assert_frame_equal(result, expected.set_index(["aid", "sid", "fid"]), check_like=True) def test_calculate_ndubious_gives_number_of_dubious_detections_per_aid_and_fid(): detections = [ - {"aid": "AID1", "sid": "SURVEY", "fid": 1, "dubious": True, "candid": "a", "forced": False}, - {"aid": "AID1", "sid": "SURVEY", "fid": 1, "dubious": True, "candid": "b", "forced": False}, - {"aid": "AID1", "sid": "SURVEY", "fid": 1, "dubious": False, "candid": "c", "forced": False}, - {"aid": "AID2", "sid": "SURVEY", "fid": 1, "dubious": False, "candid": "d", "forced": False}, - {"aid": "AID1", "sid": "SURVEY", "fid": 2, "dubious": True, "candid": "e", "forced": False}, - {"aid": "AID1", "sid": "SURVEY", "fid": 2, "dubious": False, "candid": "f", "forced": False}, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 1, + "dubious": True, + "candid": "a", + "forced": False, + }, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 1, + "dubious": True, + "candid": "b", + "forced": False, + }, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 1, + "dubious": False, + "candid": "c", + "forced": False, + }, + { + "aid": "AID2", + "sid": "SURVEY", + "fid": 1, + "dubious": False, + "candid": "d", + "forced": False, + }, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 2, + "dubious": True, + "candid": "e", + "forced": False, + }, + { + "aid": "AID1", + "sid": "SURVEY", + "fid": 2, + "dubious": False, + "candid": "f", + "forced": False, + }, ] calculator = MagnitudeStatistics(detections) result = calculator.calculate_ndubious() @@ -331,16 +763,58 @@ def test_calculate_ndubious_gives_number_of_dubious_detections_per_aid_and_fid() "fid": [1, 1, 2], } ) - assert_frame_equal(result, expected.set_index(["aid", "sid", "fid"]), check_like=True) + assert_frame_equal( + result, expected.set_index(["aid", "sid", "fid"]), check_like=True + ) def test_calculate_saturation_rate_gives_saturation_ratio_per_aid_and_fid(): detections = [ - {"aid": "AID1", "sid": "ZTF", "fid": 1, "corrected": True, "mag_corr": 0, "candid": "a", "forced": False}, - {"aid": "AID1", "sid": "ZTF", "fid": 1, "corrected": True, "mag_corr": 100, "candid": "b", "forced": False}, - {"aid": "AID1", "sid": "ZTF", "fid": 1, "corrected": True, "mag_corr": 100, "candid": "c", "forced": False}, - {"aid": "AID1", "sid": "ZTF", "fid": 1, "corrected": True, "mag_corr": 0, "candid": "c1", "forced": False}, - {"aid": "AID2", "sid": "ZTF", "fid": 2, "corrected": False, "mag_corr": np.nan, "candid": "d", "forced": False}, + { + "aid": "AID1", + "sid": "ZTF", + "fid": 1, + "corrected": True, + "mag_corr": 0, + "candid": "a", + "forced": False, + }, + { + "aid": "AID1", + "sid": "ZTF", + "fid": 1, + "corrected": True, + "mag_corr": 100, + "candid": "b", + "forced": False, + }, + { + "aid": "AID1", + "sid": "ZTF", + "fid": 1, + "corrected": True, + "mag_corr": 100, + "candid": "c", + "forced": False, + }, + { + "aid": "AID1", + "sid": "ZTF", + "fid": 1, + "corrected": True, + "mag_corr": 0, + "candid": "c1", + "forced": False, + }, + { + "aid": "AID2", + "sid": "ZTF", + "fid": 2, + "corrected": False, + "mag_corr": np.nan, + "candid": "d", + "forced": False, + }, { "aid": "AID2", "sid": "ZTF", @@ -350,7 +824,15 @@ def test_calculate_saturation_rate_gives_saturation_ratio_per_aid_and_fid(): "candid": "d1", "forced": False, }, - {"aid": "AID2", "sid": "ZTF", "fid": 3, "corrected": True, "mag_corr": 100, "candid": "d2", "forced": False}, + { + "aid": "AID2", + "sid": "ZTF", + "fid": 3, + "corrected": True, + "mag_corr": 100, + "candid": "d2", + "forced": False, + }, { "aid": "AID1", "sid": "SURVEY", @@ -390,11 +872,19 @@ def test_calculate_saturation_rate_gives_saturation_ratio_per_aid_and_fid(): "fid": [1, 2, 3, 10, 1], } ) - assert_frame_equal(result, expected.set_index(["aid", "sid", "fid"]), check_like=True) + assert_frame_equal( + result, expected.set_index(["aid", "sid", "fid"]), check_like=True + ) def test_magnitude_statistics_ignores_forced_photometry(): - detections = [{"candid": "a", "forced": False}, {"candid": "b", "forced": True}] + detections = [ + {"candid": "a", "forced": False}, + {"candid": "b", "forced": True}, + ] calculator = MagnitudeStatistics(detections) - assert_frame_equal(calculator._detections, pd.DataFrame({"forced": False}, index=pd.Index(["a"], name="candid"))) + assert_frame_equal( + calculator._detections, + pd.DataFrame({"forced": False}, index=pd.Index(["a"], name="candid")), + ) diff --git a/magstats_step/tests/unittests/test_objstats.py b/magstats_step/tests/unittests/test_objstats.py index e16ebf3fc..172f8f977 100644 --- a/magstats_step/tests/unittests/test_objstats.py +++ b/magstats_step/tests/unittests/test_objstats.py @@ -20,14 +20,16 @@ def test_degree_to_arcsec_conversion(): def test_composition_of_arcsec2dec_and_dec2arcsec_results_in_same_input(): degrees = 1 - result = ObjectStatistics._arcsec2deg(ObjectStatistics._deg2arcsec(degrees)) + result = ObjectStatistics._arcsec2deg( + ObjectStatistics._deg2arcsec(degrees) + ) assert degrees == result def test_calculate_weights_gives_inverse_square_of_errors(): sigs = pd.Series([2.0, 3.0]) result = ObjectStatistics._compute_weights(sigs) - assert (result == 1 / sigs ** 2).all() + assert (result == 1 / sigs**2).all() def test_calculate_weighted_mean_with_equal_errors_is_standard_mean(): @@ -79,7 +81,9 @@ def test_calculate_coordinates_with_ra_uses_weighted_mean_and_weighted_mean_erro calculator._weighted_mean = mock.Mock() calculator._weighted_mean.return_value = 1 # Dummy value for check - calculator._weighted_mean_error = mock.Mock() # DO NOT USE MagicMock!! Messes with some checks in pandas + calculator._weighted_mean_error = ( + mock.Mock() + ) # DO NOT USE MagicMock!! Messes with some checks in pandas calculator._weighted_mean_error.return_value = 2 # Dummy value for check result = calculator._calculate_coordinates("ra") @@ -93,7 +97,11 @@ def test_calculate_coordinates_with_ra_uses_weighted_mean_and_weighted_mean_erro if len(val) == 2: # This is AID1, the order cannot be assured assert_series_equal( val, - pd.Series([10, 20], index=pd.Index(["a", "b"], name="candid"), name="ra"), + pd.Series( + [10, 20], + index=pd.Index(["a", "b"], name="candid"), + name="ra", + ), ) assert_series_equal( err, @@ -104,10 +112,19 @@ def test_calculate_coordinates_with_ra_uses_weighted_mean_and_weighted_mean_erro ), ) else: # Should be AID2 - assert_series_equal(val, pd.Series([20], index=pd.Index(["c"], name="candid"), name="ra")) + assert_series_equal( + val, + pd.Series( + [20], index=pd.Index(["c"], name="candid"), name="ra" + ), + ) assert_series_equal( err, - pd.Series([4 / 3600], index=pd.Index(["c"], name="candid"), name="e_ra"), + pd.Series( + [4 / 3600], + index=pd.Index(["c"], name="candid"), + name="e_ra", + ), ) @@ -121,7 +138,9 @@ def test_calculate_coordinates_with_dec_uses_weighted_mean_and_weighted_mean_err calculator._weighted_mean = mock.Mock() calculator._weighted_mean.return_value = 1 # Dummy value for check - calculator._weighted_mean_error = mock.Mock() # DO NOT USE MagicMock!! Messes with some checks in pandas + calculator._weighted_mean_error = ( + mock.Mock() + ) # DO NOT USE MagicMock!! Messes with some checks in pandas calculator._weighted_mean_error.return_value = 2 # Dummy value for check result = calculator._calculate_coordinates("dec") @@ -135,7 +154,11 @@ def test_calculate_coordinates_with_dec_uses_weighted_mean_and_weighted_mean_err if len(val) == 2: # This is AID1, the order cannot be assured assert_series_equal( val, - pd.Series([10, 20], index=pd.Index(["a", "b"], name="candid"), name="dec"), + pd.Series( + [10, 20], + index=pd.Index(["a", "b"], name="candid"), + name="dec", + ), ) assert_series_equal( err, @@ -146,10 +169,19 @@ def test_calculate_coordinates_with_dec_uses_weighted_mean_and_weighted_mean_err ), ) else: # Should be AID2 - assert_series_equal(val, pd.Series([20], index=pd.Index(["c"], name="candid"), name="dec")) + assert_series_equal( + val, + pd.Series( + [20], index=pd.Index(["c"], name="candid"), name="dec" + ), + ) assert_series_equal( err, - pd.Series([4 / 3600], index=pd.Index(["c"], name="candid"), name="e_dec"), + pd.Series( + [4 / 3600], + index=pd.Index(["c"], name="candid"), + name="e_dec", + ), ) @@ -207,7 +239,9 @@ def test_calculate_ndet_gives_number_of_detections_per_aid(): assert "ndet" in result assert_series_equal( result["ndet"], - pd.Series([3, 1], index=pd.Index(["AID1", "AID2"], name="aid"), name="ndet"), + pd.Series( + [3, 1], index=pd.Index(["AID1", "AID2"], name="aid"), name="ndet" + ), ) @@ -224,7 +258,11 @@ def test_calculate_firstmjd_gives_the_first_mjd_per_aid(): assert "firstmjd" in result assert_series_equal( result["firstmjd"], - pd.Series([1, 2], index=pd.Index(["AID1", "AID2"], name="aid"), name="firstmjd"), + pd.Series( + [1, 2], + index=pd.Index(["AID1", "AID2"], name="aid"), + name="firstmjd", + ), ) @@ -241,7 +279,11 @@ def test_calculate_lastmjd_gives_the_last_mjd_per_aid(): assert "lastmjd" in result assert_series_equal( result["lastmjd"], - pd.Series([3, 2], index=pd.Index(["AID1", "AID2"], name="aid"), name="lastmjd"), + pd.Series( + [3, 2], + index=pd.Index(["AID1", "AID2"], name="aid"), + name="lastmjd", + ), ) @@ -275,8 +317,22 @@ def test_calculate_corrected_gives_whether_first_detection_in_surveys_with_corre "candid": "a", "forced": False, }, # Should ignore - {"aid": "AID1", "sid": "SURVEY", "mjd": 2, "corrected": True, "candid": "b", "forced": False}, # True for AID1 - {"aid": "AID1", "sid": "SURVEY", "mjd": 3, "corrected": False, "candid": "c", "forced": False}, + { + "aid": "AID1", + "sid": "SURVEY", + "mjd": 2, + "corrected": True, + "candid": "b", + "forced": False, + }, # True for AID1 + { + "aid": "AID1", + "sid": "SURVEY", + "mjd": 3, + "corrected": False, + "candid": "c", + "forced": False, + }, { "aid": "AID2", "sid": "MOCK_SURVEY", @@ -293,7 +349,14 @@ def test_calculate_corrected_gives_whether_first_detection_in_surveys_with_corre "candid": "e", "forced": False, }, # False for AID3 - {"aid": "AID3", "sid": "SURVEY", "mjd": 3, "corrected": True, "candid": "f", "forced": False}, + { + "aid": "AID3", + "sid": "SURVEY", + "mjd": 3, + "corrected": True, + "candid": "f", + "forced": False, + }, ] calculator = ObjectStatistics(detections) calculator._CORRECTED = ("SURVEY",) @@ -320,8 +383,22 @@ def test_calculate_stellar_gives_whether_first_detection_in_surveys_with_stellar "candid": "a", "forced": False, }, # Should ignore - {"aid": "AID1", "sid": "SURVEY", "mjd": 2, "stellar": True, "candid": "b", "forced": False}, # True for AID1 - {"aid": "AID1", "sid": "SURVEY", "mjd": 3, "stellar": False, "candid": "c", "forced": False}, + { + "aid": "AID1", + "sid": "SURVEY", + "mjd": 2, + "stellar": True, + "candid": "b", + "forced": False, + }, # True for AID1 + { + "aid": "AID1", + "sid": "SURVEY", + "mjd": 3, + "stellar": False, + "candid": "c", + "forced": False, + }, { "aid": "AID2", "sid": "MOCK_SURVEY", @@ -330,8 +407,22 @@ def test_calculate_stellar_gives_whether_first_detection_in_surveys_with_stellar "candid": "d", "forced": False, }, # Should ignore - {"aid": "AID3", "sid": "SURVEY", "mjd": 2, "stellar": False, "candid": "e", "forced": False}, # False for AID3 - {"aid": "AID3", "sid": "SURVEY", "mjd": 3, "stellar": True, "candid": "f", "forced": False}, + { + "aid": "AID3", + "sid": "SURVEY", + "mjd": 2, + "stellar": False, + "candid": "e", + "forced": False, + }, # False for AID3 + { + "aid": "AID3", + "sid": "SURVEY", + "mjd": 3, + "stellar": True, + "candid": "f", + "forced": False, + }, ] calculator = ObjectStatistics(detections) calculator._STELLAR = ("SURVEY",) @@ -340,14 +431,51 @@ def test_calculate_stellar_gives_whether_first_detection_in_surveys_with_stellar assert "stellar" in result assert_series_equal( result["stellar"], - pd.Series([True, False], index=pd.Index(["AID1", "AID3"], name="aid"), name="stellar"), + pd.Series( + [True, False], + index=pd.Index(["AID1", "AID3"], name="aid"), + name="stellar", + ), ) def test_object_statistics_ignores_forced_photometry(): - detections = [{"candid": "a", "check": "this", "forced": False}, {"candid": "b", "check": "that", "forced": True}] + detections = [ + {"candid": "a", "check": "this", "forced": False}, + {"candid": "b", "check": "that", "forced": True}, + ] calculator = ObjectStatistics(detections) assert_series_equal( - calculator._detections["check"], pd.Series(["this"], index=pd.Index(["a"], name="candid"), name="check") + calculator._detections["check"], + pd.Series( + ["this"], index=pd.Index(["a"], name="candid"), name="check" + ), + ) + + +def test_object_statistics_deltajd(): + detections = [ + { + "aid": "AID1", + "sid": "SURVEY", + "mjd": 1, + "stellar": False, + "candid": "a", + "forced": False, + }, + { + "aid": "AID1", + "sid": "SURVEY", + "mjd": 5, + "stellar": True, + "candid": "b", + "forced": False, + }, + ] + calculator = ObjectStatistics(detections) + result = calculator.calculate_deltajd() + assert_series_equal( + result["deltajd"], + pd.Series([4], index=pd.Index(["AID1"], name="aid"), name="deltajd"), ) diff --git a/magstats_step/tests/unittests/test_step.py b/magstats_step/tests/unittests/test_step.py index 7f72ce923..b7749acf9 100644 --- a/magstats_step/tests/unittests/test_step.py +++ b/magstats_step/tests/unittests/test_step.py @@ -6,6 +6,7 @@ from pprint import pprint + def test_execute_multistream(env_variables): step = step_factory() formatted_data = step.pre_execute(data) @@ -40,7 +41,10 @@ def test_scribe_message_multistream(env_variables): { "loc": { "type": "Point", - "coordinates": [to_write["meanra"] - 180, to_write["meandec"]], + "coordinates": [ + to_write["meanra"] - 180, + to_write["meandec"], + ], } } ) @@ -51,7 +55,9 @@ def test_scribe_message_multistream(env_variables): "data": to_write, "options": {"upsert": True}, } - step.scribe_producer.produce.assert_any_call({"payload": json.dumps(command)}) + step.scribe_producer.produce.assert_any_call( + {"payload": json.dumps(command)} + ) def test_execute_ztf(env_variables): @@ -60,7 +66,7 @@ def test_execute_ztf(env_variables): result = step.execute(formatted_data) result = result["ztf"] for d in data: - if (not any([det["sid"] == "ZTF" for det in d["detections"]])): + if not any([det["sid"] == "ZTF" for det in d["detections"]]): continue assert d["aid"] in result assert "meanra" in result[d["aid"]] From 6b794dbbfd290c73ad449da0274c7a1d3fecb215 Mon Sep 17 00:00:00 2001 From: Diego Rodriguez Date: Thu, 30 Nov 2023 12:06:57 -0300 Subject: [PATCH 2/2] tests(db-plugins): fix deltajd field --- libs/db-plugins/tests/unittest/db/test_helpers.py | 2 ++ .../tests/unittest/db/test_mongo_models.py | 15 ++++++++++----- .../tests/unittest/db/test_probabilities.py | 15 +++++++++------ 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/libs/db-plugins/tests/unittest/db/test_helpers.py b/libs/db-plugins/tests/unittest/db/test_helpers.py index 21291776d..87475a13f 100644 --- a/libs/db-plugins/tests/unittest/db/test_helpers.py +++ b/libs/db-plugins/tests/unittest/db/test_helpers.py @@ -41,6 +41,7 @@ def create_2_objects(self): stellar=False, lastmjd="lastmjd", firstmjd="firstmjd", + deltajd=1.0, meanra=100.0, sigmara=0.1, meandec=50.0, @@ -88,6 +89,7 @@ def create_2_objects(self): sigmadec=0.1, lastmjd="lastmjd", firstmjd="firstmjd", + deltajd=1.0, meanra=100.0, meandec=50.0, ndet=5, diff --git a/libs/db-plugins/tests/unittest/db/test_mongo_models.py b/libs/db-plugins/tests/unittest/db/test_mongo_models.py index afab8ed94..e99136a40 100644 --- a/libs/db-plugins/tests/unittest/db/test_mongo_models.py +++ b/libs/db-plugins/tests/unittest/db/test_mongo_models.py @@ -11,10 +11,11 @@ def test_object_creates(self): sid="sid", lastmjd="lastmjd", firstmjd="firstmjd", + deltajd=1, corrected=True, stellar=True, - sigmara=.1, - sigmadec=.2, + sigmara=0.1, + sigmadec=0.2, meanra=100.0, meandec=50.0, ndet="ndet", @@ -67,7 +68,9 @@ def test_detection_creates(self): self.assertEqual(d["aid"], "aid") def test_detection_fails_creation(self): - with self.assertRaisesRegex(AttributeError, "Detection model needs .+? attribute"): + with self.assertRaisesRegex( + AttributeError, "Detection model needs .+? attribute" + ): models.Detection() def test_detection_with_extra_fields(self): @@ -152,7 +155,7 @@ def test_forced_photometry_creates(self): parent_candid="parent_candid", has_stamp="has_stamp", rbversion="rbversion", - extra_fields={}, + extra_fields={}, ) self.assertIsInstance(fp, models.ForcedPhotometry) self.assertIsInstance(fp, dict) @@ -174,7 +177,9 @@ def test_non_detection_creates(self): self.assertEqual(o["aid"], "aid") def test_non_detection_fails_creation(self): - with self.assertRaisesRegex(AttributeError, "NonDetection model needs .+ attribute"): + with self.assertRaisesRegex( + AttributeError, "NonDetection model needs .+ attribute" + ): models.NonDetection() # self.assertEqual(str(e.exception), "NonDetection model needs aid attribute") diff --git a/libs/db-plugins/tests/unittest/db/test_probabilities.py b/libs/db-plugins/tests/unittest/db/test_probabilities.py index 8a3c90e02..60308a80e 100644 --- a/libs/db-plugins/tests/unittest/db/test_probabilities.py +++ b/libs/db-plugins/tests/unittest/db/test_probabilities.py @@ -23,10 +23,11 @@ def create_2_objects(self): sid="sid", corrected=True, stellar=True, - sigmara=.1, - sigmadec=.1, + sigmara=0.1, + sigmadec=0.1, lastmjd="lastmjd", firstmjd="firstmjd", + deltajd=1, meanra=100.0, meandec=50.0, ndet=2, @@ -54,10 +55,11 @@ def create_2_objects(self): tid="tid2", corrected=True, stellar=True, - sigmara=.1, - sigmadec=.1, + sigmara=0.1, + sigmadec=0.1, lastmjd="lastmjd", firstmjd="firstmjd", + deltajd=1, meanra=100.0, meandec=50.0, ndet=5, @@ -88,10 +90,11 @@ def create_simple_object(self): tid="tid3", corrected=True, stellar=True, - sigmara=.1, - sigmadec=.1, + sigmara=0.1, + sigmadec=0.1, lastmjd="lastmjd", firstmjd="firstmjd", + deltajd=1, meanra=100.0, meandec=50.0, ndet=5,