Installation

Requirements

Lcapy requires the following Python packages: scipy, sympy, numpy, matplotlib, networkx. These are automatically loaded when using pip.

For schematic drawing you require:

  1. pdflatex

  2. CircuiTikZ (https://www.ctan.org/pkg/circuitikz or https://circuitikz.github.io/circuitikz/). Unfortunately, different CircuiTikZ releases subtly tweak component sizes. It is easiest to download Circuitikz as a single file from https://circuitikz.github.io/circuitikz/ and install on your LaTeX inputs path. If using circuitikzgit.sty rename to circuitikz.sty.

  3. Ghostscript (http://www.ghostscript.com/), ImageMagick (http://www.imagemagick.org/), or pdftoppm

For nice maths formatting in a Jupyter notebook you require mathjax (https://www.mathjax.org/). This is not essential; if it is not loaded then an active internet connection is required.

Installation for Linux

  1. Lcapy (and its Python dependencies) can be installed using:

$ pip3 install lcapy
  1. For systems using apt, all the other packages required for Lcapy can be installed using:

$ sudo apt install ghostscript texlive-latex-extra cm-super

If you wish to use schtex ensure that ~/.local/bin is on your path.

Installation for macOS

  1. Lcapy (and its Python dependencies) can be installed using:

$ pip3 install lcapy
  1. Using Homebrew (https://brew.sh), all the other packages required for Lcapy can be installed using:

$ brew install mactex

or to minimise disk space, install a smaller set of LaTeX packages using:

$ brew install basictex
$ eval "$(/usr/libexec/path_helper)"
$ sudo tlmgr install collection-latexextra

Installation for Windows

  1. Lcapy (and its Python dependencies) can be installed using:

$ pip3 install lcapy
  1. To install ghostscript see https://www.ghostscript.com/download/gsdnld.html

  2. Download circuitikz (https://www.ctan.org/pkg/circuitikz)

Installation of latest version

If you wish to install the latest version from the git repository use:

$ pip install git+https://github.com/mph-/lcapy.git#egg=lcapy

However, it is better to fork or clone the git repository if you wish to make fixes.

Installation for development

  1. Install Lcapy’s dependencies as per instructions for your platform

  2. Download Lcapy sources from https://github.com/mph-/lcapy as a .zip file or preferably using git:

$ git clone https://github.com/mph-/lcapy
  1. Install Lcapy using:

$ cd lcapy
$ pip3 install --editable .[test,release]
  1. For building the docs you need sphinx, ipython and pycairo. For example, using apt:

$ sudo apt-get install gir1.2-gtk-3.0 python3-gi python3-gi-cairo
$ pip3 install --editable .[doc]
  1. For debugging schematic graphs dot is required:

$ sudo apt install graphviz
  1. To run style guide checking locally

$ pip3 install flake8 flake8-bugbear flake8-requirements flake8-comprehensions
  1. For coverage analysis

$ pip3 install coverage