From 171210e626e1e32ab7b9bacc9dec9e864e112669 Mon Sep 17 00:00:00 2001 From: zbecker Date: Thu, 1 Aug 2024 11:24:47 -0700 Subject: [PATCH] Change outcome of unvalidated EPSG from ValueError to warning --- fireatlas/FireConsts.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fireatlas/FireConsts.py b/fireatlas/FireConsts.py index bf98c79..e7fd550 100644 --- a/fireatlas/FireConsts.py +++ b/fireatlas/FireConsts.py @@ -5,11 +5,13 @@ from typing import Literal import os +import warnings import fsspec from pydantic_settings import BaseSettings, SettingsConfigDict from pydantic import Field, validator, field_validator + from fireatlas.FireTypes import Location root_dir = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) @@ -70,7 +72,7 @@ class Settings(BaseSettings): def check_epsg(cls, epsg: int): allowed = (3571, 32610, 9311, 6933) if epsg not in allowed: - raise ValueError(f"EPSG projection code {epsg} not recognized as one of: {allowed}") + warnings.warn(f"EPSG projection code {epsg} not recognized as one of: {allowed}. (A new code can be registered in FireConsts.py if needed.)") return epsg # temporal parameters for fire object definition