Skip to content
This repository has been archived by the owner on Aug 13, 2020. It is now read-only.

Suggestions for csdocs #77

Open
peiworld opened this issue Jul 16, 2017 · 2 comments
Open

Suggestions for csdocs #77

peiworld opened this issue Jul 16, 2017 · 2 comments

Comments

@peiworld
Copy link

I am trying to go through various parts of the calvin framework. Some actors require inputs at init. However, the documentation for those is a bit lacking. For example, I understand that std.Constant(data) requires data as input. But, what is 'data'? Can I specify a datafile?

https://github.com/EricssonResearch/calvin-base/blob/master/calvin/actorstore/systemactors/std/Constant.py

"""
Send predetermined data on output. Never ending sequence.
Outputs:
token : Some data
"""
@manage(['data'])
def init(self, data):
self.data = data

@persquare
Copy link
Contributor

Ah, yes, the documentation is a bit terse...

Send predetermined data on output. Never ending sequence.
Outputs:
token : Some data

As a rule of convention, not enforced, a port named token as above consumes/produces "any kind" of data, where "any kind" means valid JSON data. So in this particular case, the following examples are both valid:

foo : std.Constant(data=null)
bar : std.Constant(data={"hey":"you", "array":[1,2,3,4]}) 

It is not possible to specify a file, but if you have complex data to pass in it is possible to use constant definitions:

define BAZ={"hey":"you", ... long and complex JSON structure ... }
baz : std.Constant(data=BAZ)

BTW, we'd love pull requests for documentation improvement :)

@peiworld
Copy link
Author

peiworld commented Jul 20, 2017 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants