Skip to main content

Wrapper to interact with the Kappa tool suite

Project description

Do

>>> import kappy
>>> client = kappy.KappaRest("http\://url_of/the_server","project_name")

to get a kappa client that uses the REST API hosted by http://url_of/the_server and deals with project project_name.

Do

>>> import kappy
>>> client = kappy.KappaStd()

to get a kappa client that uses a kappa agent installed locally. Add a string argument specifing the path/to/KaSimAgent to use a specific agent.

A kappa agent can be obtained thanks to the opam package manager through:

$ opam install atdgen lwt
$ opam pin add --dev KaSim

The methods of client is described in the kappa_common.py file in the source distribution.

A minimal example of usage is

>>> model = "%agent: A(x[x.A]) %var: k_on 1e-2 'rule' A(x[.]), A(x[.]) <-> A(x[1]), A(x[1]) @ k_on, 1 %plot: |A(x[.])| %init: 100 A()"
>>> client.add_model_string(model)
>>> client.project_parse()
>>> sim_params = kappy.SimulationParameter(pause_condition="[T] > 100",plot_period=1)
>>> client.simulation_start(sim_params)
>>> while client.get_is_sim_running(): sleep(0.1)
>>> results = client.simulation_plot()
>>> client.shutdown()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for kappy, version 4.0.94
Filename, size File type Python version Upload date Hashes
Filename, size kappy-4.0.94-cp27-cp27m-manylinux2010_x86_64.whl (8.5 MB) File type Wheel Python version cp27 Upload date Hashes View hashes
Filename, size kappy-4.0.94-cp27-cp27mu-manylinux2010_x86_64.whl (8.5 MB) File type Wheel Python version cp27 Upload date Hashes View hashes
Filename, size kappy-4.0.94-cp34-cp34m-manylinux2010_x86_64.whl (8.5 MB) File type Wheel Python version cp34 Upload date Hashes View hashes
Filename, size kappy-4.0.94-cp35-cp35m-manylinux2010_x86_64.whl (8.5 MB) File type Wheel Python version cp35 Upload date Hashes View hashes
Filename, size kappy-4.0.94-cp36-cp36m-manylinux2010_x86_64.whl (8.5 MB) File type Wheel Python version cp36 Upload date Hashes View hashes
Filename, size kappy-4.0.94-cp37-cp37m-manylinux1_x86_64.whl (8.5 MB) File type Wheel Python version cp37 Upload date Hashes View hashes
Filename, size kappy-4.0.94-cp37-cp37m-manylinux2010_x86_64.whl (8.5 MB) File type Wheel Python version cp37 Upload date Hashes View hashes
Filename, size kappy-4.0.94.tar.gz (12.6 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page