Closed GarethTMorgan closed 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.
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?
KeyError: 'Grid'
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'
Which version of turboPy are you using? The most recent commit on the repo? Or one of the releases?
Probably most recent release. The turbopy version from the .yml
Ok, that makes sense. I think the last release might have been from before we added the "gridless" capability.
Solves #21 by adding a default grid value to run.py for easy setup and a succinct first-run experience.