Skip to content

Commit 6aa839f

Browse files
committed
format
1 parent 618eaa1 commit 6aa839f

36 files changed

+1481
-1254
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ test:
2424

2525
.PHONY: format
2626
format:
27-
docker compose run api $(isort)
28-
docker compose run api $(black)
27+
docker compose run -T api $(isort)
28+
docker compose run -T api $(black)

api/com_res/app/models.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from typing import Annotated, Any
21
from enum import Enum
2+
from typing import Annotated, Any
33

44
from fastapi import Depends, HTTPException, Path, status
55
from pydantic import BaseModel, Field
@@ -42,11 +42,13 @@ class UserSubmissionsResponseModel(BaseModel):
4242
class SubmissionResponseModel(Submission):
4343
workflow_id: str
4444

45+
4546
class NWMVersionEnum(str, Enum):
4647
nwm1 = "nwm1"
4748
nwm2 = "nwm2"
4849
nwm3 = "nwm3"
4950

51+
5052
class ExtractMetadataRequestBody(BaseModel):
5153
workflow_id: str
5254
metadata: Any = None

api/com_res/app/routers/argo/router.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212

1313
from app.db import Submission, User
1414
from app.models import (
15+
ExtractMetadataRequestBody,
1516
LogsResponseModel,
17+
NWMVersionEnum,
1618
SubmissionResponseModel,
1719
UrlResponseModel,
1820
UserSubmissionsResponseModel,
1921
WorkflowDep,
20-
NWMVersionEnum,
21-
ExtractMetadataRequestBody,
2222
)
2323
from app.users import current_active_user
2424
from config import get_minio_client, get_settings
@@ -41,9 +41,7 @@
4141
api_instance = workflow_service_api.WorkflowServiceApi(api_client)
4242

4343

