dsavransky / EXOSIMS

Simulator for exoplanet direct imaging space missions
BSD 3-Clause "New" or "Revised" License
25 stars 35 forks source link

Small bug in dynamic completeness calculation #372

Open turmon opened 3 months ago

turmon commented 3 months ago

Describe the bug "not pInds.any()" is used where "len(pInds) == 0" is intended, in L310 of BrownCompleteness.py:gen_update()

To Reproduce

In [27]: pInds=np.array([0])
In [28]: pInds.any()
Out[28]: False

In [29]: pInds=np.array([])
In [30]: pInds.any()
Out[30]: False

Expected behavior The intent of the code is to break the loop if pInds is [], but [0] will also exit the loop.

JSON script: If applicable, add the script you are using.

EXOSIMS version: 3.2.0

Additional context

                for num in range(5):
                    if num == 0:
                        self.updates[sInd, num] = TL.int_comp[sInd]
                    if not pInds.any():   #### <---
                        break