Giter Site home page Giter Site logo

veit / jupyter-tutorial Goto Github PK

View Code? Open in Web Editor NEW
24.0 7.0 12.0 37.57 MB

Training materials for setting up and using a research infrastructure based on Jupyter notebooks: https://cusy.io/en/seminars

Home Page: https://jupyter-tutorial.readthedocs.io/

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%
jupyter ipython ipython-widget ipywidget jupyter-notebook jupyterhub notebook

jupyter-tutorial's Introduction

Quick start

Status

Contributors License pre-commit.ci status Docs Pyup DOI Mastodon

Installation

  1. Download and unpack:

    $ curl -O https://codeload.github.com/veit/jupyter-tutorial/zip/main
    $ unzip main
    Archive:  main
    
       creating: jupyter-tutorial-main/
    
  2. Install Python packages:

    $ cd jupyter-tutorial-main
    $ python3 -m venv .
    $ . bin/activate
    $ python -m pip install -r docs/requirements.txt
  3. Install the Jupyter Notebook Extensions Javascript and CSS files:

    $ jupyter contrib nbextension install --user
    jupyter contrib nbextension install --user
    Installing jupyter_contrib_nbextensions nbextension files to jupyter data directory
    
    Successfully installed jupyter-contrib-core-0.3.3 jupyter-contrib-nbextensions-0.5.1
    jupyter-highlight-selected-word-0.2.0 jupyter-latex-envs-1.4.6
    jupyter-nbextensions-configurator-0.4.1
    
    $ jupyter nbextension enable latex_envs --user --py
    Enabling notebook extension latex_envs/latex_envs...
          - Validating: OK
  4. Create HTML documentation:

    Note that pandoc has to be installed. On Debian/Ubuntu you can just run

    $  sudo apt install pandoc

    To create the HTML documentation run these commands:

    $ cd docs/
    $ make html
  5. Create a PDF:

    For the creation of a PDF file you need additional packages.

    For Debian/Ubuntu you get them with the following command:

    $ sudo apt install texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended latexmk

    or for macOS with:

    $ brew cask install mactex
    
    🍺  mactex was successfully installed!
    $ curl --remote-name https://www.tug.org/fonts/getnonfreefonts/install-getnonfreefonts
    $ sudo texlua install-getnonfreefonts
    
    mktexlsr: Updating /usr/local/texlive/2020/texmf-dist/ls-R...
    mktexlsr: Done.

    Then you can generate a PDF with:

    $ make latexpdf
    
    The LaTeX files are in _build/latex.
    Run 'make' in that directory to run these through (pdf)latex
    

    You can find the PDF at docs/_build/latex/jupytertutorial.pdf.

  6. Install vnd run ale to check spelling

    You can install Vale with:

    $ brew install vale

    You can install the parser for Restructuredtext with:

    $ brew install docutils
    .. seealso::
       * `Vale installation <https://docs.errata.ai/vale/install>`_
       * `Vale formats <https://docs.errata.ai/vale/scoping#formats>`_
    
    

    Now you can check the RestructuredText files with:

    $ vale .
    ✔ 0 errors, 0 warnings and 0 suggestions in 201 files.

Follow us

Pull-Requests

If you have suggestions for improvements and additions, I recommend that you create a Fork of my GitHub Repository and make your changes there. . You are also welcome to make a pull request. If the changes contained therein are small and atomic, I’ll be happy to look at your suggestions.

jupyter-tutorial's People

Contributors

dependabot[bot] avatar hofmannedv avatar pre-commit-ci[bot] avatar pyup-bot avatar silke avatar veit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

jupyter-tutorial's Issues

Python 3.8 Notebook

Python 3.8 brings several features that are very interesting for scientific computing. They should be presented in a notebook.

Automating code quality in product realisation

  • check-manifest
  • mypy for static typing
  • Black
  • isort
    • Config:
      [isort]
      atomic=true
      force_grid_wrap=0
      include_trailing_comma=true
      lines_after_imports=2
      lines_between_types=1
      multi_line_output=3
      not_skip=__init__.py
      use_parentheses=true
      
      known_first_party=attr
      known_third_party=hypothesis,pytest,setuptools,six,zope
      
    • For the detection of third party packages you can use seed-isort-config.
  • prettier for automated formatting of other file types
  • pre-commit offers a framework for running hooks before committing code.
    • Config pre-commit-config.yaml:
      repos:
        - repo: https://github.com/psf/black
          rev: 19.10b0
          hooks:
            - id: black
              language_version: python3.7
              # override until resolved: https://github.com/ambv/black/issues/402
          files: \.pyi?$
              types: []
      
        - repo: https://gitlab.com/pycqa/flake8
          rev: 3.7.9
          hooks:
            - id: flake8
              language_version: python3.7
      
        - repo: https://github.com/asottile/seed-isort-config
      rev: v1.9.4
          hooks:
            - id: seed-isort-config
      
        - repo: https://github.com/pre-commit/mirrors-isort
      rev: v4.3.21
          hooks:
            - id: isort
              additional_dependencies: [toml]
              language_version: python3.7
      
        - repo: https://github.com/pre-commit/pre-commit-hooks
          rev: v2.4.0
          hooks:
            - id: trailing-whitespace
            - id: end-of-file-fixer
            - id: debug-statements
      
    • Run pre-commit run --all-files

Add badges for all libs

  • Stars
  • Contributors
  • Activity
  • Downloads
  • License

e.g.

Name Stars Contributors Activity Downloads License
Jupyter-Tutorial stars contributors GitHub commit activity GitHub All Releases License

Update packaging docs to pep517 builds

See Do not use python setup.py ….
If you are invoking setup.py, you should be looking for the alternatives:

  • python setup.py uploadpipenv run twine
  • python setup.py installpipenv install
  • python setup.py testpipenv run tox
  • python setup.py sdist bdist_wheelpython -m pep517.build -s -b

Define audience in the documentation

At least one of the following audiences should be specified for each document:

  • data scientists
  • data engineers
  • data analysts
  • systems engineers

Add heat extension

If the %%heat command is inserted at the top of a cell, it colorises the performance report.
You can install it with $ pipenv install py-heat-magic and load the extension with %load_ext heat.
See pyheatmagic and pyheat.

Replace pipenv

Since pipenv doesn’t seem to be further developed (see If this project is dead, just tell us #4058 it’s time to look around for alternatives.

  • pip-tools for dependency management including automation of updates.
  • venv, possibly supplemented by pex or shiv.
  • pipdeptree print the dependency tree of the installed packages

Unfortunately, Poetry can’t install packages along with their dependencies in an explicitly specified virtual environment. However, this makes CI much easier.

Manage npm

  1. npm init
  2. Lock dependencies: .npmrc
    $ npm config set save=true
    $ npm config set save-exact=true
    
  3. Secure your projects and tokens
    Don’t store the token directly in .npmrc but in .profile and then link to it:
    //registry.npmjs.org/:_authToken=${NPM_TOKEN}
    
    See Deploying with npm private modules
  4. Check for outdated dependencies
    $ npm outdated
    
    See also Greenkeeper
  5. preinstall, postinstall and test scripts
  6. NODE_ENV environment variables
    console.log("Node environment :"  + process.env.NODE_ENV);
    
    See also:
  7. Avoid devDependencies in production
    To install production dependencies, run
    $ npm install --production
    
    or
    $ NODE_ENV=production npm install
    
    See also Specifying dependencies and devDependencies in a package.json file

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.