[go: up one dir, main page]

Skip to content

kangwonlee/nmisp

Repository files navigation

CI

์‚ฌ์ดํŒŒ์ด ์ˆ˜์น˜ ํ•ด์„
Numerical Methods in SciPy

์†Œ๊ฐœ
Introduction

how to use NMISP repo

์ด ์†Œํ”„ํŠธ์›จ์–ด๋Š” ๋‹ค์–‘ํ•œ ์ˆ˜์น˜ ํ•ด๋ฒ•์„ Python ์–ธ์–ด์™€ ๊ทธ ํ™•์žฅ ๊ธฐ๋Šฅ์ธ SciPy ๋ฅผ ์ด์šฉํ•˜์—ฌ ์„ค๋ช…ํ•˜๊ณ ์ž ํ•จ.
This software aims to describe various numerical methods in Python programming language and its extesion SciPy.

How to Open in Google Colab
๊ตฌ๊ธ€ ์ฝ”๋žฉ์—์„œ ์ฝ๋Š” ๋ฒ•

  1. Open an ipynb file of this repository
    ์ด ์ €์žฅ์†Œ์˜ ipynb ํŒŒ์ผ์„ ์—ถ
  2. Click on Open In Colab
    Open In Colab ํด๋ฆญ
  3. Try Run all of Runtime
    ๋Ÿฐํƒ€์ž„ ์•„๋ž˜ ๋ชจ๋‘ ์‹คํ–‰ ์‹œ๋„

How to commit changes on Google Colab to Github
๊ตฌ๊ธ€ ์ฝ”๋žฉ์˜ ๋ณ€๊ฒฝ ์‚ฌํ•ญ์„ Github ์— ๋ฐ˜์˜ํ•˜๋Š” ๋ฒ•

  1. Fork the repository
    ์ €์žฅ์†Œ์˜ ๋ถ„๊ธฐ ์‚ฌ๋ณธ์„ ๋งŒ๋“ฆ
  2. Open the ipynb file from the forked repository
    ๋ถ„๊ธฐ๋œ ์ €์žฅ์†Œ์—์„œ ipynb ํŒŒ์ผ์„ ์—ถ
  3. Click on Open In Colab
    Open In Colab ํด๋ฆญ
  4. Make changes
    ํŒŒ์ผ์„ ์ˆ˜์ •
  5. Choose Save a copy in GitHub under File menu
    ํŒŒ์ผ ๋ฉ”๋‰ด ์•„๋ž˜ Github ์— ์‚ฌ๋ณธ ์ €์žฅ
  6. Adjust permissions and/or retry if necessary
    ํ•„์š”์‹œ ๊ถŒํ•œ ์กฐ์ • ํ›„ ์žฌ์‹œ๋„

์„ค์น˜ ํ•ญ๋ชฉ
Software to install

๊นƒ ๋ฒ„์ „ ๊ด€๋ฆฌ ์†Œํ”„ํŠธ์›จ์–ด : ๋ช…๋ นํ–‰ ์‹คํ–‰ ํ™˜๊ฒฝ
Git Version Control Software : Commadline interface

  • ์šฐ๋ถ„ํˆฌ ๋ฆฌ๋ˆ…์Šค์˜ ๊ฒฝ์šฐ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์„ค์น˜
    For Ubuntu Linux, install as follows
apt-get install git
  • Windows ์˜ ๊ฒฝ์šฐ ์•„๋ž˜ ๋งํฌ์—์„œ ๋‹ค์šด๋กœ๋“œ ๊ฐ€๋Šฅ
    Download for Windows available at the following link : Git for Windows
๊ฐ„๋‹จํ•œ ์ถ”์ฒœ ์‚ฌํ•ญ
A few simple recommendations
  • ๋ช…๋ นํ–‰์—์„œ ์‚ฌ์šฉ Command line interface
  • ์‹ค์Šต์‹ค ํ™˜๊ฒฝ์—์„œ๋Š” credential manager ์„ค์น˜ ์‚ผ๊ฐ€
    Credential manager may not be a best choice for a computer lab
  • ์•„๋ž˜ IDE ๊ฐ€์šด๋ฐ Microsoft Visual Studio Code ์„ ํƒ์‹œ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ƒ๊ฐํ•ด ๋ณผ ์ˆ˜ ์žˆ์Œ
    To use Microsoft Visual Studio Code among IDEs below, an administrator may consider followings
ํ•ญ๋ชฉ
Key
๊ฐ’
Value
git ๊ธฐ๋ณธ ํŽธ์ง‘๊ธฐ
Default editor for Git
MS VS Code
๊ฒฝ๋กœ ํ™˜๊ฒฝ ์กฐ์ •
Adjusting Path environment
Use Git from the Windows Command Prompt
ํ„ฐ๋ฏธ๋„ ์—๋ฎฌ๋ ˆ์ดํ„ฐ
Terminal emulator
Use Windows' default console window
์ž๊ฒฉ ์ธ์ฆ ๊ด€๋ฆฌ์ž ํ™œ์„ฑํ™”
Enable Git Credential Manager
์ „์‚ฐ ์‹ค์Šต ํ™˜๊ฒฝ์˜ ๊ฒฝ์šฐ, ์„ ํƒ ํ•ด์ œ
If computer lab, unselect

