Skip to content

Commit

Permalink
chore: black formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
dirodriguezm committed Jan 17, 2024
1 parent 25831e3 commit c672564
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion magstats_step/magstats_step/core/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self, detections: List[dict]):
except KeyError: # extra_fields is not present
self._detections = pd.DataFrame.from_records(detections)
self._detections = self._detections.drop_duplicates(
["candid", "oid"]
["candid", "oid"]
).set_index("candid")
# Select only non-forced detections
self._detections = self._detections[~self._detections["forced"]]
Expand Down
8 changes: 6 additions & 2 deletions magstats_step/magstats_step/step.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ def _execute(self, messages: dict):
magstats = magstats.set_index("oid").replace({np.nan: None})
for oid in stats:
try:
stats[oid]["magstats"] = magstats.loc[oid].iloc[0].to_dict("records")
stats[oid]["magstats"] = (
magstats.loc[oid].iloc[0].to_dict("records")
)
except TypeError:
stats[oid]["magstats"] = [magstats.loc[oid].iloc[0].to_dict()]

Expand Down Expand Up @@ -66,7 +68,9 @@ def _execute_ztf(self, messages: dict):
magstats = magstats.set_index("oid").replace({np.nan: None})
for oid in stats:
try:
stats[oid]["magstats"] = magstats.loc[oid].iloc[0].to_dict("records")
stats[oid]["magstats"] = (
magstats.loc[oid].iloc[0].to_dict("records")
)
# el primero o uno por par oid_candid?
except TypeError:
stats[oid]["magstats"] = [magstats.loc[oid].iloc[0].to_dict()]
Expand Down

0 comments on commit c672564

Please sign in to comment.