equinor / xtgeo

XTGeo Python class library for subsurface Surfaces, Cubes, Wells, Grids, Points, etc
https://xtgeo.readthedocs.io/en/latest/
GNU Lesser General Public License v3.0
109 stars 57 forks source link

Replace `dict[str, Any]` return annotations in Grid, GridProperty, and GridProperties imports with TypedDict #1119

Open mferrera opened 9 months ago

mferrera commented 9 months ago

These classes import from a variety of file types across multiple modules as directed by a factory function as well as a deprecated .from_file() method. The result of these import functions is a dictionary and this dictionary is passed through an initialization decorator to maintain backward compatibility for deprecated initializations.

These import functions should actually return a typed dict (or at least something better than a dict[str, Any]) but it's not really reasonable to do this until we can remove the backward compatibility wrappers around deprecated initialization.