From 31caf417b072f0a6de47fd7e8cab8039a3191e92 Mon Sep 17 00:00:00 2001 From: Steven Rieder Date: Tue, 26 Nov 2024 13:57:53 +0100 Subject: [PATCH] fix to set intended behaviour --- src/amuse/ic/molecular_cloud.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/amuse/ic/molecular_cloud.py b/src/amuse/ic/molecular_cloud.py index b1733bb2d7..f88dd68018 100644 --- a/src/amuse/ic/molecular_cloud.py +++ b/src/amuse/ic/molecular_cloud.py @@ -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,