This package contains a python plugin for the circuit simulator Gnucap which
allows the user to implement commands or components (or anything) in Python,
and run the simulator in a python environment, e.g. for postprocessing or
plotting purposes.

The package also provides a command for gnucap that loads python modules, such
as python modules implementing custom commands or components (or anything).
See examples.

 Requirements
-------------

requirements are:
  * gnucap >= oct '17
  * Python >= 2.4
  * Swig
  * Numpy (with development headers/libraries)
  * c++11 (pass -std=c++11 to your compiler,
           if 11 is supported but the default is <11)

 NOTE
-------------

if you have installed gnucap with a custom prefix, try passing
LDFLAGS=-L$prefix/lib to configure, and also export
LD_LIBRARY_PATH=$prefix/lib when you run it.

*** on some systems /usr/local is considered "custom", on others a dirty cache
interferes with the linker. YMMV, tell me your workarounds ***

 Installation
-------------

Build python plugin for gnucap

::

   $ ./bootstrap
   $ ./configure  # pass PYTHON=some_other_python, to select
   $ make
   $ make check   # runs tests
   $ make install # optional. may require root privileges

will install the python module "gnucap" and a gnucap plugin "python".

Examples
--------

From gnucap
~~~~~~~~~~~

This seems outdated. See examples/README

::

   $ gnucap -a python.so
   gnucap> python example/loadplot.py        <= this file is missing, but still.
   gnucap> get example/eq2-145.ckt
   gnucap> store ac vm(2)
   gnucap> ac oct 10 1k 100k
   gnucap> myplot vm(2)

First the gnucap plugin is loaded. The second line loads a new command called
"myplot" that plots a stored waveform using matplotlib. Line 3-5 loads a
circuit and runs an ac analysis. Finally the ac magnitude of node 2 is plotted
using the new plotting command.

From Python
~~~~~~~~~~~

Do the same directly from Python

::

   $ python
   >>> import gnucap
   [..]
   welcome to gnucap-python
   >>> gnucap.stuff

stuff is not documented yet, see examples for some applications

Caveats
~~~~~~~

python scatters the planet with .pyc files containing cached bytecode. these
may lead to weird error messages.
