10. Software Management: Exercise#
Name:
GitHub#
Let us try collaborative software development by OIST GitHub oist
For account setup, see https://groups.oist.jp/it/github-oist
Create your GitHub account if you haven’t
Submit the request form: https://oist.service-now.com/sp?id=sc_cat_item&sys_id=2899d8dcdbad2f40d7c7e5951b961985&sysparm_category=332e888edb47df004a187b088c9619be
Our course repository is oist/ComputationalMethods2022
SSH key#
For using a private repository, you need to setup a SSH key for secure connection.
If you have not set up a SSH key on your computer, make a new one by
mkdir ~/.ssh
cd ~/.ssh
ssh-keygen -t rsa
You shuld set a passphrase, which you will be asked when using the key.
On GitHub, from your account menu on the top right corner, select Settings and then SSH and CPG keys on the left side bar.
Press New SSH Key, paste the content of .ssh/rsa.pub
, and press Add SSH.
You may also need to press Configure SSO to link it with your OIST login.
If SSH doesn’t work, an alternative way is to use https after generating a personal access token from Settings/Developer settings.
Cloning a repository#
If you just use a copy of a stable software, and not going to contribute your changes, just downloading a zip file is fine.
But if you would congribute to joint development, or catch up with updates, git clone
is the better way.
Cloning ComputationalMethods repository#
To download a copy of the repository, run
git clone git@github.com:oist/ComputationalMethods2022.git
You are asked to input the passphrase you set in creating your SSH Key.
This should create a folder ComputationalMethods2022
.
%pwd
'/Users/doya/OIST Dropbox/kenji doya/Python/iSciComp'
!git clone git@github.com:oist/ComputationalMethods2022.git
fatal: destination path 'ComputationalMethods2022' already exists and is not an empty directory.
%ls
01_Introduction.ipynb 09_Stochastic.ipynb
01_Introduction_Ex.ipynb 09_Stochastic_Ex.ipynb
01_Introduction_Sol.ipynb 09_Stochastic_Sol.ipynb
02_Visualization.ipynb 10_Management.ipynb
02_Visualization_3D.ipynb 10_Management_Ex.ipynb
02_Visualization_Animation.ipynb ComputationalMethods2022/
02_Visualization_Ex.ipynb LICENSE
02_Visualization_Sol.ipynb README.md
03_Matrix.ipynb References.ipynb
03_Matrix_Ex.ipynb SC_logo.png
03_Matrix_Exx.ipynb Solutions.ipynb
03_Matrix_Sol.ipynb VdP.pdf
04_Function.ipynb __pycache__/
04_Function_Ex.ipynb _build/
04_Function_Sol.ipynb _config.yml
05_Iteration.ipynb _toc.yml
05_Iteration_Ex.ipynb cell.py
05_Iteration_Sol.ipynb data/
06_ODE.ipynb figures/
06_ODE_Ex.ipynb hello.py
06_ODE_Sol.ipynb iSciComp.bib
07_PDE.ipynb iSciComp.ipynb
07_PDE_Ex.ipynb index.html
07_PDE_Sol.ipynb lpnorm.py
08_Optimization.ipynb odesim/
08_Optimization_Ex.ipynb pend.gif
08_Optimization_Sol.ipynb
Move into the folder and test odesim.py
program.
%cd ComputationalMethods2022
/Users/doya/OIST Dropbox/kenji doya/Python/iSciComp/ComputationalMethods2022
%ls
README.md lorenz.py pendulum.py tatsuo.py
__pycache__/ odesim.py second.py test.py
first.py outputs/ simple_growth.py
From the console you can run interactively after reading the module as:
python -i odesim.py
sim = odesim('first')
sim.run()
from odesim import *
sim = odesim('first')
Importing ODE: first
sim.run()
t= 10.0 ; state= [0.36787947]
Your branch#
Now make your own branch, check it out, and add your own ODE module.
!git branch myname
!git checkout myname
fatal: A branch named 'myname' already exists.
Already on 'myname'
Make a copy of a dynamics file first.py
or second.py
, implement your own ODE, and save with a new name, e.g. vdp.py
.
Run odesim and confirm that your ODE runs appropriately.
Then you can add and commit your change.
!git status
On branch myname
nothing to commit, working tree clean
!git add vdp.py
fatal: pathspec 'vdp.py' did not match any files
!git commit -m "adding my model vdp.py"
On branch myname
nothing to commit, working tree clean
!git log --graph --oneline --all
* c7c6fe1 (HEAD -> myname, origin/myname, origin/main, origin/HEAD, main) Merge pull request #5 from oist/Sougato
|\
| * 3784ba9 (origin/Sougato) Adding pendulum.py after fixing errors
| * 5d6b385 Adding a pendulum ODE module
* | cdce9fb Merge pull request #4 from oist/Amy
|\ \
| * | 79900ea (origin/Amy) changed into a cubic nonlinearity
| * | 4c16aca edited test.py
| * | 831f82f adding my model test.py
| * | 0ef7d6a adding my model test.py
* | | 86c34e3 Merge pull request #6 from oist/lily
|\ \ \
| * | | dc9432c (origin/lily) Create simple_growth.py
|/ / /
* | | 84f49b7 Merge pull request #2 from oist/rui_fukushima
|\ \ \
| * | | e6b32f9 (origin/rui_fukushima) fix parameter part according prof. comments
| * | | f73f9c2 remove vdp module
| * | | 56110fe remove project notebook
| * | | 7b64069 add lorenz module
| * | | 0e84f70 adding personal project notebook
| * | | 28d072a adding my model vdp.py
| | |/
| |/|
* | | d546ed1 Merge pull request #3 from oist/tatsuo
|\ \ \
| |_|/
|/| |
| * | 919412b (origin/tatsuo) adding my model tatsuo.py
| * | 7109914 adding my model ti.py
| * | ad683ef adding my model tatsuo.py
| |/
| | * c6538a0 (origin/fhn) added pplot method to odesim.py
| | * 0fb56f7 fhn.py module and run_fhn.py for testing it in scripts folder
| | * 37e5425 (origin/kazuma-class2022AY1) Feat: add henonmap and cleanup fhn model
| | * 409d7b5 Feat: add FHN model in odesim.py
| | * d510ba8 Fix: move all images to outputs dir
| | * ed3afff Merge branch 'main' into kazuma-class2022AY1
| | |\
| |_|/
|/| |
* | | 576a0aa added outputs folder
|/ /
| * 16b8943 Feat: add phase plot and bifuraction diagram
| * 4ef681d Feat: add simple fhn plot
| * 5d2b871 Feat: add FHN model script
| * 64e1fbc Feat: add cell executer comment
| * a93c0e4 Feat: create a new script
|/
| * 2ffd690 (origin/kenji) adding my model vdp.py
|/
* 19a1a40 (origin/initial) added .gitignore
* eab5bf5 initial form
* 96d27bf (origin/clean) Delete old folders
* 680c44b Delete old folders
* d9e432e Delete old folders
* a630596 Created for 2022
* 1dc906b first three dynamics functions
* ef02eb6 original dynamics viewer
* 9251e5d Cleanup
* 4ed4c6e Create Readme.md
* d505312 Update README.md
* 205f2b2 Cleanup
* bfb02e6 Cleanup
* f9de384 Cleanup
* c00ceb6 Cleanup
* ccf6534 Cleanup
* 7aa7977 Delete Masato-first.py
* f20fa86 Merge pull request #50 from oist/Masato
|\
| * 89fedbd Update Masato-first.py
| * e5d01a5 Add files via upload
|/
* e86fea4 Merge pull request #38 from oist/deleting-the-files
|\
| * 8c71105 Delete jan-second.py
| * 00bb569 Delete jan-first.py
|/
* 84971c4 Merge pull request #35 from oist/jan-grasic
|\
| * f1d48db Add files via upload
|/
* 12c9d16 Dynamics viewer
* 8470b8e Delete DynaView.py
* b32f02a sample dynamics files
* eae595e Uploaded the same code as 2018
* 523a383 Create Readme.md
* 5b429b5 Update Readme.md
* f887d7f Create Readme.md
* fbf5185 Merge pull request #32 from oist/hoching
|\
| * 5f628fb changed the dynamic function
|/
* 56e6fc2 Merge pull request #28 from oist/Darshini
|\
| * 51bc33d Add files via upload
* | 602fddf Merge pull request #27 from oist/aisulu_maipas
|\ \
| * | 65845a7 Add files via upload
| * | c3c4e9d adding my script
* | | 096fe7b Merge pull request #31 from oist/AnzhelikaKoldaeva
|\ \ \
| * | | 3750870 added new functions to ODE solver
|/ / /
* | | f2455b3 Merge pull request #25 from oist/Angela-Kirykowicz
|\ \ \
| |/ /
|/| |
| * | fd56c93 Add files via upload
| |/
* | d6fe3f4 Merge pull request #26 from oist/lazzat
|\ \
| |/
|/|
| * 08c9647 adding my script
* | 7f5ef37 Delete Lewis_wavy.py due to incorrect location
|/
* 478e839 Example
* eaf500d Update lewis_wavy.py
* c91b30a Add files via upload
* c0188d2 Update lewis_wavy.py
* a609a28 Merge pull request #24 from oist/module-scan
|\
| * a1ac524 Merge branch 'master' into module-scan
| |\
| |/
|/|
* | 00b93e4 Update DynaView.py
* | 628b8c5 Add files via upload
| * 6aa4601 parameters format changed
| * c18d6e0 Parameters and state entry boxes added
| * 9fd54f3 Update Readme.md
| * 4650244 moved to "dynamics"
| * d5f6914 moved to "dynamics"
| * 18871c5 Scan modules in "dynamics" folder
| * e9080a9 first three modules
| * eab81cb Create Readme.md
|/
* 9e9ed1b 2017 files
* 5319297 Delete third_lewis.py
* 9a6d07d Delete wataru.py
* fad7706 Delete second.py
* beee04f Delete logistic.py
* e26d14a Delete first_nonlinear.py
* 309db7b Delete first.py
* 751c472 Delete Sarah.py
* fed919f Delete Pendulum.py
* b1e1da9 Delete FHN.py
* 617279c Delete DynaView.py
* fb5acc5 2017 dynamics files merged manually
* aa5fb68 Merge pull request #11 from oist/darya
|\
| * 1e05d8c Merge branch 'master' into darya
| |\
| |/
|/|
* | 598ce08 Merge pull request #14 from oist/Rachapun
|\ \
| * | b760678 Update first_Rachapun.py
* | | 38f4e08 Merge pull request #15 from oist/linlingru
|\ \ \
| * \ \ ae13d99 Merge branch 'master' into linlingru
| |\ \ \
| |/ / /
|/| | |
* | | | 8c6b6db Merge pull request #16 from oist/Charles_W_Edits
|\ \ \ \
| * | | | 0135d42 Update DynaView.py
| * | | | 2860ee0 Update first.py
| * | | | 4e09dca Update second.py
| * | | | f723342 Update first.py
* | | | | 8f4bdb9 Merge pull request #17 from oist/Osamu
|\ \ \ \ \
| * \ \ \ \ a30c13b Merge branch 'master' into Osamu
| |\ \ \ \ \
| |/ / / / /
|/| | | | |
* | | | | | 668a73e Merge pull request #19 from oist/Wataru
|\ \ \ \ \ \
| * \ \ \ \ \ bce065e Merge branch 'master' into Wataru
| |\ \ \ \ \ \
| |/ / / / / /
|/| | | | | |
* | | | | | | e81837b Merge pull request #23 from oist/Mizuki_Kato
|\ \ \ \ \ \ \
| * \ \ \ \ \ \ 8f3bb8f Merge branch 'master' into Mizuki_Kato
| |\ \ \ \ \ \ \
| |/ / / / / / /
|/| | | | | | |
* | | | | | | | 7497aa6 Merge branch 'lewis'
|\ \ \ \ \ \ \ \
| * | | | | | | | b771b88 Add files via upload
| * | | | | | | | 459f682 Add files via upload
* | | | | | | | | e3357a6 Update Readme.md
* | | | | | | | | ab0307c Delete touseef_second.py
* | | | | | | | | fc11022 Delete touseef_first.py
* | | | | | | | | 1b0b636 Delete hsiaochiao
* | | | | | | | | 8241eb7 Delete DynaView.py
* | | | | | | | | 05bbfb0 Delete Readme.md
* | | | | | | | | 94bf611 Delete Readme.md
* | | | | | | | | 3b346d4 2018 course material
* | | | | | | | | 8b2443b Initial files by KD
* | | | | | | | | 9431195 Update Readme.md
* | | | | | | | | a58e3e4 Create Readme.md
* | | | | | | | | 2b2726b Create Readme.md
* | | | | | | | | e2a4ffa Create Readme.md
| | * | | | | | | cf01dbd Add files via upload
| |/ / / / / / /
|/| | | | | | |
* | | | | | | | a886358 Merge pull request #22 from 123miles/123miles-patch-9
|\ \ \ \ \ \ \ \
| * | | | | | | | b5262f5 Add files via upload
| | |_|_|/ / / /
| |/| | | | | |
* | | | | | | | 36feb34 Merge pull request #21 from 123miles/readme-edits
|\ \ \ \ \ \ \ \
| |/ / / / / / /
|/| | | | | | |
| * | | | | | | 4bc04b8 Merge pull request #1 from 123miles/123miles1
|/| | | | | | |
| * | | | | | | 3e58714 Update README.md
|/ / / / / / /
| | * / / / / 7fc4940 Add files via upload
| |/ / / / /
| | * | | | f965764 Create logistic.py
| | * | | | d21975f Update DynaView.py
| |/ / / /
|/| | | |
* | | | | 31214f0 Merge pull request #13 from oist/Rachapun
|\ \ \ \ \
| | |_|/ /
| |/| | |
| * | | | d544025 Update DynaView.py
| * | | | 11fa29b Add files via upload
|/ / / /
| | * | c1ee017 Update DynaView.py
| | * | 77b19a1 Add files via upload
| | * | a880143 Delete linlingru_first.py
| | * | cf7ef67 update first.py
| | * | c0c018a Add files via upload
| |/ /
|/| |
| | * de06314 Add files via upload
| | * aa0c972 Update DynaView.py
| |/
|/|
* | 558a07e Update Readme.md
* | 5bf9e0f Update Readme.md
* | dc803f7 Some notes on the exercise
* | 8e2b144 Merge pull request #9 from otistwo/master
|\ \
| * | c140ae9 changed first and second to otis
| |/
* | 73cdbca Merge pull request #8 from oist/Touseef
|\ \
| * | 66bf463 Add files via upload
| |/
* / c456b82 i updated first_Tabbal
|/
* 69e0154 Create hsiaochiao
* fd4d5c5 DynaView.py and two dynamics modules
* 3d5b491 Create Readme.md
* baf2bb6 First version for "Software Management"
* 50cabde Initialized Readme.md
* b8dc4bb Initial commit
Now push your branch to GitHub repository by, e.g.
git push origin myname
!git push origin myname
Everything up-to-date
Check the status on GitHub: oist/ComputationalMethods2022
and make a pull request for the repository administrator to check your updates.
The administrator may reply back with a comment for revision or merge your change to the main branch.
Pulling updates#
While you are working on your local code, the codes on the origial repository may be updated. You may also want to check the branches other people have created.
You can use git pull
to reflect the changes in the GitHub to your local repository.
You can use git branch
to see what branches are there and git checkout
to try with the codes in other branches.
!git pull
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=origin/<branch> myname
!git branch
main
* myname
Optional) In addition to adding a new module, you are welcome to improve the main program odesim.py
itself. For example,
add other visualization like a phese plot.
fix any bugs or improve error handling.
add documentation.
…