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
The argument grid is required --- of course --- in model constructors.
Our current API makes grid a keyword argument. Originally (and it was a long time ago now) it was argued that keyword arguments are just better and that's why we should keep it. Also, we don't dispatch on it.
However, we violate that concept in Simulation, where the model is a positional argument.
I think it's more natural to input grid as a positional argument in the models. It's a relatively minor thing, but it avoids anti-patterns like grid=grid, which appeared in many scripts before ; grid was possible. It looks better.
This has come up because we are adding more Oceananigans-based AbstractModels over in ClimaSeaIce, and my first intuition there was to make grid a required positional argument. Ultimately though, we should strive for all models to have uniform interfaces, so either we change Oceananigans or we change ClimaSeaIce.
The text was updated successfully, but these errors were encountered:
I like kwarg because it’s more verbose.
Is there any other reason why it should be positional?
As you said grid=grid can be avoided although some people like it.
The argument
grid
is required --- of course --- in model constructors.Our current API makes
grid
a keyword argument. Originally (and it was a long time ago now) it was argued that keyword arguments are just better and that's why we should keep it. Also, we don't dispatch on it.However, we violate that concept in
Simulation
, where themodel
is a positional argument.I think it's more natural to input
grid
as a positional argument in the models. It's a relatively minor thing, but it avoids anti-patterns likegrid=grid
, which appeared in many scripts before; grid
was possible. It looks better.This has come up because we are adding more Oceananigans-based
AbstractModel
s over inClimaSeaIce
, and my first intuition there was to makegrid
a required positional argument. Ultimately though, we should strive for all models to have uniform interfaces, so either we changeOceananigans
or we changeClimaSeaIce
.The text was updated successfully, but these errors were encountered: