Skip to content

Commit

Permalink
Merge pull request #138 from szhan/first_value_recomb_prob
Browse files Browse the repository at this point in the history
Remove requiring the first value of input recombination probability array be zero
  • Loading branch information
szhan authored Jun 24, 2024
2 parents a5c1bec + f9c3bd2 commit 4f9e966
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lshmm/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,9 @@ def check_inputs(
if isinstance(prob_recombination, (int, float)):
prob_recombination = np.zeros(num_sites, dtype=np.float64) + prob_recombination
prob_recombination[0] = 0.0
elif (
isinstance(prob_recombination, np.ndarray)
and len(prob_recombination) == num_sites
):
if prob_recombination[0] != 0:
err_msg = "First value in the recombination probability array must be zero."
elif isinstance(prob_recombination, np.ndarray):
if len(prob_recombination) != num_sites:
err_msg = "Recombination probability is an array of unexpected length."
raise ValueError(err_msg)
else:
err_msg = (
Expand Down

0 comments on commit 4f9e966

Please sign in to comment.