Skip to content

Commit d91699a

Browse files
Reformat, improve comments.
1 parent 4523f70 commit d91699a

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

app/main.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@
33
from fire_classifier.util.api import API
44

55
# A: init API
6-
app = FastAPI(title=API["title"], description=API["description"],
7-
version=API["version"], openapi_tags=API["endpoints"])
6+
app = FastAPI(
7+
title=API["title"],
8+
description=API["description"],
9+
version=API["version"],
10+
openapi_tags=API["endpoints"],
11+
)
812

913
# B: init ML inference object, and the routes
1014
predictor_config_path = API["config_path"]

fire_classifier/util/api.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
# Info about what data users can request.
1010
# These are intended shown on the UI, related only to a specific endpoint.
11+
# Note: the value in the "name" field should match what goes in the
12+
# "tags" parameter of the corresponding app route in main.py!!
1113
API_ENDPOINTS = (
1214
{
1315
"name": "Detect Fire",
@@ -17,7 +19,7 @@
1719

1820
# Tells the app how to find the config.yaml (for running ML inference)
1921
BASE_DIR = Path(__file__).resolve().parent.parent.parent
20-
CONFIG_PATH = os.path.join(BASE_DIR, 'app', 'config.yaml')
22+
CONFIG_PATH = os.path.join(BASE_DIR, "app", "config.yaml")
2123

2224
# Wraps all the API metadata as one dictionary
2325
API = {
@@ -26,4 +28,4 @@
2628
"version": API_VERSION,
2729
"endpoints": API_ENDPOINTS,
2830
"config_path": CONFIG_PATH,
29-
}
31+
}

0 commit comments

Comments
 (0)