Skip to content

Remove references to x and y in codebase (in favor of lon/lat/depth and i/j/k) #2223

@VeckoTheGecko

Description

@VeckoTheGecko

Good idea to add an explicit docstring. Done now in 8ea3c4a

However, as I was implementing this suggestion, I realised that our naming of x and y is actually quite confusing... Perhaps not for this PR, but we might want to do a refactor where we clearly split the code into

  • Particle positions - which we call lon, lat and depth (even though they could also be on flat grid, let's call them always the same)
  • Grid locations - which I propose we consistently call i, j and k following e.g. Nemo convention. These may or may not be in the x, y and z directions, depending on whether the grid is rotated.

To avoid this confusion, perhaps best to avoid the symbols/variables x and y as much as we can throughout the codebase?

So in this _search_indices_curvilinear_2d() method, we would then rename x and y to lon and lat, and xi and yi to ii and ji (or i_index and j_index).

What do you think, @VeckoTheGecko? Is this a useful refactor? Or is it not important enough?

Originally posted by @erikvansebille in #2211 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Backlog

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions