NRL-Plasma-Physics-Division / block-on-spring

TurboPy app to compute the motion of a block on a spring
0 stars 5 forks source link

Dev default grid #22

Closed GarethTMorgan closed 3 years ago

GarethTMorgan commented 3 years ago

Solves #21 by adding a default grid value to run.py for easy setup and a succinct first-run experience.

GarethTMorgan commented 3 years ago

@arichar6 what are your thoughts on this change? I think having a default grid value is helpful, but if you had a reason for keeping it blank then let me know and you an deny this pr.

arichar6 commented 3 years ago

I'm a bit surprised that this won't run without the grid specified. I was trying to do a "gridless" simulation, as in the test here. So, you are saying that this won't run without specifying a grid? What error do you get?

GarethTMorgan commented 3 years ago

KeyError: 'Grid'

GarethTMorgan commented 3 years ago

Or more specifically, when I run it the terminal output looks like this:

$ C:/Users/gtmor/miniconda3/envs/turbopy-block-on-spring-app/python.exe c:/Users/gtmor/projects/block-on-spring/run.py Simulation is initializing Reading Grid... Traceback (most recent call last): File "c:/Users/gtmor/projects/block-on-spring/run.py", line 33, in
sim.run() File "C:\Users\gtmor\miniconda3\envs\turbopy-block-on-spring-app\lib\site-packages\turbopy\core.py", line 142, in run self.prepare_simulation() File "C:\Users\gtmor\miniconda3\envs\turbopy-block-on-spring-app\lib\site-packages\turbopy\core.py", line 173, in prepare_simulation self.read_grid_from_input() File "C:\Users\gtmor\miniconda3\envs\turbopy-block-on-spring-app\lib\site-packages\turbopy\core.py", line 213, in read_grid_from_input self.grid = Grid(self.input_data["Grid"]) KeyError: 'Grid'

arichar6 commented 3 years ago

Which version of turboPy are you using? The most recent commit on the repo? Or one of the releases?

GarethTMorgan commented 3 years ago

Probably most recent release. The turbopy version from the .yml

arichar6 commented 3 years ago

Ok, that makes sense. I think the last release might have been from before we added the "gridless" capability.