Describe the bug
The prototype TargetList can filter stars within a specs-supplied popStars property.
This is implemented around line 415 of Prototypes/TargetList.py.
Alas, the implementation fails for popStars lists of length > 1. This is because the tmp variable is shrinking in length, but the self.Name variable used to index tmp is not shrinking. The second time through, the loop will fail.
Stack trace:
2347 targets imported from star catalog.
Traceback (most recent call last):
File "/proj/exep/rhonda/Sandbox/HabEx/Local/ipcluster_ensemble_jpl_driver.py", line 412, in <module>
message = main(args, xspecs)
File "/proj/exep/rhonda/Sandbox/HabEx/Local/ipcluster_ensemble_jpl_driver.py", line 304, in main
sim = EXOSIMS.MissionSim.MissionSim(args.scriptfile, **xspecs)
File "/proj/exep/rhonda/Sandbox/HabEx/EXOSIMS/EXOSIMS/MissionSim.py", line 147, in __init__
self.SurveySimulation = get_module(specs['modules']['SurveySimulation'],
File "/proj/exep/rhonda/Sandbox/HabEx/EXOSIMS/EXOSIMS/SurveySimulation/coroOnlyScheduler.py", line 55, in __init__
SurveySimulation.__init__(self, **specs)
File "/proj/exep/rhonda/Sandbox/HabEx/EXOSIMS/EXOSIMS/Prototypes/SurveySimulation.py", line 175, in __init__
self.SimulatedUniverse = get_module(specs['modules']['SimulatedUniverse'],
File "/proj/exep/rhonda/Sandbox/HabEx/EXOSIMS/EXOSIMS/SimulatedUniverse/DulzPlavchanUniverseEarthsOnly.py", line 12, in __init__
SimulatedUniverse.__init__(self, **specs)
File "/proj/exep/rhonda/Sandbox/HabEx/EXOSIMS/EXOSIMS/Prototypes/SimulatedUniverse.py", line 141, in __init__
self.TargetList = get_module(specs['modules']['TargetList'],
File "/proj/exep/rhonda/Sandbox/HabEx/EXOSIMS/EXOSIMS/Prototypes/TargetList.py", line 186, in __init__
self.populate_target_list(**specs)
File "/proj/exep/rhonda/Sandbox/HabEx/EXOSIMS/EXOSIMS/Prototypes/TargetList.py", line 268, in populate_target_list
tmp = tmp[self.Name != n ]
IndexError: boolean index did not match indexed array along dimension 0; dimension is 2346 but corresponding boolean dimension is 2347
Describe the bug The prototype TargetList can filter stars within a specs-supplied popStars property. This is implemented around line 415 of Prototypes/TargetList.py. Alas, the implementation fails for popStars lists of length > 1. This is because the tmp variable is shrinking in length, but the self.Name variable used to index tmp is not shrinking. The second time through, the loop will fail.
Stack trace:
Drop into debugger:
To Reproduce Steps to reproduce the behavior: Any popStars of length > 1 should tickle this bug.
Suggested fix The following fix works, and is simpler --
JSON script: As noted, anything with 2 or more popStars
EXOSIMS version: This is a longstanding issue that has not been triggered because all of our popStars instances have been either [] or singletons.