Skip to content

Commit

Permalink
Updated coronavirus notebook with interactive widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
saeedamen committed Mar 28, 2020
1 parent 621cb11 commit 0d2bbab
Show file tree
Hide file tree
Showing 12 changed files with 1,273 additions and 764 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ For instructions on how to install Anaconda and PyCharm see [Installing Anaconda

# Coding log

* 28 Mar 2020
* Updated coronavirus Jupyter notebook with interactive ipywidgets examples from Ewan Kirk
* Updated Anaconda installation files for Windows and Linux
* 25 Mar 2020
* Updated coronavirus Jupyter notebook with new paths for source data and lagged analysis
* 12 Mar 2020
Expand Down
43 changes: 22 additions & 21 deletions pythoncourse/installation/create_conda_env.bat
Original file line number Diff line number Diff line change
@@ -1,61 +1,62 @@
REM assumes that Anaconda has already been downloaded
REM Assumes that Anaconda has already been downloaded

REM update conda
REM Update conda
call conda update -n base -c defaults conda --yes

call conda activate

REM remove any existing environment called py36class, and create a py36class with anaconda packages
REM Remove any existing environment called py36class, and create a py36class with anaconda packages
call conda remove -n py36class --all --yes
call conda create -n py36class python=3.6 anaconda
call conda activate py36class

REM install from conda-forge
REM Install from conda-forge
call conda install -c conda-forge ^
jupyterlab jupyter_contrib_nbextensions jupyter_nbextensions_configurator ipywidgets=7.5 ^
redis-py=3.3.7 python-blosc=1.8.1 pathos graphviz python-graphviz rise textblob wordcloud quandl pyspark py4j ^
spacy fastparquet python-snappy nodejs koalas textacy pystan fbprophet --yes
redis-py=3.3.7 python-blosc=1.8.1 pathos graphviz python-graphviz textblob wordcloud quandl pyspark py4j ^
spacy fastparquet python-snappy nodejs koalas textacy pystan fbprophet setuptools-git=1.2 vispy=0.6.4 blpapi --yes

call pip install arctic==1.79.2

REM install tensorflow, transformers/huggingface and table readers
REM Install tensorflow, transformers/huggingface and table readers
REM only if you have GPU
REM call pip install tensorflow-gpu transformers cvlib pytesseract tabula-py
call pip install tensorflow==2.1.0 transformers pytesseract tabula-py
REM call pip install tensorflow-gpu transformers cvlib pytesseract cmdstanpy==0.4 tabula-py==1.4.3
call pip install tensorflow==2.1.0 transformers pytesseract cmdstanpy==0.4 tabula-py==1.4.3

REM install PyTorch
REM Install PyTorch
REM only if you have GPU
REM call conda install pytorch torchvision cudatoolkit=10.0 -c pytorch --yes
call conda install pytorch torchvision cpuonly -c pytorch --yes
call conda install -c conda-forge opencv --yes
call pip install cvlib

REM for findatapy (and NLP)
call pip install fxcmpy alpha_vantage yfinance twython newspaper3k seasonal pdfminer.six vaderSentiment gensim
REM For findatapy (and NLP)
call pip install fxcmpy alpha_vantage yfinance twython newspaper3k seasonal pdfminer.six vaderSentiment gensim rise

REM findatapy, chartpy and finmarketpy
REM needs git
REM call pip install git+https://github.com/cuemacro/finmarketpy.git git+https://github.com/cuemacro/chartpy.git git+https://github.com/cuemacro/findatapy.git
call pip install finmarketpy chartpy findatapy

REM graphics libraries
call pip install cufflinks==0.17 plotly_express==0.4.1 dash==1.8.0 dash-html-components==1.0.2 dash-core-components==1.7.0 plotly==4.5.0 dash-table==4.6.0
REM Graphics libraries
call pip install cufflinks==0.17 plotly_express==0.4.1 dash==1.9.0 dash-html-components==1.0.2 dash-core-components==1.8.0 plotly==4.5.4 dash-table==4.6.0

REM to be able to plot Plotly into PNG or JPG
REM To be able to plot Plotly into PNG or JPG
call conda install -c plotly plotly-orca --yes

REM in case has been installed elsewhere by pip
REM In case has been installed elsewhere by pip
call pip uninstall pandas

REM newer versions of Pandas aren't supported as well by other libraries (eg. Arctic), so stick to 0.24.2
call conda install -c anaconda pandas=0.24.2 pyarrow=0.13.0 --yes
REM Newer versions of Pandas aren't supported as well by other libraries eg. Arctic so stick to 0.24.2
call conda install -c anaconda pandas=0.24.2 --yes
call conda install -c conda-forge pyarrow=0.16.0 --yes

REM Jupyter libraries
call jupyter contrib nbextension install --user
call jupyter nbextension enable execute_time/ExecuteTime
call jupyter-nbextension install rise --py --sys-prefix
call jupyter labextension install @jupyter-widgets/jupyterlab-manager@1.1 --no-build
call jupyter labextension install plotlywidget@1.4.0 --no-build
call jupyter labextension install jupyterlab-plotly@1.4.0 --no-build
call jupyter labextension install @jupyter-widgets/jupyterlab-manager@2.0.0 --no-build
call jupyter labextension install plotlywidget@1.5.4 --no-build
call jupyter labextension install jupyterlab-plotly@1.5.4 --no-build
call jupyter lab build

51 changes: 25 additions & 26 deletions pythoncourse/installation/create_conda_env.sh
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
#!/usr/bin/env bash

# update conda
# Update conda
conda update -n base -c defaults conda --yes

# conda config --set allow_conda_downgrades true
# conda install conda=4.6.11

source activate

# remove any existing environment called py36class, and create a py36class with anaconda packages
# Remove any existing environment called py36class, and create a py36class with anaconda packages
conda remove -n py36class --all --yes
conda create -n py36class python=3.6 anaconda
source activate py36class

# install from conda-forge (pyarrow is a newer version!)
# Install from conda-forge (pyarrow is a newer version!)
conda install -c conda-forge \
jupyterlab jupyter_contrib_nbextensions jupyter_nbextensions_configurator \
redis-py=3.3.7 python-blosc=1.8.1 pathos graphviz python-graphviz rise textblob wordcloud quandl \
redis-py=3.3.7 python-blosc=1.8.1 pathos graphviz python-graphviz textblob wordcloud quandl \
vaex-core vaex-viz vaex-jupyter vaex-arrow vaex-server vaex-hdf5 vaex-astro vaex-distributed pyspark py4j \
spacy fastparquet python-snappy nodejs koalas textacy pystan fbprophet --yes
spacy fastparquet python-snappy nodejs koalas textacy pystan fbprophet setuptools-git=1.2 vispy=0.6.4 --yes

# for database
# For database
pip install arctic==1.79.2

# celery library
pip install celery==4.3.0 celery[redis] celery[msgpack] msgpack-python
# Celery library
pip install celery==4.4.0 celery[redis] celery[msgpack] msgpack-python

# for findatapy (and NLP)
pip install fxcmpy alpha_vantage yfinance twython newspaper3k seasonal pdfminer.six vaderSentiment gensim
# For findatapy (and NLP)
pip install fxcmpy alpha_vantage yfinance twython newspaper3k seasonal pdfminer.six vaderSentiment gensim rise progressbar2=3.50.1

# install tensorflow and transformers/huggingface (on Mac OS can have issues installing TensorFlow, so if you have Mac
# comment it out)
# only if you have GPU
# pip install tensorflow-gpu transformers cvlib pytesseract tabula-py
pip install tensorflow==2.1.0 transformers pytesseract tabula-py
# pip install tensorflow-gpu transformers cvlib pytesseract cmdstanpy==0.4 tabula-py==1.4.3
pip install tensorflow==2.1.0 transformers pytesseract cmdstanpy==0.4 tabula-py==1.4.3

# install PyTorch
# Install PyTorch
# only if you have GPU
# conda install pytorch torchvision cudatoolkit=10.0 -c pytorch --yes
conda install pytorch torchvision cpuonly -c pytorch --yes
Expand All @@ -44,38 +44,37 @@ pip install cvlib

# modin (later versions need later versions of pandas)
# may downgrade to pandas to 0.24.2
pip install modin=0.5.0
pip install modin==0.5.4

# findatapy, chartpy and finmarketpy (or can manually clone these from GitHub and add to your Python path)
# need to have Git
# pip install git+https://github.com/cuemacro/finmarketpy.git git+https://github.com/cuemacro/chartpy.git git+https://github.com/cuemacro/findatapy.git
pip install finmarketpy chartpy findatapy

# graphics libraries
pip install cufflinks==0.17 plotly_express==0.4.1 dash==1.8.0 dash-html-components==1.0.2 dash-core-components==1.7.0 plotly==4.5.0 dash-table==4.6.0
# Graphics libraries
pip install cufflinks==0.17 plotly_express==0.4.1 \
dash==1.9.0 dash-html-components==1.0.2 dash-core-components==1.8.0 plotly==4.5.4 dash-table==4.6.0

# to be able to plot Plotly into PNG or JPG
# To be able to plot Plotly into PNG or JPG
conda install -c plotly plotly-orca --yes

# in case has been installed elsewhere by pip
# In case has been installed elsewhere by pip
pip uninstall pandas

# newer versions of Pandas aren't supported as well by other libraries (eg. Arctic), so stick to 0.24.2
conda install -c anaconda pandas=0.24.2 pyarrow=0.13.0 --yes
# Newer versions of Pandas aren't supported as well by other libraries (eg. Arctic), so stick to 0.24.2
conda install -c anaconda pandas=0.24.2 --yes
conda install -c conda-forge pyarrow=0.16.0 --yes

# GPU libraries
# conda install -c rapidsai -c nvidia -c conda-forge -c defaults rapids=0.10 python=3.6

# in case modin has changed pandas version!
# conda install -c anaconda pandas=0.24.2 --yes

# Jupyter and Jupyterlab extensions
jupyter contrib nbextension install --user # to activate js on Jupyter
jupyter nbextension enable execute_time/ExecuteTime
jupyter-nbextension install rise --py --sys-prefix
jupyter labextension install @jupyter-widgets/jupyterlab-manager@1.1 --no-build
jupyter labextension install plotlywidget@1.4.0 --no-build
jupyter labextension install jupyterlab-plotly@1.4.0 --no-build
jupyter labextension install @jupyter-widgets/jupyterlab-manager@2.0.0 --no-build
jupyter labextension install plotlywidget@1.5.4 --no-build
jupyter labextension install jupyterlab-plotly@1.5.4 --no-build
jupyter lab build


1 change: 1 addition & 0 deletions pythoncourse/installation/create_huge_pages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ gid=`id -g`
uid=`id -u`
sudo mount -t hugetlbfs -o uid=$uid -o gid=$gid none /mnt/hugepages
sudo bash -c "echo $gid > /proc/sys/vm/hugetlb_shm_group"

# This typically corresponds to 20000 2MB pages (about 40GB), but this
# depends on the platform.
sudo bash -c "echo 20000 > /proc/sys/vm/nr_hugepages"
Loading

0 comments on commit 0d2bbab

Please sign in to comment.