Spaces:
Runtime error
Runtime error
kbberendsen
commited on
Commit
•
b8df987
1
Parent(s):
bdf1ad8
add config folder and simplify cache path
Browse files- __pycache__/app.cpython-311.pyc +0 -0
- app.py +6 -16
- configs/fontlist-v330.json +0 -0
__pycache__/app.cpython-311.pyc
CHANGED
Binary files a/__pycache__/app.cpython-311.pyc and b/__pycache__/app.cpython-311.pyc differ
|
|
app.py
CHANGED
@@ -1,3 +1,6 @@
|
|
|
|
|
|
|
|
1 |
from shiny import App, ui, render, reactive
|
2 |
from shinywidgets import output_widget, render_widget
|
3 |
import fastf1 as ff1
|
@@ -5,28 +8,15 @@ import matplotlib.pyplot as plt
|
|
5 |
from matplotlib.collections import LineCollection
|
6 |
from matplotlib import cm
|
7 |
import numpy as np
|
8 |
-
import os
|
9 |
from pathlib import Path
|
10 |
|
11 |
-
# Get the current directory
|
12 |
-
current_directory = Path.cwd()
|
13 |
-
|
14 |
-
# Specify the folder name you want to open (change 'folder_name' to your desired folder)
|
15 |
-
folder_name = 'cache'
|
16 |
-
|
17 |
# Create a Path object for the folder
|
18 |
-
|
19 |
-
|
20 |
-
# Check if the cache folder exists
|
21 |
-
if folder_path.exists() and folder_path.is_dir():
|
22 |
-
print(f"The folder '{folder_name}' exists.")
|
23 |
-
else:
|
24 |
-
print(f"The folder '{folder_name}' does not exist.")
|
25 |
|
26 |
-
ff1.Cache.enable_cache(
|
27 |
ff1.Cache.offline_mode(enabled=True)
|
28 |
|
29 |
-
print(
|
30 |
|
31 |
app_ui = ui.page_fluid(
|
32 |
ui.div(
|
|
|
1 |
+
import os
|
2 |
+
os.environ['MPLCONFIGDIR'] = os.getcwd() + "/configs/"
|
3 |
+
|
4 |
from shiny import App, ui, render, reactive
|
5 |
from shinywidgets import output_widget, render_widget
|
6 |
import fastf1 as ff1
|
|
|
8 |
from matplotlib.collections import LineCollection
|
9 |
from matplotlib import cm
|
10 |
import numpy as np
|
|
|
11 |
from pathlib import Path
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
# Create a Path object for the folder
|
14 |
+
cache_path = os.getcwd() + "/cache/"
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
+
ff1.Cache.enable_cache(cache_path)
|
17 |
ff1.Cache.offline_mode(enabled=True)
|
18 |
|
19 |
+
print(f"Cache path: {cache_path}")
|
20 |
|
21 |
app_ui = ui.page_fluid(
|
22 |
ui.div(
|
configs/fontlist-v330.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|