connectordb/query/dataset.py
def addStream(self, stream, interpolator="closest", t1=None, t2=None, dt=None, limit=None, i1=None, i2=None, transform=None,colname=None):
        """Adds the given stream to the query construction. Additionally, you can choose the interpolator to use for this stream, as well as a special name
        for the column in the returned dataset. If no column name is given, the full stream path will be used.

        addStream also supports Merge queries. You can insert a merge query instead of a stream, but be sure to name the column::

            d = Dataset(cdb, t1=time.time()-1000,t2=time.time(),dt=10.)
            d.addStream("temperature","average")
            d.addStream("steps","sum")

            m = Merge(cdb)
            m.addStream("mystream")
            m.addStream("mystream2")
            d.addStream(m,colname="mycolumn")

            result = d.run()
        """

        streamquery = query_maker(t1, t2, limit, i1, i2, transform)
        param_stream(self.cdb, streamquery, stream)

        streamquery["interpolator"] = interpolator

        if colname is None:
            # What do we call this column?
            if isinstance(stream, six.string_types):
                colname = stream
            elif isinstance(stream, Stream):
                colname = stream.path
            else:
                raise Exception(
                    "Could not find a name for the column! use the 'colname' parameter.")

        if colname in self.query["dataset"] or colname is "x":
            raise Exception(
                "The column name either exists, or is labeled 'x'. Use the colname parameter to change the column name.")

        self.query["dataset"][colname] = streamquery
def addStream(self, stream, interpolator="closest", t1=None, t2=None, dt=None, limit=None, i1=None, i2=None, transform=None,colname=None):
        """Adds the given stream to the query construction. Additionally, you can choose the interpolator to use for this stream, as well as a special name
        for the column in the returned dataset. If no column name is given, the full stream path will be used.

        addStream also supports Merge queries. You can insert a merge query instead of a stream, but be sure to name the column::

            d = Dataset(cdb, t1=time.time()-1000,t2=time.time(),dt=10.)
            d.addStream("temperature","average")
            d.addStream("steps","sum")

            m = Merge(cdb)
            m.addStream("mystream")
            m.addStream("mystream2")
            d.addStream(m,colname="mycolumn")

            result = d.run()
        """

        streamquery = query_maker(t1, t2, limit, i1, i2, transform)
        param_stream(self.cdb, streamquery, stream)

        streamquery["interpolator"] = interpolator

        if colname is None:
            # What do we call this column?
            if isinstance(stream, six.string_types):
                colname = stream
            elif isinstance(stream, Stream):
                colname = stream.path
            else:
                raise Exception(
                    "Could not find a name for the column! use the 'colname' parameter.")

        if colname in self.query["dataset"] or colname is "x":
            raise Exception(
                "The column name either exists, or is labeled 'x'. Use the colname parameter to change the column name.")

        self.query["dataset"][colname] = streamquery
Adds the given stream to the query construction. Additionally, you can choose the interpolator to use for this stream, as well as a special name
        for the column in the returned dataset. If no column name is given, the full stream path will be used.

        addStream also supports Merge queries. You can insert a merge query instead of a stream, but be sure to name the column::

            d = Dataset(cdb, t1=time.time()-1000,t2=time.time(),dt=10.)
            d.addStream("temperature","average")
            d.addStream("steps","sum")

            m = Merge(cdb)
            m.addStream("mystream")
            m.addStream("mystream2")
            d.addStream(m,colname="mycolumn")

            result = d.run()