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

read/write repository regression tests #481

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 13 commits
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
131 changes: 131 additions & 0 deletions tests/fixtures.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import datetime
import os
import random
import uuid
Expand Down Expand Up @@ -562,3 +563,133 @@ def make_classification_dask_df(make_classification_df):
X_df, y_da = dd.from_pandas(X, npartitions=1), da.from_array(y)

return X_df, y_da


@pytest.fixture
def project_json():
"""JSON representation of a project."""
return {
"name": "test project",
"created_at": datetime.datetime(2024, 1, 1),
"description": "test project description",
"github_url": "github.com",
"id": "ccf6b8f8-a166-4084-a51f-4f2b6afd2ad9",
"training_metadata": [["training", "metadata"]],
}


@pytest.fixture
def experiment_json():
"""JSON representation of an experiment."""
return {
"project_name": "test project",
"branch_name": "test-branch",
"comments": ["comment a", "comment b"],
"commit_hash": "abcde01",
"created_at": datetime.datetime(2024, 1, 1),
"description": "test experiment description",
"id": "69e374cd-220b-4cda-9608-52277b38a976",
"model_name": "test model",
"name": "test experiment",
"tags": ["tag_a", "tag_b"],
"training_metadata": [["training", "metadata"]],
}


@pytest.fixture
def feature_json():
"""JSON representation of a feature."""
return {
"name": "test feature",
"comments": ["comment a", "comment b"],
"created_at": datetime.datetime(2024, 1, 1),
"description": "test feature description",
"id": str(uuid.uuid4()),
"importance": 1.0,
"tags": ["tag_a", "tag_b"],
}


@pytest.fixture
def metric_json():
"""JSON representation of a metric."""
return {
"name": "test metric",
"value": 1.0,
"comments": ["comment a", "comment b"],
"created_at": datetime.datetime(2024, 1, 1),
"description": "test metric description",
"directionality": "score",
"id": str(uuid.uuid4()),
"tags": ["tag_a", "tag_b"],
}


@pytest.fixture
def parameter_json():
"""JSON representation of a parameter."""
return {
"name": "test parameter",
"value": 1.0,
"comments": ["comment a", "comment b"],
"created_at": datetime.datetime(2024, 1, 1),
"description": "test parameter description",
"id": str(uuid.uuid4()),
"tags": ["tag_a", "tag_b"],
}


@pytest.fixture
def artifact_project_json():
"""JSON representation of an artifact belonging to a project."""
return {
"name": "test artifact",
"comments": ["comment a", "comment b"],
"created_at": datetime.datetime(2024, 1, 1),
"description": "test parameter description",
"id": str(uuid.uuid4()),
"parent_id": "ccf6b8f8-a166-4084-a51f-4f2b6afd2ad9",
"tags": ["tag_a", "tag_b"],
}


@pytest.fixture
def artifact_experiment_json():
"""JSON representation of an artifact belonging to an experiment."""
return {
"name": "test artifact",
"comments": ["comment a", "comment b"],
"created_at": datetime.datetime(2024, 1, 1),
"description": "test parameter description",
"id": str(uuid.uuid4()),
"parent_id": "69e374cd-220b-4cda-9608-52277b38a976",
"tags": ["tag_a", "tag_b"],
}


@pytest.fixture
def dataframe_project_json():
"""JSON representation of a dataframe belonging to a project."""
return {
"comments": ["comment a", "comment b"],
"created_at": datetime.datetime(2024, 1, 1),
"description": "test parameter description",
"id": str(uuid.uuid4()),
"name": "test dataframe",
"parent_id": "ccf6b8f8-a166-4084-a51f-4f2b6afd2ad9",
"tags": ["tag_a", "tag_b"],
}


@pytest.fixture
def dataframe_experiment_json():
"""JSON representation of a dataframe belonging to an experiment."""
return {
"comments": ["comment a", "comment b"],
"created_at": datetime.datetime(2024, 1, 1),
"description": "test parameter description",
"id": str(uuid.uuid4()),
"name": "test dataframe",
"parent_id": "69e374cd-220b-4cda-9608-52277b38a976",
"tags": ["tag_a", "tag_b"],
}
Loading
Loading