Skip to content

Commit

Permalink
Merge pull request #109 from Earth-Information-System/zb/epsg-warning
Browse files Browse the repository at this point in the history
Change outcome of unvalidated EPSG from ValueError to warning
  • Loading branch information
zebbecker authored Aug 1, 2024
2 parents fe9d935 + 171210e commit eed5376
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fireatlas/FireConsts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)))
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit eed5376

Please sign in to comment.