44-
def parflow_submission_body(
45-
hucs: list, bucket_name: str, workflow_name: str, output_path
46-
):
44+
def parflow_submission_body(hucs: list, bucket_name: str, workflow_name: str, output_path):
4745
return {
4846
"resourceKind": "WorkflowTemplate",
4947
"resourceName": "parflow-subset-v1-by-huc-minio",
@@ -162,9 +160,7 @@ async def extract_metadata(
162160
user: User = Depends(current_active_user),
163161
):
164162
submission = next(
165-
submission
166-
for submission in user.submissions
167-
if submission.workflow_id == metadata_request.workflow_id
163+
submission for submission in user.submissions if submission.workflow_id == metadata_request.workflow_id
168164
)
169165
if not submission:
170166
raise Exception(f"No Submission found for id {metadata_request.workflow_id}")

api/com_res/app/routers/storage/router.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,24 @@
1-
from fastapi import APIRouter
1+
from fastapi import APIRouter, Depends
22

3-
from app.models import WorkflowDep
4-
from config import get_minio_client
53
from app.db import User
6-
from fastapi import APIRouter, Depends
4+
from app.models import WorkflowDep
75
from app.users import current_active_user
6+
from config import get_minio_client
87

98
router = APIRouter()
109

1110

1211
@router.get('/presigned/get/{workflow_id}', description="Create a download url")
1312
async def presigned_get_minio(workflow_params: WorkflowDep, user: User = Depends(current_active_user)):
1413
submission = workflow_params.user.get_submission(workflow_params.workflow_id)
15-
url = get_minio_client().presigned_get_object(
16-
"com_res-outputs", submission.output_path(user.bucket_name)
17-
)
14+
url = get_minio_client().presigned_get_object("com_res-outputs", submission.output_path(user.bucket_name))
1815
return {'url': url}
1916

2017

2118
@router.get('/url/{workflow_id}', description="Create a download url")
2219
async def presigned_get_url(workflow_params: WorkflowDep, user: User = Depends(current_active_user)):
2320
submission = workflow_params.user.get_submission(workflow_params.workflow_id)
24-
url = get_minio_client().presigned_get_object(
25-
"com_res-outputs", submission.output_path(user.bucket_name)
26-
)
21+
url = get_minio_client().presigned_get_object("com_res-outputs", submission.output_path(user.bucket_name))
2722
return {'url': url}
2823

2924

api/com_res/app/routers/utilities/router.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
from typing import Any, List
2+
13
from fastapi import APIRouter
2-
from shapely.geometry import GeometryCollection, shape, Polygon
3-
from pyproj import Transformer, CRS
4-
from typing import List, Any
54
from pydantic import BaseModel
5+
from pyproj import CRS, Transformer
6+
from shapely.geometry import GeometryCollection, Polygon, shape
67

78
router = APIRouter()
89

@@ -41,9 +42,7 @@ def geojson_to_geometry_collection(
4142
geometries = []
4243

4344
for feature in feature_collection.features:
44-
shapely_geom = shape(
45-
{"type": feature.geometry.type, "coordinates": feature.geometry.coordinates}
46-
)
45+
shapely_geom = shape({"type": feature.geometry.type, "coordinates": feature.geometry.coordinates})
4746
# NOTE: buffer(0) is a trick for fixing scenarios where polygons have overlapping coordinates
4847
geometries.append(shapely_geom.buffer(0))
4948

Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
make format
12
cd frontend
23
npm run validate

frontend/src/App.vue

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,20 @@
33
<v-main>
44
<TheAppBar @toggle-mobile-nav="toggleMobileNav" :paths="paths" />
55
<AlertPopup v-bind="alertStore.displayed"></AlertPopup>
6-
<TheMobileNavDrawer @toggle-mobile-nav="toggleMobileNav" :show="showMobileNavigation" :paths="paths" />
6+
<TheMobileNavDrawer
7+
@toggle-mobile-nav="toggleMobileNav"
8+
:show="showMobileNavigation"
9+
:paths="paths"
10+
/>
711
<RouterView v-slot="{ Component }">
812
<KeepAlive>
913
<component :is="Component" />
1014
</KeepAlive>
1115
</RouterView>
12-
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900" rel="stylesheet" />
16+
<link
17+
href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900"
18+
rel="stylesheet"
19+
/>
1320
<SnackBar />
1421
<TheFooter />
1522
</v-main>
@@ -31,30 +38,30 @@ const alertStore = useAlertStore()
3138
let showMobileNavigation = ref(false)
3239
const paths = [
3340
{
34-
attrs: { to: "/" },
35-
label: "Home",
41+
attrs: { to: '/' },
42+
label: 'Home'
3643
},
3744
{
38-
attrs: { to: "/map" },
39-
label: "Map",
45+
attrs: { to: '/map' },
46+
label: 'Map'
4047
},
4148
{
42-
attrs: { to: "/submissions" },
43-
label: "Submissions",
49+
attrs: { to: '/submissions' },
50+
label: 'Submissions'
4451
},
4552
{
46-
attrs: { to: "/api" },
47-
label: "API",
53+
attrs: { to: '/api' },
54+
label: 'API'
4855
},
4956
{
50-
attrs: { to: "/about" },
51-
label: "About",
57+
attrs: { to: '/about' },
58+
label: 'About'
5259
},
5360
{
54-
attrs: { to: "/help" },
55-
label: "Help",
56-
},
57-
];
61+
attrs: { to: '/help' },
62+
label: 'Help'
63+
}
64+
]
5865
5966
function toggleMobileNav() {
6067
showMobileNavigation.value = !showMobileNavigation.value

frontend/src/assets/font/font.css

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
@import "montserrat/stylesheet.css";
1+
@import 'montserrat/stylesheet.css';
22
/* TODO: transition from montserrat to inter: use 1px lower size of inter */
3-
@import "inter/inter.css";
3+
@import 'inter/inter.css';
44

5-
html, body {
6-
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.004);
7-
text-rendering: optimizeLegibility !important;
8-
-webkit-font-smoothing: antialiased !important;
5+
html,
6+
body {
7+
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.004);
8+
text-rendering: optimizeLegibility !important;
9+
-webkit-font-smoothing: antialiased !important;
910
}
1011

