Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CTX-4396: Made it so that in case of "interval" x type of a metric, t… #65

Merged
merged 2 commits into from
Sep 19, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions coretex/coretex/experiment/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

from .artifact import Artifact
from .status import ExperimentStatus
from .metrics import Metric
from .metrics import Metric, MetricType
from .parameter import validateParameters, parameter_factory
from .execution_type import ExecutionType
from ..dataset import Dataset, LocalDataset, NetworkDataset
Expand Down Expand Up @@ -306,12 +306,21 @@ def submitMetrics(self, metricValues: Dict[str, Tuple[float, float]]) -> bool:
True
"""

metrics = [{
"timestamp": time.time(),
"metric": key,
"x": value[0],
"y": value[1]
} for key, value in metricValues.items()]
metrics : List[Dict[str, Any]] = []

timestamp = time.time()

for key, value in metricValues.items():
for metric in self.metrics:
if metric.name == key and metric.xType == MetricType.interval.name:
dule1322 marked this conversation as resolved.
Show resolved Hide resolved
timestamp = value[0]

metrics.append({
"timestamp": timestamp,
"metric": key,
"x": value[0],
"y": value[1]
})

parameters: Dict[str, Any] = {
"experiment_id": self.id,
Expand Down