You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
It is unclear when to use curvilinear_make_uniform_on_extension or curvilinear_make_uniform if you look to the feedback from error messages. I would expect that arguments that are not used are not possible to pass (raise an error). Currently, this is not the case.
To Reproduce
import meshkernel
import matplotlib.pyplot as plt
plt.close('all')
extent = True
numrowcols0 = False
#TODO: extent=True ignores num_columns/num_rows arguments. This is fine since we are defining it with upper_right_x and upper_right_y in this case, but there should be an error if the user provides this argument.
#TODO: False/False gives grid of too small extent >> upper_right_x/upper_right_y should not be accepted as arguments for curvilinear_make_uniform
#general settings
lon_min,lon_max = -1,-0.2
lat_min,lat_max = 49.1,49.6
lon_res,lat_res = 0.1,0.1
figsize = (10,4)
crs = 'EPSG:4326'
# Create an instance of MakeGridParameters and set the values
make_grid_parameters = meshkernel.MakeGridParameters()
make_grid_parameters.angle = 0.0
make_grid_parameters.origin_x = lon_min
make_grid_parameters.origin_y = lat_min
if numrowcols0:
make_grid_parameters.num_columns = 0 #TODO: this is necessary or the grid extent will be wrong
make_grid_parameters.num_rows = 0
make_grid_parameters.upper_right_x = lon_max
make_grid_parameters.upper_right_y = lat_max
make_grid_parameters.block_size_x = lon_res
make_grid_parameters.block_size_y = lat_res
mk2 = meshkernel.MeshKernel(is_geographic=True)
if extent:
mk2.curvilinear_make_uniform_on_extension(make_grid_parameters)
else:
mk2.curvilinear_make_uniform(make_grid_parameters)
mk2.curvilinear_convert_to_mesh2d() #convert to ugrid/mesh2d
mesh2d = mk2.mesh2d_get()
fig, ax = plt.subplots()
mesh2d.plot_edges(ax)
Version info (please complete the following information):
OS: Windows
Version: MeshkernelPy 2.1.0
The text was updated successfully, but these errors were encountered:
Since MakeGridParameters is used for both curvilinear_make_uniform_on_extension and curvilinear_make_uniform, we always have unused parameters. This is intended and also expected behaviour, so this issue is closed as not planned.
Describe the bug
It is unclear when to use
curvilinear_make_uniform_on_extension
orcurvilinear_make_uniform
if you look to the feedback from error messages. I would expect that arguments that are not used are not possible to pass (raise an error). Currently, this is not the case.To Reproduce
Version info (please complete the following information):
The text was updated successfully, but these errors were encountered: