Xinli Xiao commited on
Commit ·
485727f
1
Parent(s): e0cbbe9
remove force refresh
Browse files- __pycache__/app.cpython-313.pyc +0 -0
- app.py +5 -9
__pycache__/app.cpython-313.pyc
CHANGED
|
Binary files a/__pycache__/app.cpython-313.pyc and b/__pycache__/app.cpython-313.pyc differ
|
|
|
app.py
CHANGED
|
@@ -154,19 +154,19 @@ def parse_symbols(symbs_text: str) -> list[str]:
|
|
| 154 |
return symbs
|
| 155 |
|
| 156 |
|
| 157 |
-
def run_app(symbs_text: str, disable_target_time: bool, target_time: str
|
| 158 |
symbs = parse_symbols(symbs_text)
|
| 159 |
resolved_target_time = None if disable_target_time else (target_time or None)
|
| 160 |
if not disable_target_time and resolved_target_time is None:
|
| 161 |
raise gr.Error("Provide target_time in YYYY-MM-DD format, or disable it.")
|
| 162 |
|
| 163 |
try:
|
| 164 |
-
df, download_timestamps = conf_int(symbs, resolved_target_time,
|
| 165 |
except Exception as exc:
|
| 166 |
raise gr.Error(str(exc)) from exc
|
| 167 |
|
| 168 |
latest_download = max(download_timestamps) if download_timestamps else "Unknown"
|
| 169 |
-
return df.reset_index(), f"Last data download: {latest_download}"
|
| 170 |
|
| 171 |
|
| 172 |
def toggle_target_time(disable_target_time: bool):
|
|
@@ -189,10 +189,6 @@ with gr.Blocks(title="Options Confidence Interval") as demo:
|
|
| 189 |
label="Disable target_time to include all expiration dates within 14 days",
|
| 190 |
value=True,
|
| 191 |
)
|
| 192 |
-
force_refresh_input = gr.Checkbox(
|
| 193 |
-
label="Force refresh",
|
| 194 |
-
value=False,
|
| 195 |
-
)
|
| 196 |
target_time_input = gr.Textbox(
|
| 197 |
label="target_time",
|
| 198 |
placeholder="YYYY-MM-DD",
|
|
@@ -210,8 +206,8 @@ with gr.Blocks(title="Options Confidence Interval") as demo:
|
|
| 210 |
)
|
| 211 |
submit_btn.click(
|
| 212 |
run_app,
|
| 213 |
-
inputs=[symbs_input, disable_target_time_input, target_time_input
|
| 214 |
-
outputs=[output_df, refresh_timestamp
|
| 215 |
)
|
| 216 |
|
| 217 |
|
|
|
|
| 154 |
return symbs
|
| 155 |
|
| 156 |
|
| 157 |
+
def run_app(symbs_text: str, disable_target_time: bool, target_time: str):
|
| 158 |
symbs = parse_symbols(symbs_text)
|
| 159 |
resolved_target_time = None if disable_target_time else (target_time or None)
|
| 160 |
if not disable_target_time and resolved_target_time is None:
|
| 161 |
raise gr.Error("Provide target_time in YYYY-MM-DD format, or disable it.")
|
| 162 |
|
| 163 |
try:
|
| 164 |
+
df, download_timestamps = conf_int(symbs, resolved_target_time, True)
|
| 165 |
except Exception as exc:
|
| 166 |
raise gr.Error(str(exc)) from exc
|
| 167 |
|
| 168 |
latest_download = max(download_timestamps) if download_timestamps else "Unknown"
|
| 169 |
+
return df.reset_index(), f"Last data download: {latest_download}"
|
| 170 |
|
| 171 |
|
| 172 |
def toggle_target_time(disable_target_time: bool):
|
|
|
|
| 189 |
label="Disable target_time to include all expiration dates within 14 days",
|
| 190 |
value=True,
|
| 191 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 192 |
target_time_input = gr.Textbox(
|
| 193 |
label="target_time",
|
| 194 |
placeholder="YYYY-MM-DD",
|
|
|
|
| 206 |
)
|
| 207 |
submit_btn.click(
|
| 208 |
run_app,
|
| 209 |
+
inputs=[symbs_input, disable_target_time_input, target_time_input],
|
| 210 |
+
outputs=[output_df, refresh_timestamp],
|
| 211 |
)
|
| 212 |
|
| 213 |
|