oceanmesh icon indicating copy to clipboard operation
oceanmesh copied to clipboard

ESPG=4326 is not recognised

Open tomsail opened this issue 2 years ago • 3 comments

This is one of the reasons that the CI actions don't pass:

Some of the examples in the README use EPSG = 4326 as an integer for the coordinate system. However in edgefx.py, only strings are tested i.e. :

if crs == "EPSG:4326":

like in bathymetric_gradient_sizing_function() and wavelength_sizing_function()

if crs == "EPSG:4326" or crs == 4326: seems to be a good fix

tomsail avatar Nov 21 '23 09:11 tomsail

seems to be a good fix

The function docstring says:

    crs: A Python int, dict, or str, optional
        The coordinate reference system

if that is the case, and a dict is acceptable too, then you should probably take that into account, too.

That being said, since crs is an argument that is used in many functions, fixing all the instances is probably out of scope for #68. "Syncing" the code with the docs should probably happen in a dedicated PR. In that case, replacing the integers with strings in the tests is probably more appropriate.

pmav99 avatar Nov 21 '23 10:11 pmav99

Actually as I progress doing our Iceland test case, I found more bugs/fixes to implement in various functions. I agree that correcting & addressing different issues with different PR is the way to go, although it might be confusing for @krober10nd to understand what's going on.

if that is the case, and a dict is acceptable too, then you should probably take that into account, too.

some functions implement the CRS class from pyproj but it is not consistent across the whole package

tomsail avatar Nov 21 '23 11:11 tomsail

@tomsail no, I can follow. feel free. thanks for putting in the effort here.

krober10nd avatar Nov 21 '23 12:11 krober10nd