์ดํ›„ MS vscode ์—์„œ๋„ ํ•œ๋‘๊ฐ€์ง€ ์ถ”๊ฐ€ ์„ค์ •์„ ์‹ค์‹œํ•˜๋ฉด ๋‚ด์žฅ ํ„ฐ๋ฏธ๋„๋กœ git-bash ๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Œ
With a few additional configurations in MS vscode, one could use git-bash as the integrated terminal.

ํŒŒ์ด์ฌ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด
Python Programming Language

  • Python 3.7 ์ดํ›„
    Python 3.7 or latter
  • 64bit ํŒ ์ถ”์ฒœ
    Recommend 64 bit versions
  • ๋ฆฌ๋ˆ…์Šค ๋ช…๋ น์–ด ํ™˜๊ฒฝ์—์„œ ๋‹ค์Œ ์‹คํ–‰
    Run following commands in a Linux shell
# Download & install miniconda
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
chmod +x Miniconda3-latest-Linux-x86_64.sh
./Miniconda3-latest-Linux-x86_64.sh
source ~/.bashrc

# Install python modules
git clone https://github.com/kangwonlee/nmisp
pushd nmisp
# You may choose a different environment configuration under ./tests/ folder
conda env create -n nmisp -f ./tests/environment.2020.07.yml

# Start the jupyter notebook
conda activate nmisp
jupyter notebook &
# please do not close the shell

# to run tests
pytest -n auto tests/
  • Python 3.7.x ์ดํ›„
    Python 3.7.x or latter
  • 2019.07ํŒ ์ดํ›„
    Latter or equal to 2019.07
  • ๋ช…๋ นํ–‰์—์„œ ์‹คํ–‰ํ•ด์•ผ ํ•  ๊ฒฝ์šฐ, ๊ฒฝ๋กœ์— ์ถ”๊ฐ€ํ•˜๋„๋ก ์„ค์ •
    To run from a command line, configure to add python to the PATH
  • ๊ฒฝ๋กœ ์ด๋ฆ„์— ํ•œ๊ธ€์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์—†์Œ
    Use ASCII characters for path name
  • In addition, some of the following modules may be needed
    ์•„๋ž˜ ๋ชจ๋“ˆ ์ค‘ ์ผ๋ถ€ ์ถ”๊ฐ€ ์„ค์น˜๊ฐ€ ํ•„์š”ํ•  ์ˆ˜ ์žˆ์Œ
conda install conda-forge::tensorflow
conda install pytorch::pytorch
conda install pytorch::torchvision

๊นƒ ๋ฒ„์ „ ๊ด€๋ฆฌ ์†Œํ”„ํŠธ์›จ์–ด : ๊ทธ๋ž˜ํ”ฝ ์‹คํ–‰ ํ™˜๊ฒฝ
Git Version Control Software : Graphic user interface

์•„๋ž˜ ๊ฐ€์šด๋ฐ ํƒ์ผ
Choose one from below

ํ†ตํ•ฉ ๊ฐœ๋ฐœ ํ™˜๊ฒฝ
Integrated Development Environment

  • iPython ๋…ธํŠธ๋ถ (.ipynb) ํŒŒ์ผ ์‚ฌ์šฉ์‹œ๋Š” ๋ฐ˜๋“œ์‹œ ํ•„์š”ํ•˜์ง€ ์•Š์„ ์ˆ˜ ์žˆ์Œ
    May not need one for iPython notebook (.ipynb) files
  • ์•„๋ž˜ ๊ฐ€์šด๋ฐ ํƒ์ผ
    Choose one from below

Spyder

  • Anaconda ์™€ ํ•จ๊ป˜ ์„ค์น˜๋  ์ˆ˜ ์žˆ์Œ.
    Anaconda may include spyder.
  • PyCharm ์„ ์‹คํ–‰์‹œํ‚ค๊ธฐ ์œ„ํ•ด Java Development Kit ๋ฅผ ์„ค์น˜ํ•ด์•ผ ํ•  ์ˆ˜ ์žˆ์Œ (2016 09)
    PyCharm may need Java Development Kit to run.
  • Anaconda ์„ค์น˜ ํ›„ ์„ค์น˜ ์„ ํƒ ๊ฐ€๋Šฅ
    Installation button available at the end of Anaconda installation
  • ๋‹ค์šด๋กœ๋“œ ๋ฐ›์•„์„œ ์„ค์น˜๋„ ๊ฐ€๋Šฅ
    Possible to download and install from the website
    Setup Overview / Python Configuration Instruction
  • Windows ์—์„œ git-bash๋ฅผ ๋‚ด์žฅ ํ„ฐ๋ฏธ๋„๋กœ ์‚ฌ์šฉํ•˜๋ ค๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์ถ”๊ฐ€ ์„ค์ •์ด ํ•„์š”ํ•จ.[์ฐธ๊ณ ]
    In Windows, to use git-bash as the integrated terminal, following additional settings would eable it.[Ref]
  1. File > Preferences > Settings [์ฐธ๊ณ  Ref]
