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

CLN: Use `FileFormat` for exports #1171

Closed mferrera closed 7 months ago

mferrera commented 7 months ago

Resolves #1146

This checks more against the enumerated file formats that xtgeo supports and removes most of the string comparisons. It also adds some extra file formats found along the way, but not all of them. Some formats were left as strings due to some ambiguity.

This is still a bit messy but should be cleaned up further, and in a more unified/centralized way, when importing and exporting is moved to xtgeo.io.

codecov-commenter commented 7 months ago

Codecov Report

Attention: 20 lines in your changes are missing coverage. Please review.

Comparison is base (9408db1) 80.06% compared to head (1a88afc) 79.99%.

Files Patch % Lines
src/xtgeo/grid3d/grid.py 46.15% 6 Missing and 1 partial :warning:
src/xtgeo/well/well1.py 33.33% 3 Missing and 1 partial :warning:
src/xtgeo/surface/regular_surface.py 62.50% 2 Missing and 1 partial :warning:
src/xtgeo/cube/cube1.py 33.33% 2 Missing :warning:
src/xtgeo/grid3d/_gridprop_export.py 71.42% 2 Missing :warning:
src/xtgeo/xyz/_xyz_io.py 66.66% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1171 +/- ## ========================================== - Coverage 80.06% 79.99% -0.07% ========================================== Files 97 97 Lines 13634 13649 +15 Branches 2187 2188 +1 ========================================== + Hits 10916 10919 +3 - Misses 1988 2000 +12 Partials 730 730 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.