Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ repos:
- id: pyupgrade
args: [--py311-plus]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.6
rev: v0.15.12
hooks:
- id: ruff
- id: ruff-check
args: [--fix]
- id: ruff-format
2 changes: 1 addition & 1 deletion mostlyai/sdk/_data/auto_detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import time

import pandas as pd

from mostlyai.engine._common import safe_convert_datetime

from mostlyai.sdk._data.base import DataTable
from mostlyai.sdk._data.dtype import VirtualDType, VirtualInteger, VirtualVarchar
from mostlyai.sdk._data.util.common import absorb_errors, run_with_timeout_unsafe
Expand Down
10 changes: 5 additions & 5 deletions mostlyai/sdk/_data/non_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,11 @@
from copy import deepcopy
from pathlib import Path

import mostlyai.engine as engine
import numpy as np
import pandas as pd
import torch
import torch.nn.functional as F
from pathvalidate import sanitize_filename
from torch import nn
from torch.utils.data import DataLoader, TensorDataset, random_split

import mostlyai.engine as engine
from mostlyai.engine._common import read_json, write_json
from mostlyai.engine._encoding_types.tabular.categorical import (
analyze_categorical,
Expand All @@ -49,6 +45,10 @@
from mostlyai.engine._encoding_types.tabular.datetime import analyze_datetime, analyze_reduce_datetime, encode_datetime
from mostlyai.engine._encoding_types.tabular.numeric import analyze_numeric, analyze_reduce_numeric, encode_numeric
from mostlyai.engine.domain import ModelEncodingType
from pathvalidate import sanitize_filename
from torch import nn
from torch.utils.data import DataLoader, TensorDataset, random_split

from mostlyai.sdk._data.base import DataIdentifier, DataTable, NonContextRelation, Schema
from mostlyai.sdk._data.util.common import IS_NULL, NON_CONTEXT_COLUMN_INFIX

Expand Down
4 changes: 3 additions & 1 deletion mostlyai/sdk/_local/execution/step_analyze_training_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from pathlib import Path

from mostlyai.engine.domain import DifferentialPrivacyConfig

from mostlyai.sdk.domain import Generator, ModelEncodingType, ModelType, SourceColumnValueRange


Expand All @@ -30,9 +31,10 @@ def execute_step_analyze_training_data(
update_progress: Callable,
) -> tuple[dict[str, ModelEncodingType], dict[str, SourceColumnValueRange]]:
# import ENGINE here to avoid pre-mature loading of large ENGINE dependencies
from mostlyai import engine
from mostlyai.engine._workspace import Workspace

from mostlyai import engine

# fetch model_config
tgt_table = next(t for t in generator.tables if t.name == target_table_name)
if model_type == ModelType.language:
Expand Down
2 changes: 1 addition & 1 deletion mostlyai/sdk/_local/execution/step_create_model_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
import pandas as pd
import pyarrow as pa
import pyarrow.parquet as papqt
from mostlyai.engine._workspace import Workspace

from mostlyai import qa
from mostlyai.engine._workspace import Workspace
from mostlyai.sdk._data.util.common import TABLE_COLUMN_INFIX, TEMPORARY_PRIMARY_KEY, strip_column_prefix
from mostlyai.sdk._local.execution.step_generate_model_report_data import qa_sample_size_heuristic
from mostlyai.sdk._local.storage import get_model_label
Expand Down
2 changes: 1 addition & 1 deletion mostlyai/sdk/_local/execution/step_finalize_training.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
import traceback
from pathlib import Path

import mostlyai.engine as engine
import pandas as pd

import mostlyai.engine as engine
from mostlyai.sdk._data.base import NonContextRelation, Schema
from mostlyai.sdk._data.non_context import (
CHILDREN_COUNT_COLUMN_NAME,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ def execute_step_generate_model_report_data(
update_progress: Callable,
):
# import ENGINE here to avoid pre-mature loading of large ENGINE dependencies
from mostlyai import engine
from mostlyai.engine._workspace import Workspace

from mostlyai import engine

# determine max sample size for generated report samples
workspace = Workspace(workspace_dir)
tgt_stats = workspace.tgt_stats.read()
Expand Down
3 changes: 2 additions & 1 deletion mostlyai/sdk/_local/execution/step_train_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ def execute_step_train_model(
upload_model_data_callback: Callable | None,
):
# import ENGINE here to avoid pre-mature loading of large ENGINE dependencies
from mostlyai import engine
from mostlyai.engine.domain import DifferentialPrivacyConfig, ModelStateStrategy

from mostlyai import engine

_LOG.info(f"mostlyai-engine: {engine.__version__}")

# fetch model_config
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ dependencies = [
local = [
# "mostlyai-engine @ git+https://github.com/mostly-ai/mostlyai-engine.git@main", # for development
# "mostlyai-qa @ git+https://github.com/mostly-ai/mostlyai-qa.git@main", # for development
"mostlyai-engine==2.6.0", # for release (PyPI)
"mostlyai-qa==1.10.5", # for release (PyPI)
"mostlyai-engine==2.6.1", # for release (PyPI)
"mostlyai-qa==1.10.6", # for release (PyPI)
"fastapi>=0.116.0",
"uvicorn>=0.34.0",
"python-multipart>=0.0.20",
Expand All @@ -75,8 +75,8 @@ local = [
local-gpu = [
# "mostlyai-engine[gpu] @ git+https://github.com/mostly-ai/mostlyai-engine.git@main", # for development
# "mostlyai-qa @ git+https://github.com/mostly-ai/mostlyai-qa.git@main", # for development
"mostlyai-engine[gpu]==2.6.0", # for release (PyPI)
"mostlyai-qa==1.10.5", # for release (PyPI)
"mostlyai-engine[gpu]==2.6.1", # for release (PyPI)
"mostlyai-qa==1.10.6", # for release (PyPI)
"fastapi>=0.116.0",
"uvicorn>=0.34.0",
"python-multipart>=0.0.20",
Expand Down Expand Up @@ -121,7 +121,7 @@ snowflake = [
[dependency-groups]
dev = [
"pytest>=8.0",
"ruff>=0.11", # sync'ed with .pre-commit-config
"ruff>=0.15.12", # sync'ed with .pre-commit-config (ruff-pre-commit rev)
"pre-commit>=4.0",
"twine>=6.1",
"ipykernel>=6.25",
Expand Down
2 changes: 1 addition & 1 deletion tests/_local/unit/test_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# limitations under the License.

import pytest

from mostlyai.engine._workspace import Workspace

from mostlyai.sdk._local.execution.migration import migrate_workspace


Expand Down
Loading