Ejemplo n.º 1
0
    FACULTY_EXPERIMENT,
    FACULTY_METRIC,
    FACULTY_PARAM,
    FACULTY_RUN,
    FACULTY_TAG,
    MLFLOW_METRIC,
    MLFLOW_PARAM,
    MLFLOW_TAG,
    PARENT_RUN_UUID,
    PARENT_RUN_UUID_HEX_STR,
    mlflow_experiment,
    mlflow_run,
)

DATETIME = datetime(2018, 3, 10, 11, 45, 32, 110000, tzinfo=UTC)
DATETIME_MILLISECONDS = to_timestamp(DATETIME) * 1000


def experiment_equals(first, other):
    return (
        first.experiment_id == other.experiment_id
        and first.name == other.name
        and first.artifact_location == other.artifact_location
        and first.lifecycle_stage == other.lifecycle_stage
    )


def mlflow_object_equals(first, other):
    # mlflow objects return their properties as (key, value) when iterated over
    return all(x == y for x, y in zip(first, other))
Ejemplo n.º 2
0
    RunData,
    RunInfo,
)
from mlflow.utils.mlflow_tags import MLFLOW_RUN_NAME, MLFLOW_PARENT_RUN_ID
from pytz import UTC

from mlflow_faculty.py23 import to_timestamp

PROJECT_ID = uuid4()
EXPERIMENT_ID = 12

NAME = "experiment name"
ARTIFACT_LOCATION = "scheme://artifact-location"

METRIC_TIMESTAMP = datetime(2019, 3, 13, 17, 0, 15, tzinfo=UTC)
METRIC_TIMESTAMP_MILLISECONDS = to_timestamp(METRIC_TIMESTAMP) * 1000
FACULTY_METRIC = FacultyMetric(key="metric-key",
                               value="metric-value",
                               timestamp=METRIC_TIMESTAMP,
                               step=0)
MLFLOW_METRIC = Metric("metric-key", "metric-value",
                       METRIC_TIMESTAMP_MILLISECONDS, 0)

FACULTY_PARAM = FacultyParam(key="param-key", value="param-value")
MLFLOW_PARAM = Param("param-key", "param-value")

FACULTY_TAG = FacultyTag(key="tag-key", value="tag-value")
MLFLOW_TAG = RunTag("tag-key", "tag-value")

FACULTY_EXPERIMENT = FacultyExperiment(
    id=EXPERIMENT_ID,
Ejemplo n.º 3
0
def _datetime_to_mlflow_timestamp(dt):
    return int(to_timestamp(dt) * 1000)
Ejemplo n.º 4
0
def test_to_timestamp(dt, expected_timestamp):
    assert to_timestamp(dt) == expected_timestamp