suny-downstate-medical-center / netpyne

A Python package to facilitate the development, parallel simulation, optimization and analysis of multiscale biological neuronal networks in NEURON.
http://www.netpyne.org
MIT License
142 stars 134 forks source link

OS.mkdir to OS.makedirs and OSError handeling #823

Closed Jsprouse0 closed 1 month ago

Jsprouse0 commented 1 month ago

Changed the os.mkdir file creations in netpyne (batch, specs, and sim) to os.makedirs to create any missing directories for the designated target file creation. Also fixed the OSError handling to point towards file error and exit simulation to ensure system exit handling.

jchen6727 commented 1 month ago

Hey @Jsprouse0, while reviewing your PR, I'd suggest the following code changes:

👉 Code Suggestion for #823

https://github.com/suny-downstate-medical-center/netpyne/pull/823

instead of using an external check for path existence (either before function call or during exception handling), calling os.makedirs() with exist_ok seems like a simpler solution.

You can also review and apply these suggestions locally on your machine.

Learn more about GitKraken Code Suggest >[Code Suggest](https://gitkraken.dev/redirect/aHR0cHM6Ly93d3cuZ2l0a3Jha2VuLmNvbS9zb2x1dGlvbnMvY29kZS1zdWdnZXN0P3NvdXJjZT1naXRodWIuY29tJm1lZGl1bT1wcl9jb21tZW50?source=PRSuggest&event=redirectToCodeSuggestPage&provider=github) liberates your code reviews from GitHub's restrictive, comment-only feedback style. As simple as suggesting changes in a Google-doc, provide real code suggestions from where you code, e.g. your IDE, and on anything in your project — not just on the lines of code changed in the PR. _Join your team on [GitKraken](https://gitkraken.dev/redirect/aHR0cHM6Ly93d3cuZ2l0a3Jha2VuLmNvbT9zb3VyY2U9Z2l0aHViLmNvbSZtZWRpdW09cHJfY29tbWVudA==?source=PRSuggest&event=redirectToIndexPage&provider=github) to speed up PR review._