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

Generate tutorial based on this example? #5

Closed arichar6 closed 4 years ago

arichar6 commented 4 years ago

What do you think about creating a "turboPy app tutorial" based on this simple app? It could be a fairly straightforward project, which I think could be completed in a reasonable amount of time. As our PM and intern-admin, I'd like to get your thoughts on this.

@GarethTMorgan @carolinegsun

arichar6 commented 4 years ago

Maybe we can add a jupyter notebook that shows how to run the example, and then plot the outputs?

GarethTMorgan commented 4 years ago

I think that sounds like a great idea, sorry for not responding last week I don't visit this repo very often haha. I've never used jupyter notebooks, but I'd be willing to try to learn the basics of it for this.

arichar6 commented 4 years ago

Since pip install turbopy now works, this repo can now connect to mybinder. Try this out, then enter import turbopy in the notebook that opens up:

https://mybinder.org/v2/gh/NRL-Plasma-Physics-Division/block-on-spring/main?filepath=docs%2Fnotebooks%2Ftest.ipynb

@padamson you might get a kick out of this

padamson commented 4 years ago

Very cool and good to know. Thanks!

AOstenfeld commented 4 years ago

I've spent some time learning the basics of the Jupyter notebook and I'd be interested in working on this, but I'm not really sure where to start. Should the "tutorial" more or less be an explaination of how to set up and run the block on spring app?

padamson commented 4 years ago

I would look at the PlasmaPy examples for inspiration on what makes a good example notebook for this type of repo.

AOstenfeld commented 4 years ago

How do you add a Jupyter notebook to github? If I try to add a file with the ipynb extension nothing appears.

arichar6 commented 4 years ago

Check that your .gitignore isn't preventing you from adding files with extension .ipynb.

AOstenfeld commented 4 years ago

The block_on_spring .gitignore doesn't seem to ignore .ipynb files, and there's already a test.ipynb file on the repo. However, if I try to create a new file with the .ipynb extension, a notebook doesn't appear. it loads for a few seconds and then says that something went wrong.

arichar6 commented 4 years ago

What "loads for a few seconds"? And what is the error message? Can you describe the steps you tried?

AOstenfeld commented 4 years ago

Sorry i've been so vague. I clicked add file in github and named the file tutorial.ipynb. When I click on the file to edit it, it just says "something went wrong"

arichar6 commented 4 years ago

That's probably because a jupyter notebook has a specific format that it uses (structured plain text). It was probably trying to parse the notebook format, but couldn't because it was just a blank file.

You should create the notebook on your local machine first. That way you can also get it tested and working before creating a PR to add it to the repo.

arichar6 commented 4 years ago

Thanks @AOstenfeld for your work on this notebook!