Add max deps and bump old ones
All checks were successful
Publish documentation / publish (push) Successful in 51s
Check / Test on Python 3.10 (push) Successful in 1m1s
Check / Lint, format & type checks (push) Successful in 1m9s
Check / Test on Python 3.11 (push) Successful in 51s
Check / Test on Python 3.12 (push) Successful in 58s
Check / Test on Python 3.13 (push) Successful in 55s
All checks were successful
Publish documentation / publish (push) Successful in 51s
Check / Test on Python 3.10 (push) Successful in 1m1s
Check / Lint, format & type checks (push) Successful in 1m9s
Check / Test on Python 3.11 (push) Successful in 51s
Check / Test on Python 3.12 (push) Successful in 58s
Check / Test on Python 3.13 (push) Successful in 55s
This commit is contained in:
parent
2403a20ed0
commit
c55eba2077
18 changed files with 98 additions and 75 deletions
|
|
@ -6,6 +6,7 @@ from typing import (
|
|||
Callable,
|
||||
Generic,
|
||||
List,
|
||||
Literal,
|
||||
Optional,
|
||||
Sequence,
|
||||
Tuple,
|
||||
|
|
@ -17,7 +18,6 @@ from typing import (
|
|||
|
||||
from fastapi import FastAPI
|
||||
from tqdm import tqdm
|
||||
from typing_extensions import Literal # <= Python 3.7
|
||||
|
||||
from ..constants import DASHBOARD_PATH
|
||||
from ..context import get_context
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
from pathlib import Path
|
||||
|
||||
from a2wsgi import WSGIMiddleware
|
||||
from fastapi import FastAPI
|
||||
from fastapi.middleware.wsgi import WSGIMiddleware
|
||||
from fastapi.responses import FileResponse, RedirectResponse
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
|
||||
|
|
@ -19,7 +19,10 @@ def bootstrap_dashboard(app: FastAPI, function_name: str, documentation: str) ->
|
|||
def get_favicon() -> FileResponse:
|
||||
return FileResponse(PATH / "dashboard/assets/favicon.ico")
|
||||
|
||||
app.mount(DASHBOARD_PATH, WSGIMiddleware(dash_app))
|
||||
# a2wsgi types its WSGI input (Flask) and ASGI output more strictly than
|
||||
# Starlette's loose WSGIApp/ASGIApp aliases, so mypy flags the mount despite
|
||||
# this being the canonical, runtime-correct way to bridge the Dash app.
|
||||
app.mount(DASHBOARD_PATH, WSGIMiddleware(dash_app)) # type: ignore[arg-type]
|
||||
|
||||
@app.get("/", include_in_schema=False)
|
||||
def redirect_to_entrypoint() -> RedirectResponse:
|
||||
|
|
|
|||
|
|
@ -16,7 +16,8 @@ def get_description(
|
|||
style={"color": accent_color},
|
||||
),
|
||||
dcc.Markdown(
|
||||
strip_lines(f"""
|
||||
strip_lines(
|
||||
f"""
|
||||
> View the live data of your deployment here.
|
||||
|
||||
## Using the API
|
||||
|
|
@ -26,7 +27,8 @@ def get_description(
|
|||
## Details
|
||||
|
||||
{function_docs}
|
||||
"""),
|
||||
"""
|
||||
),
|
||||
className="description",
|
||||
),
|
||||
]
|
||||
|
|
|
|||
|
|
@ -7,9 +7,7 @@ from abc import ABC, abstractmethod
|
|||
from functools import lru_cache
|
||||
from pathlib import Path
|
||||
from types import TracebackType
|
||||
from typing import IO, Any, List, Optional, Type, Union, cast
|
||||
|
||||
from typing_extensions import Literal # <= Python 3.7
|
||||
from typing import IO, Any, List, Literal, Optional, Type, Union, cast
|
||||
|
||||
from great_ai.utilities import ConfigFile, get_logger
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,19 @@
|
|||
from functools import wraps
|
||||
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, TypeVar, Union, cast
|
||||
from typing import (
|
||||
Any,
|
||||
Callable,
|
||||
Dict,
|
||||
List,
|
||||
Literal,
|
||||
Optional,
|
||||
Set,
|
||||
Tuple,
|
||||
TypeVar,
|
||||
Union,
|
||||
cast,
|
||||
)
|
||||
|
||||
from dill import load
|
||||
from typing_extensions import Literal # <= Python 3.7
|
||||
|
||||
from ..context import get_context
|
||||
from ..helper import get_function_metadata_store
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
from datetime import datetime
|
||||
from datetime import datetime, timezone
|
||||
from math import ceil
|
||||
from random import shuffle
|
||||
from typing import Any, Iterable, List, TypeVar, Union, cast
|
||||
|
|
@ -94,7 +94,7 @@ def add_ground_truth(
|
|||
)
|
||||
shuffle(split_tags)
|
||||
|
||||
created = datetime.utcnow().isoformat()
|
||||
created = datetime.now(timezone.utc).replace(tzinfo=None).isoformat()
|
||||
traces = [
|
||||
cast(
|
||||
Trace[T],
|
||||
|
|
|
|||
|
|
@ -1,12 +1,10 @@
|
|||
from contextvars import ContextVar
|
||||
from datetime import datetime
|
||||
from datetime import datetime, timezone
|
||||
from time import perf_counter
|
||||
from types import TracebackType
|
||||
from typing import Any, Dict, Generic, List, Optional, Type, TypeVar, cast
|
||||
from typing import Any, Dict, Generic, List, Literal, Optional, Type, TypeVar, cast
|
||||
from uuid import uuid4
|
||||
|
||||
from typing_extensions import Literal # <= Python 3.7
|
||||
|
||||
from ..constants import DEVELOPMENT_TAG_NAME, ONLINE_TAG_NAME, PRODUCTION_TAG_NAME
|
||||
from ..context import get_context
|
||||
from ..views import Model, Trace
|
||||
|
|
@ -25,7 +23,7 @@ class TracingContext(Generic[T]):
|
|||
self._models: List[Model] = []
|
||||
self._values: Dict[str, Any] = {}
|
||||
self._trace: Optional[Trace[T]] = None
|
||||
self._start_datetime = datetime.utcnow()
|
||||
self._start_datetime = datetime.now(timezone.utc).replace(tzinfo=None)
|
||||
self._start_time = perf_counter()
|
||||
self._name = function_name
|
||||
|
||||
|
|
|
|||
|
|
@ -94,9 +94,11 @@ class ConfigFile(Mapping[str, str]):
|
|||
try:
|
||||
value = next(v for v in values if v)
|
||||
except StopIteration:
|
||||
raise ParseError(f"""Cannot parse config file ({
|
||||
raise ParseError(
|
||||
f"""Cannot parse config file ({
|
||||
self._path.absolute()
|
||||
}), error at key `{key}`""")
|
||||
}), error at key `{key}`"""
|
||||
)
|
||||
|
||||
already_exists = key in self._key_values
|
||||
if already_exists and not value.startswith(
|
||||
|
|
|
|||
|
|
@ -39,9 +39,11 @@ def manage_communication(
|
|||
is_iteration_over = True
|
||||
except Exception as e:
|
||||
if ignore_exceptions:
|
||||
logger.error(f"""Exception {e} encountered in input, traceback:\n{
|
||||
logger.error(
|
||||
f"""Exception {e} encountered in input, traceback:\n{
|
||||
traceback.format_exc()
|
||||
}""")
|
||||
}"""
|
||||
)
|
||||
else:
|
||||
raise
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ from typing import (
|
|||
Awaitable,
|
||||
Callable,
|
||||
Iterable,
|
||||
Literal,
|
||||
Optional,
|
||||
Sequence,
|
||||
TypeVar,
|
||||
|
|
@ -11,7 +12,6 @@ from typing import (
|
|||
)
|
||||
|
||||
import dill
|
||||
from typing_extensions import Literal # <= Python 3.7
|
||||
|
||||
from .get_config import get_config
|
||||
from .manage_communication import manage_communication
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ from typing import (
|
|||
Awaitable,
|
||||
Callable,
|
||||
Iterable,
|
||||
Literal,
|
||||
Optional,
|
||||
Sequence,
|
||||
TypeVar,
|
||||
|
|
@ -11,8 +12,6 @@ from typing import (
|
|||
overload,
|
||||
)
|
||||
|
||||
from typing_extensions import Literal # <= Python 3.7
|
||||
|
||||
from .get_config import get_config
|
||||
from .manage_communication import manage_communication
|
||||
from .mapper_function import mapper_function
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
from typing import List
|
||||
|
||||
from typing_extensions import Literal # <= Python 3.7
|
||||
from typing import List, Literal
|
||||
|
||||
Operator = Literal[">=", "<=", "<", ">", "!=", "=", "contains"]
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
from typing import Any, List, Optional
|
||||
|
||||
from typing_extensions import Literal # <= Python 3.7
|
||||
from typing import Any, List, Literal, Optional
|
||||
|
||||
from ..hashable_base_model import HashableBaseModel
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
from typing import Literal
|
||||
|
||||
from pydantic import BaseModel
|
||||
from typing_extensions import Literal # <= Python 3.7
|
||||
|
||||
|
||||
class SortBy(BaseModel):
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ from .model import Model
|
|||
T = TypeVar("T")
|
||||
|
||||
|
||||
class Trace(Generic[T], HashableBaseModel):
|
||||
class Trace(HashableBaseModel, Generic[T]):
|
||||
"""Universal structure for storing prediction traces and training data.
|
||||
|
||||
Attributes:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue