pytroll / pyresample

Geospatial image resampling in Python
http://pyresample.readthedocs.org
GNU Lesser General Public License v3.0
343 stars 95 forks source link

errors in area definition should not be silently ignored #570

Closed gerritholl closed 5 months ago

gerritholl commented 7 months ago

Code Sample, a minimal, complete, and verifiable piece of code

from pyresample.area_config import load_area_from_string

ardef = """dyn_2km:
  description: dyn_2km
  projection:
    EPSG: 4087
  revolution: 2000
"""

load_area_from_string(ardef_dyn)

Problem description

I would like this to fail, noting that revolution is not a valid property/keyword argument/attribute.

Expected Output

I expect a failure.

Actual Result, Traceback if applicable

The code succeeds.

Versions of Python, package at hand and relevant dependencies

pyresample main

djhoese commented 6 months ago

Given that the file format is YAML and doesn't require a schema to be parsed/defined, I'd like to leave the flexibility of users defining their own attributes or properties that they can use as they want. It would also make it easier for pyresample to have forward and backward compatibility of we change things later on. What do you think about a warning for any unused parameters?