Skip to content

Allow api.addAgent() to take double or int #10

Description

@davidcsterratt

At present api.addAgent has to take an int value argument. It should be able to take a double or an int without complaining to make life easier in the python interface.

This code produces the error:

sk = SpatialKappa.SpatialKappa()
sim = sk.kappa_sim("ms", True)
sim.loadFile("../simple-psd-pepke-kappa-nmda.ka")
sim.addAgent('ca', 1)

Giving this output:

Traceback (most recent call last):
  File "pulse.py", line 31, in <module>
    sim.addAgent('ca', ca_pulse)
  File "/disk/scratch/sterratt/lib/python2.7/site-packages/py4j-0.8.1-py2.6.egg/py4j/java_gateway.py", line 539, in __call__
    self.target_id, self.name)
  File "/disk/scratch/sterratt/lib/python2.7/site-packages/py4j-0.8.1-py2.6.egg/py4j/protocol.py", line 304, in get_return_value
    format(target_id, '.', name, value))
py4j.protocol.Py4JError: An error occurred while calling o0.addAgent. Trace:
py4j.Py4JException: Method addAgent([class java.lang.String, class java.lang.Integer]) does not exist
    at py4j.reflection.ReflectionEngine.getMethod(ReflectionEngine.java:333)
    at py4j.reflection.ReflectionEngine.getMethod(ReflectionEngine.java:342)
    at py4j.Gateway.invoke(Gateway.java:251)
    at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)
    at py4j.commands.CallCommand.execute(CallCommand.java:79)
    at py4j.GatewayConnection.run(GatewayConnection.java:207)
    at java.lang.Thread.run(Thread.java:744)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions