Skip to content

Commit

Permalink
Update gpmap.py
Browse files Browse the repository at this point in the history
  • Loading branch information
tillwenke authored Jan 8, 2025
1 parent 3a22858 commit 54d72ca
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions heatchmap/gpmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,20 @@
from map_based_model import MapBasedModel
from utils.utils_models import fit_gpr_silent
import glob
from huggingface_hub import hf_hub_download

class GPMap(MapBasedModel):

Check failure on line 27 in heatchmap/gpmap.py

View workflow job for this annotation

GitHub Actions / build

Ruff (I001)

heatchmap/gpmap.py:1:1: I001 Import block is un-sorted or un-formatted

Check failure on line 27 in heatchmap/gpmap.py

View workflow job for this annotation

GitHub Actions / build

Ruff (D101)

heatchmap/gpmap.py:27:7: D101 Missing docstring in public class
def __init__(self, region="world", resolution=10, version="prod"):
self.gpr_path = "models/kernel.pkl"

self.points_path = "dump.sqlite"

if os.path.exists("models/kernel.pkl"):
self.gpr_path = "models/kernel.pkl"
else:
REPO_ID = "tillwenke/heatchmap-model"
FILENAME = "Unfitted_GaussianProcess_TransformedTargetRegressorWithUncertainty.pkl"
self.gpr_path = hf_hub_download(repo_id=REPO_ID, filename=FILENAME)

with open(self.gpr_path, "rb") as file:
self.gpr = pickle.load(file)

Expand Down Expand Up @@ -247,4 +255,4 @@ def get_landmass_raster(self):

def recalc():
gpmap = GPMap(resolution=1)
gpmap.recalc_map()
gpmap.recalc_map()

0 comments on commit 54d72ca

Please sign in to comment.