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

chore(weave): Legacy Refactor pt14 #2232

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from 17 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
191 changes: 55 additions & 136 deletions docs/docs/reference/python-sdk/weave/index.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions examples/experimental/skip_test/Confusion Matrix.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"import itertools\n",
"from PIL import Image\n",
"import weave\n",
"from weave import storage\n",
"from weave.legacy import storage\n",
"from weave import weave_internal\n",
"#weave.use_frontend_devmode()"
]
Expand Down Expand Up @@ -89,7 +89,7 @@
"id": "6583e01c",
"metadata": {},
"source": [
"## Facet is fun!"
"## Facet is fun!\n"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"import os\n",
"import cProfile\n",
"import weave\n",
"from weave import storage\n",
"from weave.legacy import storage\n",
"import random\n",
"import time\n",
"import pyarrow as pa\n",
Expand Down
4 changes: 2 additions & 2 deletions examples/experimental/skip_test/Vectorizing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"source": [
"import weave\n",
"import time\n",
"from weave import storage\n",
"from weave import geom"
"from weave.legacy import storage\n",
"from weave.legacy.ops_primitives import geom"
]
},
{
Expand Down
5 changes: 3 additions & 2 deletions examples/experimental/skip_test/branching_runs.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
"import weave\n",
"from weave.legacy.ops_primitives import ArrowWeaveList\n",
"from weave.legacy.ops_domain import RunSegment\n",
"from weave import storage, publish, type_of\n",
"from weave.weave_types import List\n",
"from weave.legacy import storage\n",
"from weave import publish, type_of\n",
"from weave.legacy.weave_types import List\n",
"import typing\n",
"import time\n",
"import sys\n",
Expand Down
2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ disallow_untyped_calls = False
disallow_untyped_defs = False
disallow_untyped_calls = False

[mypy-weave.weave_types]
[mypy-weave.legacy.weave_types]
disallow_untyped_defs = False
disallow_untyped_calls = False

Expand Down
12 changes: 6 additions & 6 deletions weave/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@

_loading_builtins_token = _context_state.set_loading_built_ins()

from . import weave_types as types
from . import storage
from weave.legacy import weave_types as types
from .legacy import storage

from .query_api import *
from .trace_api import *
from .legacy.api import *
from .trace.api import *

from .errors import *
from .legacy.errors import *

from weave.legacy import mappers_python_def

Expand Down Expand Up @@ -64,7 +64,7 @@
# Special object informing doc generation tooling which symbols
# to document & to associate with this module.
__docspec__ = [
# Re-exported from trace_api
# Re-exported from trace.api
init,
publish,
ref,
Expand Down
4 changes: 2 additions & 2 deletions weave/api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""These are the top-level functions in the `import weave` namespace."""

from .query_api import *
from .trace_api import *
from .legacy.api import *
from .trace.api import *
2 changes: 1 addition & 1 deletion weave/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def cli() -> None:
# def start_ui() -> None:
# print("Starting server...")
# try:
# from weave import server
# from weave.legacy import server
# except ModuleNotFoundError:
# print("Run 'pip install weave[engine]' to use the local server.")
# sys.exit(1)
Expand Down
2 changes: 1 addition & 1 deletion weave/client_context/weave_client.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import threading
from typing import TYPE_CHECKING, Optional

from weave.errors import WeaveInitError
from weave.legacy import context_state
from weave.legacy.errors import WeaveInitError

if TYPE_CHECKING:
from weave.trace.weave_client import WeaveClient
Expand Down
4 changes: 2 additions & 2 deletions weave/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import weave
from weave import weave_init
from weave.legacy import client as client_legacy
from weave.legacy import context_state, io_service, serialize
from weave.legacy import context_state, environment, io_service, serialize
from weave.legacy.language_features.tagging.tag_store import isolated_tagging_context
from weave.trace_server import (
clickhouse_trace_server_batched,
Expand All @@ -24,7 +24,7 @@
)
from weave.trace_server import trace_server_interface as tsi

from . import environment, logs
from .legacy import logs
from .tests import fixture_fakewandb
from .tests.trace.trace_server_clickhouse_conftest import *
from .tests.wandb_system_tests_conftest import *
Expand Down
3 changes: 2 additions & 1 deletion weave/deploy/gcp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import typing
from pathlib import Path

from weave import __version__, environment
from weave import __version__
from weave.legacy import environment
from weave.legacy.artifact_wandb import WeaveWBArtifactURI as WeaveWBArtifactURI
from weave.trace.refs import ObjectRef, parse_uri

Expand Down
2 changes: 1 addition & 1 deletion weave/deploy/modal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import typing
from pathlib import Path

from weave import environment
from weave.legacy import artifact_wandb as artifact_wandb
from weave.legacy import environment
from weave.trace.refs import ObjectRef, parse_uri

try:
Expand Down
2 changes: 1 addition & 1 deletion weave/deploy/modal/stub.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
@asgi_app(label=safe_name(uri.name))
def fastapi_app() -> FastAPI:
from weave import api
from weave.serve_fastapi import object_method_app
from weave.trace.serve_fastapi import object_method_app

uri_ref = parse_uri(os.environ["MODEL_REF"])
if not isinstance(uri_ref, ObjectRef):
Expand Down
171 changes: 0 additions & 171 deletions weave/errors.py

This file was deleted.

2 changes: 1 addition & 1 deletion weave/init_message.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import typing

from weave import urls
from weave.legacy import urls

if typing.TYPE_CHECKING:
import packaging.version # type: ignore[import-not-found]
Expand Down
4 changes: 2 additions & 2 deletions weave/legacy/_dict_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from weave.legacy import box
from weave.legacy.language_features.tagging import tag_store, tagged_value_type

from .. import errors
from .. import weave_types as types
from weave.legacy import errors
from weave.legacy import weave_types as types


def typeddict_pick_output_type(input_types):
Expand Down
Loading
Loading