"terminal.integrated.shell.windows": **path to bash.exe here**

์„ค์น˜ ๋™์˜์ƒ
Installation video

์„ค์น˜ ๋™์˜์ƒ Installation video

jupyter ๋…ธํŠธ๋ถ
jupyter notebook

  • ์ด ์ €์žฅ์†Œ ๋Š” ์ฃผ๋กœ jupyter ๋…ธํŠธ๋ถ์œผ๋กœ ๋งŒ๋“ค์–ด์ ธ ์žˆ์Œ.
    This repository is mostly written in jupyter notebook.
  • jupyter ๋…ธํŠธ๋ถ์€ ์›น๋ธŒ๋ผ์šฐ์ €๋ฅผ ํ†ตํ•ด ํ”„๋กœ๊ทธ๋žจ ์ฝ”๋“œ๋ฅผ ์ˆ˜์ • ์‹คํ–‰ํ•˜๊ณ  LaTex ์ˆ˜์‹์„ ํฌํ•จํ•œ ๋ฌธ์„œ ์ž‘์„ฑ์ด ๊ฐ€๋Šฅํ•จ.
    Through a web browser, jupyter notebook enables editing & running program codes and writing documents including LaTex equations.

jupyter ๋…ธํŠธ๋ถ ์‹คํ–‰์‹œํ‚ค๋Š” ๋ฒ•
How to start the jupyter notebook

  • ์ ๋‹นํ•œ folder ๋ฅผ ๋งŒ๋“ฆ
    Make an appropriate folder
  • Git ๋˜๋Š” SourceTree ๋ฅผ ์ด์šฉํ•˜์—ฌ ์œ„ folder ์•„๋ž˜ ์ด ์›๊ฒฉ ์ €์žฅ์†Œ๋ฅผ git clone
    Using the Git or SourceTree, git clone this repository under the folder
  • cmd ๋˜๋Š” git bash ์‹คํ–‰ํ•œ ํ›„ cd ๋ช…๋ น์œผ๋กœ clone ๋œ ์ง€์—ญ ์ €์žฅ์†Œ folder๋กœ ์ด๋™
    Start cmd or git bash and using the cd command change working folder to the cloned folder
  • cmd ๋˜๋Š” git bash ์—์„œ ๊ฐ๊ฐ cd ๋˜๋Š” pwd ๋กœ clone ๋œ folder ์ธ์ง€ ํ™•์ธ
    Check location using cd or pwd in cmd or git bash
  • jupyter notebook ์‹คํ–‰
    Run jupyter notebook
  • ํ•„์š”์— ๋”ฐ๋ผ ~/.bashrc ํŒŒ์ผ์— ๋‹ค์Œ ๋‚ด์šฉ์„ ์ถ”๊ฐ€
    As necessary, add following lines to ~/.bashrc file
alias log='git log --oneline --graph --all --decorate'
alias nb='jupyter notebook --no-browser &'

์‹คํ–‰ ๋™์˜์ƒ (git bash)
Instruction video (git bash)

์‹คํ–‰ ๋™์˜์ƒ (SourceTree) Instruction video (SourceTree)

์•Œ๋ฆผ
Acknowledgement

  • This software was initially supported by the Korea Ministry of Land, Infrastructure, and Transportation. It was also supported by the Korean Agency for Infrastructure Technology Advancement. (18TLRP-B117133-03)
    ์ด ์†Œํ”„ํŠธ์›จ์–ด๋Š” ๋Œ€ํ•œ๋ฏผ๊ตญ ๊ตญํ† ๊ตํ†ต๋ถ€ ๊ฑด์„ค๊ตํ†ต๊ณผํ•™๊ธฐ์ˆ ์ง„ํฅ์› ๊ตํ†ต๋ฌผ๋ฅ˜์—ฐ๊ตฌ์‚ฌ์—…์˜ ์ง€์›์„ ๋ฐ›์•„ ์‹œ์ž‘๋˜์—ˆ์Œ. (18TLRP-B117133-03)
  • Also, this software got help from generative artificial intelligence : Google Gemini Advance in improving the text and source code quality.
    ๋˜ํ•œ, ์ด ์†Œํ”„ํŠธ์›จ์–ด๋Š” ๋ฌธ์žฅ๊ณผ ์ฝ”๋“œ ํ’ˆ์งˆ ํ–ฅ์ƒ์„ ์œ„ํ•ด ์ƒ์„ฑํ˜• ์ธ๊ณต์ง€๋Šฅ ๊ตฌ๊ธ€ ์ œ๋ฏธ๋‹ˆ ์–ด๋“œ๋ฐด์Šค์˜ ๋„์›€์„ ๋ฐ›์•˜์Œ.