Skip to content
Snippets Groups Projects
Commit 9737f6f0 authored by Martin Lange's avatar Martin Lange
Browse files

fix component time getter to allow no time before connect phase

parent b25905e1
No related branches found
No related tags found
1 merge request!206Handle different start and end times of components
......@@ -11,9 +11,9 @@ Composition
"""
import logging
import sys
from time import strftime
from datetime import datetime
from pathlib import Path
from time import strftime
from .errors import (
FinamCircularCouplingError,
......
"""
Abstract base implementations for components with and without time step.
"""
import datetime
import collections
import datetime
import logging
from abc import ABC
from datetime import datetime
......@@ -440,7 +440,8 @@ class TimeComponent(ITimeComponent, Component, ABC):
if self._time is None and self.status in (
ComponentStatus.CREATED or ComponentStatus.INITIALIZED
):
"""A time of None is ok before the connect phase"""
return None
if not isinstance(self._time, datetime):
with ErrorLogger(self.logger):
raise ValueError("Time must be of type datetime")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment