Skip to content

Commit

Permalink
soiling.py change to pass notebook checks
Browse files Browse the repository at this point in the history
  • Loading branch information
nmoyer committed Aug 13, 2024
1 parent 6d5ce23 commit b99c2de
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions rdtools/soiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ def _calc_result_df(
####################################################
# the following is moved here so median values are retained/Matt
# for soiling inferrences when rejected fits occur

result_dict["slope_err"] = (
result_dict["run_slope_high"] - result_dict["run_slope_low"]
) / abs(result_dict["run_slope"])
Expand All @@ -416,7 +417,7 @@ def _calc_result_df(
result_dict["run_loss_baseline"] = (
result_dict["inferred_start_loss"] - result_dict["inferred_end_loss"]
)

###############################################

result_list.append(result_dict)
Expand Down Expand Up @@ -470,6 +471,7 @@ def _calc_result_df(
results.loc[filt, "run_slope"] = 0
results.loc[filt, "run_slope_low"] = 0
results.loc[filt, "run_slope_high"] = 0
results.loc[filt, "valid"] = False

# Calculate the next inferred start loss from next valid interval
results["next_inferred_start_loss"] = np.clip(
Expand Down Expand Up @@ -499,8 +501,8 @@ def _calc_result_df(
results.inferred_begin_shift, 0, 1
)
#######################################################################
if neg_shift is False:
results.loc[filt, "valid"] = False
#if neg_shift is False:
# results.loc[filt, "valid"] = False

if len(results[results.valid]) == 0:
raise NoValidIntervalError("No valid soiling intervals were found")
Expand Down

0 comments on commit b99c2de

Please sign in to comment.