For this code :
for crop in database:
print("The current crop is :", crop)
x.all_crop_parameters_match_the_PRA_ones = True
while x.all_crop_parameters_match_the_PRA_ones :
ASSESS_Tmin( crop, x, PRA)
print("x.all_crop_parameters_match_the_PRA_ones = ", x.all_crop_parameters_match_the_PRA_ones)
ASSESS_Water( crop, PRA, x)
print("x.all_crop_parameters_match_the_PRA_ones = ", x.all_crop_parameters_match_the_PRA_ones)
ASSESS_pH(crop, PRA, x)
I get the following results:
The current crop is : FBRflx
Checking minimum Temperatures...
x.all_crop_parameters_match_the_PRA_ones = False
Checking the Water Resources...
Verifying if the Water Resources match with the Tmin supported by the crop...
x.all_crop_parameters_match_the_PRA_ones = False
The soil pH of this PRA matches to the crop requirements.
This crop is edible for the current PRA !
I don't understand why the programm see that x.all_crop_parameters_match_the_PRA_ones is False and still runs the next functions instead of breaking the loop and switching to the next crop.
x is a class that contains all the variables I use and modify is several functions of my code. Could it be an error because the boolean comes from a class ?