def test_single_interval_value(): expected_result = """{ "interval": "2019-01-01T00:00:00Z/2019-01-02T00:00:00Z", "boolean": true }""" start = dt.datetime(2019, 1, 1, tzinfo=dt.timezone.utc) end = dt.datetime(2019, 1, 2, tzinfo=dt.timezone.utc) prop = IntervalValue(start=start, end=end, value=True) assert repr(prop) == expected_result
def test_multiple_interval_value(): expected_result = """[ { "interval": "2019-01-01T00:00:00Z/2019-01-02T00:00:00Z", "boolean": true }, { "interval": "2019-01-02T00:00:00Z/2019-01-03T00:00:00Z", "boolean": false } ]""" start0 = dt.datetime(2019, 1, 1, tzinfo=dt.timezone.utc) end0 = start1 = dt.datetime(2019, 1, 2, tzinfo=dt.timezone.utc) end1 = dt.datetime(2019, 1, 3, tzinfo=dt.timezone.utc) prop = Sequence([ IntervalValue(start=start0, end=end0, value=True), IntervalValue(start=start1, end=end1, value=False), ]) assert repr(prop) == expected_result
def _init_czml_(self): """ Only called at the initialization of the extractor Builds packets. """ pckt = Preamble( name="document_packet", clock=IntervalValue( start=self.start_epoch.value, end=self.end_epoch.value, value=Clock(currentTime=self.start_epoch.value, multiplier=60), ), ) self.packets.append(pckt)
Path, Position, SolidColorMaterial, ) from czml3.types import IntervalValue, Sequence, TimeInterval accesses_id = "9927edc4-e87a-4e1f-9b8b-0bfb3b05b227" start = dt.datetime(2012, 3, 15, 10, tzinfo=dt.timezone.utc) end = dt.datetime(2012, 3, 16, 10, tzinfo=dt.timezone.utc) simple = Document( [ Preamble( name="simple", clock=IntervalValue( start=start, end=end, value=Clock(currentTime=start, multiplier=60) ), ), Packet(id=accesses_id, name="Accesses", description="List of Accesses"), Packet( id="Satellite/Geoeye1-to-Satellite/ISS", name="Geoeye1 to ISS", parent=accesses_id, availability=Sequence( [ TimeInterval( start="2012-03-15T10:16:06.97400000000198Z", end="2012-03-15T10:33:59.3549999999959Z", ), TimeInterval( start="2012-03-15T11:04:09.73799999999756Z",