Describe the bug
While trying to use VS Code python debugger on a scenario which uses parseAndLoadXML() from radiationPressure.py, it stops with a valueError :
ValueError: cannot resize an array that references or is referenced by another array in this way. Use the resize function
So was unable to debug the scenario.
To reproduce
Steps to reproduce the behavior:
This should occur with any scenario which directly or indirectly calls parseAndLoadXML().
As an example : In basilisk/src/simulation/dynamics/RadiationPressure/_UnitTest/test_radiationPressure.py
- Change
unitRadiationPressure(False, "cannonball", False) to unitRadiationPressure(False, "lookup", False) in __main__
- Set up a breakpoint in vscode just after
handler.parseAndLoadXML(os.path.dirname(__file__) + "/cube_lookup.xml")
- Choose Debug python file in VS Code
- See error
Expected behavior
Ability to debug files which use parseAndLoadXML()
Screenshots
If applicable, add screenshots/plots to help explain your problem.

Desktop (please complete the following information):
- OS: Ubuntu
- Version 22.04
- Python version 3.10
Additional context
Fix :
Adding refcheck=False to these resize calls in basilisk/src/simulation/dynamics/RadiationPressure/parseSRPLookup.py fixed the issue :
self.sHatBLookup.resize([len(list(sHatBTree)), 3], refcheck=False)
self.forceBLookup.resize([len(list(forceBTree)), 3], refcheck=False)
self.torqueBLookup.resize([len(list(torqueBTree)), 3], refcheck=False)
I can open a PR if others are able to reproduce.
Similar :
microsoft/ptvsd#465 (comment)
AUTOMATIC1111/stable-diffusion-webui#6506
Describe the bug
While trying to use VS Code python debugger on a scenario which uses parseAndLoadXML() from radiationPressure.py, it stops with a valueError :
ValueError: cannot resize an array that references or is referenced by another array in this way. Use the resize functionSo was unable to debug the scenario.
To reproduce
Steps to reproduce the behavior:
This should occur with any scenario which directly or indirectly calls parseAndLoadXML().
As an example : In
basilisk/src/simulation/dynamics/RadiationPressure/_UnitTest/test_radiationPressure.pyunitRadiationPressure(False, "cannonball", False)tounitRadiationPressure(False, "lookup", False)in__main__handler.parseAndLoadXML(os.path.dirname(__file__) + "/cube_lookup.xml")Expected behavior
Ability to debug files which use
parseAndLoadXML()Screenshots

If applicable, add screenshots/plots to help explain your problem.
Desktop (please complete the following information):
Additional context
Fix :
Adding
refcheck=Falseto these resize calls inbasilisk/src/simulation/dynamics/RadiationPressure/parseSRPLookup.pyfixed the issue :I can open a PR if others are able to reproduce.
Similar :
microsoft/ptvsd#465 (comment)
AUTOMATIC1111/stable-diffusion-webui#6506