From 6b7cc9366bbfaef52ddd3f36eeaedfb889d7f20c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Ba=CC=88uerle?= Date: Sat, 2 Nov 2024 11:01:49 -0700 Subject: [PATCH] refactor: update smui imports --- backend/pyproject.toml | 4 ++-- backend/zeno_backend/classes/amplitude.py | 1 + backend/zeno_backend/classes/base.py | 1 + backend/zeno_backend/classes/chart.py | 1 + backend/zeno_backend/classes/filter.py | 1 + backend/zeno_backend/classes/folder.py | 1 + backend/zeno_backend/classes/metadata.py | 1 + backend/zeno_backend/classes/metric.py | 1 + backend/zeno_backend/classes/report.py | 1 + backend/zeno_backend/classes/slice_finder.py | 1 + backend/zeno_backend/database/copy.py | 1 + backend/zeno_backend/database/database.py | 1 + backend/zeno_backend/database/delete.py | 1 + backend/zeno_backend/database/insert.py | 1 + backend/zeno_backend/database/select.py | 1 + backend/zeno_backend/database/update.py | 1 + backend/zeno_backend/database/util.py | 1 + backend/zeno_backend/processing/chart.py | 1 + backend/zeno_backend/processing/filtering.py | 1 + backend/zeno_backend/processing/metrics/mean.py | 1 + backend/zeno_backend/processing/slice_finder.py | 1 + backend/zeno_backend/routers/account.py | 1 + backend/zeno_backend/routers/chart.py | 1 + backend/zeno_backend/routers/metadata.py | 1 + backend/zeno_backend/routers/project.py | 1 + backend/zeno_backend/routers/report.py | 1 + backend/zeno_backend/routers/sdk.py | 1 + backend/zeno_backend/routers/slice.py | 1 + backend/zeno_backend/routers/table.py | 1 + backend/zeno_backend/routers/tag.py | 1 + backend/zeno_backend/server.py | 1 + backend/zeno_backend/util.py | 1 + .../encoding/chart-encoding/BeeswarmEncoding.svelte | 2 +- .../src/lib/components/metadata/cells/FolderCell.svelte | 2 +- frontend/src/lib/components/popups/Confirm.svelte | 2 +- frontend/src/lib/components/popups/CopyProjectPopup.svelte | 4 ++-- .../src/lib/components/popups/FeatureFlagsPopup.svelte | 4 ++-- frontend/src/lib/components/popups/NewReportPopup.svelte | 2 +- .../src/lib/components/popups/OrganizationPopup.svelte | 7 +++---- frontend/src/lib/components/popups/ProjectPopup.svelte | 7 +++---- frontend/src/lib/components/popups/ReportPopup.svelte | 7 +++---- frontend/src/lib/components/settings/Account.svelte | 2 +- .../src/lib/components/settings/OrganizationsTable.svelte | 2 +- frontend/src/lib/instance-views/InstanceView.svelte | 2 +- frontend/src/routes/(user)/forgot/+page.svelte | 2 +- frontend/src/routes/(user)/forgot/[username]/+page.svelte | 2 +- frontend/src/routes/(user)/login/+page.svelte | 2 +- frontend/src/routes/(user)/signup/+page.svelte | 4 ++-- frontend/src/routes/(user)/verify/[username]/+page.svelte | 2 +- frontend/src/routes/auth/+page.svelte | 2 +- frontend/src/routes/playground/+page.svelte | 2 +- 51 files changed, 61 insertions(+), 33 deletions(-) diff --git a/backend/pyproject.toml b/backend/pyproject.toml index 96ffd918..c944acd3 100644 --- a/backend/pyproject.toml +++ b/backend/pyproject.toml @@ -40,8 +40,8 @@ backend = "zeno_backend.server:serve" [tool.pyright] include = ["zeno_backend"] -[tool.ruff] +[tool.ruff.lint] select = ["E", "F", "I", "PD", "N", "D", "T20"] -[tool.ruff.pydocstyle] +[tool.ruff.lint.pydocstyle] convention = "google" diff --git a/backend/zeno_backend/classes/amplitude.py b/backend/zeno_backend/classes/amplitude.py index 24d451e5..0013ecdd 100644 --- a/backend/zeno_backend/classes/amplitude.py +++ b/backend/zeno_backend/classes/amplitude.py @@ -1,4 +1,5 @@ """Amplitude handler for tracking after env has been set up with a singleton object.""" + import os from amplitude import Amplitude, BaseEvent diff --git a/backend/zeno_backend/classes/base.py b/backend/zeno_backend/classes/base.py index 9666ed53..68ab5388 100644 --- a/backend/zeno_backend/classes/base.py +++ b/backend/zeno_backend/classes/base.py @@ -1,4 +1,5 @@ """Base types used in Zeno's backend.""" + from enum import Enum from pydantic import BaseModel, ConfigDict diff --git a/backend/zeno_backend/classes/chart.py b/backend/zeno_backend/classes/chart.py index 3e8180e6..d058e637 100644 --- a/backend/zeno_backend/classes/chart.py +++ b/backend/zeno_backend/classes/chart.py @@ -1,4 +1,5 @@ """Type representations for chart data.""" + import json from enum import Enum diff --git a/backend/zeno_backend/classes/filter.py b/backend/zeno_backend/classes/filter.py index 752b7036..168d297d 100644 --- a/backend/zeno_backend/classes/filter.py +++ b/backend/zeno_backend/classes/filter.py @@ -1,4 +1,5 @@ """Classes required for specifying data filters.""" + import json from enum import Enum from typing import LiteralString diff --git a/backend/zeno_backend/classes/folder.py b/backend/zeno_backend/classes/folder.py index 1cf2a87b..2f420926 100644 --- a/backend/zeno_backend/classes/folder.py +++ b/backend/zeno_backend/classes/folder.py @@ -1,4 +1,5 @@ """Type representation for folder data.""" + from zeno_backend.classes.base import CamelModel diff --git a/backend/zeno_backend/classes/metadata.py b/backend/zeno_backend/classes/metadata.py index 8cdd3bfa..ca38b91b 100644 --- a/backend/zeno_backend/classes/metadata.py +++ b/backend/zeno_backend/classes/metadata.py @@ -1,4 +1,5 @@ """Type representations for metric data.""" + from zeno_backend.classes.base import CamelModel, ZenoColumn from zeno_backend.classes.filter import Operation from zeno_backend.classes.metric import Metric diff --git a/backend/zeno_backend/classes/metric.py b/backend/zeno_backend/classes/metric.py index 3e32e00b..45a48db8 100644 --- a/backend/zeno_backend/classes/metric.py +++ b/backend/zeno_backend/classes/metric.py @@ -1,4 +1,5 @@ """Type representations for metric data.""" + from zeno_backend.classes.base import CamelModel from zeno_backend.classes.slice import Slice diff --git a/backend/zeno_backend/classes/report.py b/backend/zeno_backend/classes/report.py index 9236faf1..2236b641 100644 --- a/backend/zeno_backend/classes/report.py +++ b/backend/zeno_backend/classes/report.py @@ -1,4 +1,5 @@ """Types for Zeno reports.""" + from enum import Enum from zeno_backend.classes.base import CamelModel diff --git a/backend/zeno_backend/classes/slice_finder.py b/backend/zeno_backend/classes/slice_finder.py index 3f84b4d9..132a05e2 100644 --- a/backend/zeno_backend/classes/slice_finder.py +++ b/backend/zeno_backend/classes/slice_finder.py @@ -1,4 +1,5 @@ """Type representations for slice finder data.""" + from typing import Any from zeno_backend.classes.base import CamelModel, ZenoColumn diff --git a/backend/zeno_backend/database/copy.py b/backend/zeno_backend/database/copy.py index aa5389f3..f22fa9ba 100644 --- a/backend/zeno_backend/database/copy.py +++ b/backend/zeno_backend/database/copy.py @@ -1,4 +1,5 @@ """Functionality for copying instances in the database.""" + import json import uuid diff --git a/backend/zeno_backend/database/database.py b/backend/zeno_backend/database/database.py index fb4e0729..47333500 100644 --- a/backend/zeno_backend/database/database.py +++ b/backend/zeno_backend/database/database.py @@ -1,4 +1,5 @@ """Functionality to interact with the database.""" + import asyncio import os from configparser import ConfigParser diff --git a/backend/zeno_backend/database/delete.py b/backend/zeno_backend/database/delete.py index 7f6eeb85..b9739511 100644 --- a/backend/zeno_backend/database/delete.py +++ b/backend/zeno_backend/database/delete.py @@ -1,4 +1,5 @@ """Functions to delete data from the database.""" + from psycopg import sql from zeno_backend.classes.user import Author, Organization, User diff --git a/backend/zeno_backend/database/insert.py b/backend/zeno_backend/database/insert.py index 97f38091..82b871f8 100644 --- a/backend/zeno_backend/database/insert.py +++ b/backend/zeno_backend/database/insert.py @@ -1,4 +1,5 @@ """Functions to insert new data into Zeno's database.""" + import json import secrets import uuid diff --git a/backend/zeno_backend/database/select.py b/backend/zeno_backend/database/select.py index 0380a66b..6e959490 100644 --- a/backend/zeno_backend/database/select.py +++ b/backend/zeno_backend/database/select.py @@ -1,4 +1,5 @@ """Functions to select data from the database.""" + import asyncio import json diff --git a/backend/zeno_backend/database/update.py b/backend/zeno_backend/database/update.py index 3e39e489..86fcab92 100644 --- a/backend/zeno_backend/database/update.py +++ b/backend/zeno_backend/database/update.py @@ -1,4 +1,5 @@ """Functions to update data in the database.""" + import json from psycopg import sql diff --git a/backend/zeno_backend/database/util.py b/backend/zeno_backend/database/util.py index b7804e26..cac38f59 100644 --- a/backend/zeno_backend/database/util.py +++ b/backend/zeno_backend/database/util.py @@ -1,4 +1,5 @@ """Utility functions for database operations.""" + import hashlib import json from pathlib import Path diff --git a/backend/zeno_backend/processing/chart.py b/backend/zeno_backend/processing/chart.py index f774a574..d2fadd74 100644 --- a/backend/zeno_backend/processing/chart.py +++ b/backend/zeno_backend/processing/chart.py @@ -1,4 +1,5 @@ """Functions for extracting chart data from SQL.""" + import json from typing import Any diff --git a/backend/zeno_backend/processing/filtering.py b/backend/zeno_backend/processing/filtering.py index 40c8d642..121a4eac 100644 --- a/backend/zeno_backend/processing/filtering.py +++ b/backend/zeno_backend/processing/filtering.py @@ -1,4 +1,5 @@ """Functions for parsing filter predicates and filtering data.""" + from fastapi import HTTPException, status from psycopg import sql diff --git a/backend/zeno_backend/processing/metrics/mean.py b/backend/zeno_backend/processing/metrics/mean.py index 71bf228f..021fcfc6 100644 --- a/backend/zeno_backend/processing/metrics/mean.py +++ b/backend/zeno_backend/processing/metrics/mean.py @@ -1,4 +1,5 @@ """Mean metric calculation.""" + from psycopg import sql from zeno_backend.classes.base import GroupMetric, MetadataType diff --git a/backend/zeno_backend/processing/slice_finder.py b/backend/zeno_backend/processing/slice_finder.py index c84ec698..cbb5c0b2 100644 --- a/backend/zeno_backend/processing/slice_finder.py +++ b/backend/zeno_backend/processing/slice_finder.py @@ -1,4 +1,5 @@ """Methods to run slice-finder in order to slice the user's data.""" + import secrets import numpy as np diff --git a/backend/zeno_backend/routers/account.py b/backend/zeno_backend/routers/account.py index 858cb558..58517160 100644 --- a/backend/zeno_backend/routers/account.py +++ b/backend/zeno_backend/routers/account.py @@ -1,4 +1,5 @@ """FastAPI server endpoints for user and organization related queries.""" + from amplitude import BaseEvent from fastapi import ( APIRouter, diff --git a/backend/zeno_backend/routers/chart.py b/backend/zeno_backend/routers/chart.py index 6db7d421..d76fa81a 100644 --- a/backend/zeno_backend/routers/chart.py +++ b/backend/zeno_backend/routers/chart.py @@ -1,4 +1,5 @@ """FastAPI server endpoints for data-table-related queries.""" + from amplitude import BaseEvent from fastapi import ( APIRouter, diff --git a/backend/zeno_backend/routers/metadata.py b/backend/zeno_backend/routers/metadata.py index bd8ac24b..ef94a685 100644 --- a/backend/zeno_backend/routers/metadata.py +++ b/backend/zeno_backend/routers/metadata.py @@ -1,4 +1,5 @@ """FastAPI server endpoints for metadata-related queries.""" + import asyncio import datetime diff --git a/backend/zeno_backend/routers/project.py b/backend/zeno_backend/routers/project.py index cf3afaf6..6dd6ffd0 100644 --- a/backend/zeno_backend/routers/project.py +++ b/backend/zeno_backend/routers/project.py @@ -1,4 +1,5 @@ """FastAPI server endpoints for data-table-related queries.""" + import shutil from pathlib import Path from urllib import parse diff --git a/backend/zeno_backend/routers/report.py b/backend/zeno_backend/routers/report.py index 8478d831..8b60e654 100644 --- a/backend/zeno_backend/routers/report.py +++ b/backend/zeno_backend/routers/report.py @@ -1,4 +1,5 @@ """FastAPI server endpoints for report-related queries.""" + from urllib import parse from amplitude import BaseEvent diff --git a/backend/zeno_backend/routers/sdk.py b/backend/zeno_backend/routers/sdk.py index 9319d356..c0883d23 100644 --- a/backend/zeno_backend/routers/sdk.py +++ b/backend/zeno_backend/routers/sdk.py @@ -1,4 +1,5 @@ """FastAPI server endpoints for the Zeno SDK.""" + import uuid from urllib import parse diff --git a/backend/zeno_backend/routers/slice.py b/backend/zeno_backend/routers/slice.py index 5f5c9421..d53ec358 100644 --- a/backend/zeno_backend/routers/slice.py +++ b/backend/zeno_backend/routers/slice.py @@ -1,4 +1,5 @@ """FastAPI server endpoints for slice-related queries.""" + from amplitude import BaseEvent from fastapi import APIRouter, Depends, HTTPException, Request, status diff --git a/backend/zeno_backend/routers/table.py b/backend/zeno_backend/routers/table.py index 816a1ecc..341c38dd 100644 --- a/backend/zeno_backend/routers/table.py +++ b/backend/zeno_backend/routers/table.py @@ -1,4 +1,5 @@ """FastAPI server endpoints for data-table-related queries.""" + import pandas as pd from fastapi import APIRouter, HTTPException, Request, status diff --git a/backend/zeno_backend/routers/tag.py b/backend/zeno_backend/routers/tag.py index ee4745b5..63c1d593 100644 --- a/backend/zeno_backend/routers/tag.py +++ b/backend/zeno_backend/routers/tag.py @@ -1,4 +1,5 @@ """FastAPI server endpoints for tag-related queries.""" + from amplitude import BaseEvent from fastapi import ( APIRouter, diff --git a/backend/zeno_backend/server.py b/backend/zeno_backend/server.py index 3b628856..8628319f 100644 --- a/backend/zeno_backend/server.py +++ b/backend/zeno_backend/server.py @@ -1,4 +1,5 @@ """The FastAPI server for the Zeno backend. Provides endpoints to load data.""" + import logging import os import time diff --git a/backend/zeno_backend/util.py b/backend/zeno_backend/util.py index f6748b23..31d83d4e 100644 --- a/backend/zeno_backend/util.py +++ b/backend/zeno_backend/util.py @@ -1,4 +1,5 @@ """Utility functions for Zeno's backend.""" + import os import cognitojwt diff --git a/frontend/src/lib/components/chart/chart-page/encoding/chart-encoding/BeeswarmEncoding.svelte b/frontend/src/lib/components/chart/chart-page/encoding/chart-encoding/BeeswarmEncoding.svelte index 91c3db5d..804d4fc8 100644 --- a/frontend/src/lib/components/chart/chart-page/encoding/chart-encoding/BeeswarmEncoding.svelte +++ b/frontend/src/lib/components/chart/chart-page/encoding/chart-encoding/BeeswarmEncoding.svelte @@ -5,7 +5,7 @@ type BeeswarmParameters, type Chart } from '$lib/zenoapi'; - import Checkbox from '@smui/checkbox/src/Checkbox.svelte'; + import Checkbox from '@smui/checkbox'; import Svelecte from 'svelecte'; import { EncodingMap } from '../encodingUtil'; import EncodingSection from './EncodingSection.svelte'; diff --git a/frontend/src/lib/components/metadata/cells/FolderCell.svelte b/frontend/src/lib/components/metadata/cells/FolderCell.svelte index e7487a10..d6999d7a 100644 --- a/frontend/src/lib/components/metadata/cells/FolderCell.svelte +++ b/frontend/src/lib/components/metadata/cells/FolderCell.svelte @@ -5,7 +5,7 @@ import { clickOutside } from '$lib/util/clickOutside'; import type { Folder, ZenoService } from '$lib/zenoapi'; import { mdiChevronDown, mdiChevronRight, mdiDotsHorizontal } from '@mdi/js'; - import Checkbox from '@smui/checkbox/src/Checkbox.svelte'; + import Checkbox from '@smui/checkbox'; import IconButton, { Icon } from '@smui/icon-button'; import Paper, { Content } from '@smui/paper'; import { getContext } from 'svelte'; diff --git a/frontend/src/lib/components/popups/Confirm.svelte b/frontend/src/lib/components/popups/Confirm.svelte index 48db7f31..7c25961c 100644 --- a/frontend/src/lib/components/popups/Confirm.svelte +++ b/frontend/src/lib/components/popups/Confirm.svelte @@ -1,5 +1,5 @@
diff --git a/frontend/src/routes/playground/+page.svelte b/frontend/src/routes/playground/+page.svelte index 17b93cd5..889aff43 100644 --- a/frontend/src/routes/playground/+page.svelte +++ b/frontend/src/routes/playground/+page.svelte @@ -5,7 +5,7 @@ import Error from '$lib/instance-views/Error.svelte'; import InstanceView from '$lib/instance-views/InstanceView.svelte'; import { json } from '@codemirror/lang-json'; - import Button from '@smui/button/src/Button.svelte'; + import Button from '@smui/button'; import CodeMirror from 'svelte-codemirror-editor'; import { samples } from './samples.js'; import { setURLParameters, type URLParams } from './util.js';