[SAGA-RG] comments about PySAGA
Sylvain Reynaud
Sylvain.Reynaud at in2p3.fr
Wed Sep 7 04:32:18 CDT 2011
Hi all,
From our point of view, the PySAGA VU bindings is not so far from being
pythonic, but here are few comments about this binding :
- Create method classes are useful for asynchronous creation on the
objects (JobService, NSEntry, RPC, Stream, StreamService), but other
objects do not support asynchronous creation (Context, JobDescription,
Callback, Metric, Parameter, Session, Task, TaskContainer, URL). There's
no point using a create method for these later objects, using a
constructor is better. Our proposal is to use constructors on all
objects and keep the create class method only for objects that can be
asynchronously created.
- We think that we should not modify SAGA methods to accept both URL and
string, because this would lead to more drawbacks than benefits. Indeed,
it's not a good thing to use the same argument to store different type
of objects, and URLs can be created on the fly (futhermore when it will
be possible to use constructors).
- The getter and setter (for example in URL, Parameter, SagaException,
StdIO) should be replaced by properties. However, methods like
Job.get_stdin or JobService.get_job are not real getter and should be
kept unchanged.
- The SAGA specification says "Bindings to languages that natively
support inspection on object types MAY omit this enum and the get type()
method.". So we could remove the get_type method from the BaseObject
class and so the BaseObjectType class, and use the Python "isinstance"
method instead.
- Some methods coming from the latest version of the specification
(Revised January 25, 2011) are not in the python bindings, like
SagaException.get_all_messages() and get_all_exceptions() for example.
- The TaskContainer.size() method could be replaced with the magic
Python method .__len__() in order to enable to use the Python standard
way of getting the length len(obj)
Comments are welcomed !
Julien and Sylvain
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.ogf.org/pipermail/saga-rg/attachments/20110907/2c385436/attachment.html
More information about the saga-rg
mailing list