1112
@font-face {
12-
font-family: 'friz_quadrata';
13-
src: url('friz_quadrata_regular-webfont.woff2') format('woff2');
14-
font-weight: normal;
15-
font-style: normal;
13+
font-family: 'friz_quadrata';
14+
src: url('friz_quadrata_regular-webfont.woff2') format('woff2');
15+
font-weight: normal;
16+
font-style: normal;
1617
}
Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,89 @@
11
@font-face {
22
font-family: 'Inter';
3-
font-style: normal;
3+
font-style: normal;
44
font-weight: 400;
55
font-display: swap;
6-
src: url("Inter-Regular.woff2?v=3.11") format("woff2");
6+
src: url('Inter-Regular.woff2?v=3.11') format('woff2');
77
}
88
@font-face {
99
font-family: 'Inter';
10-
font-style: italic;
10+
font-style: italic;
1111
font-weight: 400;
1212
font-display: swap;
13-
src: url("Inter-Italic.woff2?v=3.11") format("woff2");
13+
src: url('Inter-Italic.woff2?v=3.11') format('woff2');
1414
}
1515

1616
@font-face {
1717
font-family: 'Inter';
18-
font-style: normal;
18+
font-style: normal;
1919
font-weight: 500;
2020
font-display: swap;
21-
src: url("Inter-Medium.woff2?v=3.11") format("woff2");
21+
src: url('Inter-Medium.woff2?v=3.11') format('woff2');
2222
}
2323
@font-face {
2424
font-family: 'Inter';
25-
font-style: italic;
25+
font-style: italic;
2626
font-weight: 500;
2727
font-display: swap;
28-
src: url("Inter-MediumItalic.woff2?v=3.11") format("woff2");
28+
src: url('Inter-MediumItalic.woff2?v=3.11') format('woff2');
2929
}
3030

3131
@font-face {
3232
font-family: 'Inter';
33-
font-style: normal;
33+
font-style: normal;
3434
font-weight: 600;
3535
font-display: swap;
36-
src: url("Inter-SemiBold.woff2?v=3.11") format("woff2");
36+
src: url('Inter-SemiBold.woff2?v=3.11') format('woff2');
3737
}
3838
@font-face {
3939
font-family: 'Inter';
40-
font-style: italic;
40+
font-style: italic;
4141
font-weight: 600;
4242
font-display: swap;
43-
src: url("Inter-SemiBoldItalic.woff2?v=3.11") format("woff2");
43+
src: url('Inter-SemiBoldItalic.woff2?v=3.11') format('woff2');
4444
}
4545

4646
@font-face {
4747
font-family: 'Inter';
48-
font-style: normal;
48+
font-style: normal;
4949
font-weight: 700;
5050
font-display: swap;
51-
src: url("Inter-Bold.woff2?v=3.11") format("woff2");
51+
src: url('Inter-Bold.woff2?v=3.11') format('woff2');
5252
}
5353
@font-face {
5454
font-family: 'Inter';
55-
font-style: italic;
55+
font-style: italic;
5656
font-weight: 700;
5757
font-display: swap;
58-
src: url("Inter-BoldItalic.woff2?v=3.11") format("woff2");
58+
src: url('Inter-BoldItalic.woff2?v=3.11') format('woff2');
5959
}
6060

6161
@font-face {
6262
font-family: 'Inter';
63-
font-style: normal;
63+
font-style: normal;
6464
font-weight: 800;
6565
font-display: swap;
66-
src: url("Inter-ExtraBold.woff2?v=3.11") format("woff2");
66+
src: url('Inter-ExtraBold.woff2?v=3.11') format('woff2');
6767
}
6868
@font-face {
6969
font-family: 'Inter';
70-
font-style: italic;
70+
font-style: italic;
7171
font-weight: 800;
7272
font-display: swap;
73-
src: url("Inter-ExtraBoldItalic.woff2?v=3.11") format("woff2");
73+
src: url('Inter-ExtraBoldItalic.woff2?v=3.11') format('woff2');
7474
}
7575

7676
@font-face {
7777
font-family: 'Inter';
78-
font-style: normal;
78+
font-style: normal;
7979
font-weight: 900;
8080
font-display: swap;
81-
src: url("Inter-Black.woff2?v=3.11") format("woff2");
81+
src: url('Inter-Black.woff2?v=3.11') format('woff2');
8282
}
8383
@font-face {
8484
font-family: 'Inter';
85-
font-style: italic;
85+
font-style: italic;
8686
font-weight: 900;
8787
font-display: swap;
88-
src: url("Inter-BlackItalic.woff2?v=3.11") format("woff2");
88+
src: url('Inter-BlackItalic.woff2?v=3.11') format('woff2');
8989
}

0 commit comments

Comments
 (0)