You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 23, 2018. It is now read-only.
Hi, I got the use-case of an aggregation node that accumulates data from nodes of a certain type. Specifically: I got several nodes producing GeoJson data. Now I want to accumulate those with a Section or Widget. For the section, at least one GeoJson is required, but in general the inputs are optional. I just want to render what's available from the bag, i.e. sometimes some topics are missing and one or another GeoJson node fails. I wonder how to model this situation correctly with Marv:
Either I collect all nodes of a certain type, e.g.:
@marv.node(Section)@marv.input('geojson_streams', default=[magicallycollectallGeoJsonnodes])defmy_trajectory_section(geojson_streams):
geojson_streams=marv.pull_all(*geojson_streams)
ifnotany(all_geojson_streams):
# no valid input, nothing to doraisemarv.Abort()
forsingeojson_streams:
geojson=marv.pull(s)
ifgeojsonisnotNone:
# do something with valid s
or I list all nodes explicitly:
@marv.node(Section)@marv.input('geojson_stream_a', default=geojson_node_a)@marv.input('geojson_stream_b', default=geojson_node_b)
...
@marv.input('geojson_stream_n', default=geojson_node_n)defmy_trajectory_section(geojson_streams_a, geojson_stream_b):
geojson_streams=marv.pull_all(geojson_streams_a, geojson_streams_b)
ifnotany(geojson_streams):
# no valid input, nothing to doraisemarv.Abort()
forsingeojson_streams:
geojson=marv.pull(s)
ifgeojsonisnotNone:
# do something with valid s
The first solution does not exist afaik. The second solution fails, since the my_trajectory_section fails resp. is not executed, if any of its inputs are missing.
The text was updated successfully, but these errors were encountered:
@beetleskin For the moment, the best solution seems to be the second one in combination with using bagmeta as an input and to pull the other inputs depending on which topics are listed on bagmeta, i.e. available. What do you think?
Sounds like a workaround, but how would I do that? How would I pull streams within a node depending on some condition (e.g. whether a topic is available in bagmeta), I thought one needs to declare that with the @marv.input(..) decorator ..?
Hi, I got the use-case of an aggregation node that accumulates data from nodes of a certain type. Specifically: I got several nodes producing GeoJson data. Now I want to accumulate those with a Section or Widget. For the section, at least one GeoJson is required, but in general the inputs are optional. I just want to render what's available from the bag, i.e. sometimes some topics are missing and one or another GeoJson node fails. I wonder how to model this situation correctly with Marv:
Either I collect all nodes of a certain type, e.g.:
or I list all nodes explicitly:
The first solution does not exist afaik. The second solution fails, since the my_trajectory_section fails resp. is not executed, if any of its inputs are missing.
The text was updated successfully, but these errors were encountered: