Skip to content

Commit

Permalink
fix to set intended behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
rieder committed Nov 26, 2024
1 parent b8bc482 commit 31caf41
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/amuse/ic/molecular_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,18 @@ def new_molecular_cloud(
"targetN is deprecated, use target_number_of_stars instead",
category=FutureWarning,
)
if target_number_of_stars != targetN:
if target_number_of_stars is not None and target_number_of_stars != targetN:
raise ValueError(
"targetN and target_number_of_stars have different values, "
"this is only allowed if targetN is None and target_number_of_stars "
"is not None"
"this is only allowed if one of them is None"
)
targetN = target_number_of_stars
target_number_of_stars = targetN
if target_number_of_stars is None:
raise ValueError("target_number_of_stars must be set")
return molecular_cloud(
nf=nf,
power=power,
targetN=targetN,
targetN=target_number_of_stars,
ethep_ratio=ethep_ratio,
convert_nbody=convert_nbody,
ekep_ratio=ekep_ratio,
Expand Down

0 comments on commit 31caf41

Please sign in to comment.