Skip to content

Commit

Permalink
get_predict_fstat_parameters_from_dict(): deal with both naming conve…
Browse files Browse the repository at this point in the history
…ntions for transient params

 - allow passing dicts following either the lalpulsar or PyFstat convention
   and always return in lalpulsar convention
  • Loading branch information
dbkeitel committed Jul 2, 2024
1 parent 9a395e6 commit c8f638b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pyfstat/utils/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,11 @@ def get_predict_fstat_parameters_from_dict(signal_parameters, transientWindowTyp
"transient_duration": "transientTau",
}
predict_fstat_params = {key: signal_parameters[key] for key in required_keys}
for key in transient_keys:
for key, val in transient_keys.items():
if key in signal_parameters:
predict_fstat_params[transient_keys[key]] = signal_parameters[key]
predict_fstat_params[val] = signal_parameters[key]
elif val in signal_parameters:
predict_fstat_params[val] = signal_parameters[val]

Check warning on line 184 in pyfstat/utils/predict.py

View check run for this annotation

Codecov / codecov/patch

pyfstat/utils/predict.py#L184

Added line #L184 was not covered by tests
if transientWindowType is not None:
predict_fstat_params["transientWindowType"] = transientWindowType
return predict_fstat_params

0 comments on commit c8f638b

Please sign in to comment.