Skip to content

Conversation

@BENR0
Copy link
Collaborator

@BENR0 BENR0 commented Nov 14, 2025

This PR changes area names for almost all areas to the naming scheme proposed in #2310 and removes areas listed by @mraspaud in https://docs.google.com/document/d/1LOGtyu8qjHiBcEhDToIgUPjUUlJalpGNgo-hpmBsb_k/edit?tab=t.0#heading=h.5adsx7apljox

Further possible areas which could be deprecated/replaced by other areas (please discuss):

  • met07globe
  • met09globe
  • msg_resample_area

Notes for the "far" ahead future removal of old area names from areas.yaml and the introduced decorator:

  • In the areas.yaml file the newly introduced key old_name can easily be removed for example with sed because it is only one line to be deleted in the corresponding areas
  • once the above is done the decorator and the corresponding decorator function can be removed from area.py

Copy link
Member

@gerritholl gerritholl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, some small corrections to be implemented. The use of a decorator function is a little odd to me.

I wonder if we can do something about deleted areas.

area_dict = None
for new_area_name, v in areas_dict.items():

if "old_name" in v.keys() and area_name in v["old_name"]:# == area_name:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment should be removed.

Comment on lines +56 to +59
warnings.simplefilter("always", DeprecationWarning)
warnings.warn(f"This area name is being deprecated in Satpy v1.0. Pleas use the new area name:"
f" {new_area_name}", DeprecationWarning, stacklevel=2)
warnings.simplefilter("default", DeprecationWarning)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should use the warnings.catch_warnings context manager, so any previously existing user settings are not lost.

warnings.simplefilter("default", DeprecationWarning)
return _create_area_def_from_dict(new_area_name, area_dict)
else:
raise AreaNotFound('Area "{0}" not found in file "{1}"'.format(area_name, area_file_name))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be easier to read with an f-strring.


return area_with_new_name

@deprecate_area_name
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find it confusing to define a decorator that is used exactly once and unlikely to be reused elsewhere. Wouldn't it be clearer to simply integrate this into get_area_def, then refactoring that function if it becomes too large?


if area_dict is not None:
warnings.simplefilter("always", DeprecationWarning)
warnings.warn(f"This area name is being deprecated in Satpy v1.0. Pleas use the new area name:"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
warnings.warn(f"This area name is being deprecated in Satpy v1.0. Pleas use the new area name:"
warnings.warn(f"This area name is being deprecated in Satpy v1.0. Please use the new area name:"

description:
Euroasia - optimised for Asia -
Global 1km USGS Landuse database
euroasia_asia_laea_1km:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having Asia in the name twice is confusing.


euroasia_asia_10km:
description: Euroasia - optimised for Asia - Global 1km USGS Landuse database
euroasia_asia_laea_10km:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having Asia in the name twice is confusing.

Comment on lines +1177 to +1179
global_moll_10km:
old_name: moll
description: Globe in Mollweide projection
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe "world" is a better term here than "globe"? To me a globe is a spheroid, (almost) unprojected in lat/lon coordinates.

Comment on lines +1192 to +1194
greenland_robin_1km:
old_name: robinson
description: Greenland in Robinson projection
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say that if the Robinson projection contained only Greenland and not the whole world, this counts as a bug...

Comment on lines +1258 to +1259
EPSG_4326_0.01deg:
old_name: EPSG_4326_36000x18000
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then this too should have world in the name?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants