Replies: 10 comments 5 replies
-
Yes I think this would be a useful addition. Some percentage of users will be happy enough just to view the static Jupyter notebook rendering on Github but some may well want to run it themselves to tweak some of the options etc. but without the hassle of installing and doing all that locally. I last used Google Colab a number of years ago, so I'm a bit rusty. Wouldn't we (JSBSim organization) need to provide a Google Drive for the repo to be checked out to etc. unless the user already had their own Google Colab setup? |
Beta Was this translation helpful? Give feedback.
-
Okay, when I used your link earlier and ran the cell with the magic to perform the git clone, pip install etc. I wasn't sure if the storage space for them was being provided via your Google Drive. Is there a conditional magic command? If we add the following as the first cell of every Jupyter notebook, then someone who downloads the Jupyter notebook, directly or via a git clone of the JSBSim repo to their own PC will end up with another JSBSim repo installation.
|
Beta Was this translation helpful? Give feedback.
-
The FYI - What is the difference between ! and % in Jupyter notebooks?
I agree. It's just a question of the best option in terms of supporting both Google Colab and users wanting to use the Jupyter notebooks locally. There are some downsides to having to maintain 2 virtually identical copies each time of new notebook is added or a notebook is edited. That's why I was wondering whether there is some conditional logic we can add to this initial cell to handle both cases. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Here is an option to avoid the issue with running the cell multiple times. try:
import jsbsim
except ImportError:
import sys
if 'google.colab' in sys.modules:
!git clone https://github.com/JSBSim-Team/jsbsim.git
!pip install jsbsim
%cd jsbsim/examples/python
%pwd |
Beta Was this translation helpful? Give feedback.
-
Here is my, hopefully last, suggestion: # Confirm that JSBSim is installed. If not and running on Google Colab
# then install JSBSim into the Google Colab instance.
try:
import jsbsim
print('JSBSim is installed')
except ImportError:
import sys
if 'google.colab' in sys.modules:
print('Installing JSBSim...')
!git clone https://github.com/JSBSim-Team/jsbsim.git
!pip install jsbsim
%cd jsbsim/examples/python
print('Current working directory:')
!pwd In terms of adding the changes to support Google Colab etc. are you interested and willing to submit a Github PR (Pull Request) or do you want one of the JSBSim maintainers to create the PR? |
Beta Was this translation helpful? Give feedback.
-
No problem, we encourage new users to contribute.
No rush. Yes, please read the contribution document, and if there isn't something that is clear enough then ask here and I can update the contribution document if need be.
I'd suggest adding it as it's own separate cell block, rather than adding it to the contents of the existing first cell block.
For this Google Colab link in the introduction, rather than linking to one specific notebook to open in Colab, rather use the generic Colab icon/image but make it a link to the Python module examples header, i.e. so if the click on the Google Colab link image they'll jump down to this section and then see 4 current examples each with a "Open in Colab" link at the end of each description. Rest of the suggestions look good to me. |
Beta Was this translation helpful? Give feedback.
-
This suggestion was adopted in #1309 Thank you for your support, @seanmcleod70. |
Beta Was this translation helpful? Give feedback.
-
Thank you for quicly adding this feature. Here's a post I made on my LinkedIn wall. Lowering the entry lever for new JSBSim users continues... |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello.
I just find this great project and I wonder if people who find this project for the first time could more easily try these example programs.
The README file provides a great quick start guide, but beginners need to type in a few commands to download, move folders, and run files.
How about adding a Google Colab link like below to the ReadMe file?
As you may know, but in case you don't, google colab is a hosted Jupyter Notebook service that requires no setup to use and provides free of charge access to computing resources, including GPUs and TPUs.
Simply click the Run buttons and we can download and run the example file independently of our environment.
Now this icon link to the my personal google drives file based on examples/python, but you can change this to this github repository's file.
I would appreciate it if you could share your thoughts.
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions