Skip to content

Commit

Permalink
Run code formatters.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandervsokol committed Sep 26, 2024
1 parent c5c2a88 commit 506c3a3
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 15 deletions.
7 changes: 4 additions & 3 deletions cl/runtime/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import os
import traceback
import uuid
from datetime import datetime, timezone

from datetime import datetime
from datetime import timezone
import uvicorn
from fastapi import FastAPI
from starlette.middleware.cors import CORSMiddleware
Expand Down Expand Up @@ -62,7 +63,7 @@ async def handle_exception(request, exc, log_level):
id=str(uuid.uuid4()),
message=str(exc),
level=log_level,
timestamp=DatetimeUtil.to_iso_int(DatetimeUtil.now())
timestamp=DatetimeUtil.to_iso_int(DatetimeUtil.now()),
)
Context.current().save_one(entry)

Expand Down
6 changes: 3 additions & 3 deletions cl/runtime/log/exceptions/user_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
class UserError(Exception):
"""Custom exception for user-related errors."""

def __init__(self, message='A user error occurred', username=None):
def __init__(self, message="A user error occurred", username=None):
super().__init__(message)
self.username = username

def __str__(self):
message = f'UserError: {self.args[0]}'
message = f"UserError: {self.args[0]}"
if self.username:
message += f' (User: {self.username})'
message += f" (User: {self.username})"
return message
1 change: 0 additions & 1 deletion cl/runtime/log/log_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# limitations under the License.

from dataclasses import dataclass

from cl.runtime import RecordMixin
from cl.runtime.log.log_entry_key import LogEntryKey
from cl.runtime.log.log_entry_level_enum import LogEntryLevelEnum
Expand Down
1 change: 0 additions & 1 deletion cl/runtime/log/log_entry_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

from dataclasses import dataclass
from typing import Type

from cl.runtime.records.dataclasses_extensions import missing
from cl.runtime.records.key_mixin import KeyMixin

Expand Down
1 change: 0 additions & 1 deletion cl/runtime/routers/entity/panel_response_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from typing import Any
from typing import Dict
from typing import List

from matplotlib.figure import Figure
from pydantic import BaseModel
from cl.runtime.context.context import Context
Expand Down
3 changes: 1 addition & 2 deletions cl/runtime/schema/handler_declare_block_decl.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ def get_type_methods(cls, record_type: type, inherit: bool = False) -> "HandlerD
# It does not matter if it is a classmethod or staticmethod from UI perspective
# (they are both considered static)
isinstance(inspect.getattr_static(record_type, member_name), staticmethod)
or
isinstance(inspect.getattr_static(record_type, member_name), classmethod)
or isinstance(inspect.getattr_static(record_type, member_name), classmethod)
)

# TODO: Add labels support
Expand Down
5 changes: 2 additions & 3 deletions stubs/cl/runtime/views/stub_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@

from dataclasses import dataclass
from pathlib import Path

import pandas as pd

from cl.runtime import RecordMixin, viewer
from cl.runtime import RecordMixin
from cl.runtime import viewer
from cl.runtime.backend.core.ui_app_state import UiAppState
from cl.runtime.plots.confusion_matrix_plot import ConfusionMatrixPlot
from cl.runtime.plots.confusion_matrix_plot_style import ConfusionMatrixPlotStyle
Expand Down
1 change: 0 additions & 1 deletion stubs/cl/runtime/views/stub_plots_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

from dataclasses import dataclass
from typing import Type

from cl.runtime.records.dataclasses_extensions import field
from cl.runtime.records.key_mixin import KeyMixin

Expand Down

0 comments on commit 506c3a3

Please sign in to comment.