hydromt icon indicating copy to clipboard operation
hydromt copied to clipboard

Rename the generic setup method to distinguish better between the setup_schematisation and add data methods

Open hboisgon opened this issue 2 years ago • 4 comments

Kind of request

Changing existing functionality

Enhancement Description

So far it's not too clear if the generic setup methods create a grid/mesh schematisation or add data to it. We kind of have a convention than method name starts with setup_ so renaming would be for example setup_grid_data_from_geodataframe instead of setup_grid_from_geodataframe.

Use case

No response

Additional Context

No response

hboisgon avatar Aug 09 '23 09:08 hboisgon

In #534 the changes were first implemented by maybe the names should be discussed with users before changing for good to find which names would be more explicit.

hboisgon avatar Sep 29 '23 09:09 hboisgon

As it seems that this will take a bit longer, should we move this to Q4 then?

savente93 avatar Oct 02 '23 06:10 savente93

More context

  • all methods that add information to a Model currently start with setup_, e.g. setup_grid creates the model grid and setup_grid_from_raster adds a new data layer by interpolating a raster file to the grid
  • Similar methods exist (or will be developed) for mesh, vector, geoms and maps, e.g., setup_mesh and setup_mesh_from_raster. Hence the name of the target model component should be in the function name.
  • naming of these methods is important as these are used in the build/update config yaml files
  • We think "setup_grid_from_raster" might be confusing since its not clear from the name if the grid is created or data is added to the grid. The latter is the case.
  • Would "setup_grid_data_from_raster" solve this? Or should we abandon the "setup" convention and use e.g., "add_grid_data_from_raster" or "add_raster_data_to_grid"?

I'd be happy to hear the opinion of some users: @hboisgon @roeldegoede @JoostBuitink @xldeltares

DirkEilander avatar Oct 19 '23 15:10 DirkEilander

Hi @DirkEilander , thanks for asking and I recognize the necessity for the method names to be self-explanatory to reduce confusion for users and developers. Here is my 2 cents: I would recommend using "add" to replace the current "setup" for the methods that does not create the model topology (specially referring to mesh, grid etc). I prefer "add_raster_data_to_grid" that emphasis the data is being added from raster to grid, something even more explicit like "add_data_to_grid_from_raster" might also work.

xldeltares avatar Oct 20 '23 14:10 xldeltares

Fixed in #671

savente93 avatar May 28 '24 12:05 savente93