We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
create_grid
The create_grid arguments are not descriptive due to the use of **kwargs,
**kwargs
Update create_grid function to def create_grid(x: Optional[Union[xr.DataArray, Tuple[xr.DataArray, xr.DataArray]]] = None, y: Optional[Union[xr.DataArray, Tuple[xr.DataArray, xr.DataArray]]] = None, z: Optional[Union[xr.DataArray, Tuple[xr.DataArray, xr.DataArray]]] = None, attrs: Optional[Dict[str, str]] = None) -> xr.Dataset.
def create_grid(x: Optional[Union[xr.DataArray, Tuple[xr.DataArray, xr.DataArray]]] = None, y: Optional[Union[xr.DataArray, Tuple[xr.DataArray, xr.DataArray]]] = None, z: Optional[Union[xr.DataArray, Tuple[xr.DataArray, xr.DataArray]]] = None, attrs: Optional[Dict[str, str]] = None) -> xr.Dataset
Users can now explicitly define x, y, and z dimensions when creating a grid.
x
y
z
attrs will be grid attributes, we should consider if there are any defaults we want.
attrs
Add create_axis function, def create_axis(name: str, data: Union[List[Union[int, float]], np.ndarray], bounds: Optional[Union[List[List[Union[int, float]]], np.ndarray]] = None, attrs: Dict[str, str]) -> Tuple[xr.DataArray, Optional[xr.DataArray]]
create_axis
def create_axis(name: str, data: Union[List[Union[int, float]], np.ndarray], bounds: Optional[Union[List[List[Union[int, float]]], np.ndarray]] = None, attrs: Dict[str, str]) -> Tuple[xr.DataArray, Optional[xr.DataArray]]
attrs will be merged into the default attributes where the defaults take precedence.
If bounds is not passed should we automatically generate them? Otherwise we could add a generate_bounds argument to trigger the generation.
bounds
generate_bounds
def create_grid(x: GridCoord, y: GridCoord, z: GridCoord) -> xr.Dataset:
Where GridCoord could be any of the following forms.
(name, data) (name, data, attrs) (name, data, bnds) (name, data, bnds, attrs)
The data and bnds options can be List or np.ndarray.
data
bnds
List
np.ndarray
Previous discussion #388 (comment).
The text was updated successfully, but these errors were encountered:
jasonb5
Successfully merging a pull request may close this issue.
Is your feature request related to a problem?
The
create_grid
arguments are not descriptive due to the use of**kwargs
,Describe the solution you'd like
Update
create_grid
function todef create_grid(x: Optional[Union[xr.DataArray, Tuple[xr.DataArray, xr.DataArray]]] = None, y: Optional[Union[xr.DataArray, Tuple[xr.DataArray, xr.DataArray]]] = None, z: Optional[Union[xr.DataArray, Tuple[xr.DataArray, xr.DataArray]]] = None, attrs: Optional[Dict[str, str]] = None) -> xr.Dataset
.Users can now explicitly define
x
,y
, andz
dimensions when creating a grid.attrs
will be grid attributes, we should consider if there are any defaults we want.Add
create_axis
function,def create_axis(name: str, data: Union[List[Union[int, float]], np.ndarray], bounds: Optional[Union[List[List[Union[int, float]]], np.ndarray]] = None, attrs: Dict[str, str]) -> Tuple[xr.DataArray, Optional[xr.DataArray]]
attrs
will be merged into the default attributes where the defaults take precedence.If
bounds
is not passed should we automatically generate them? Otherwise we could add agenerate_bounds
argument to trigger the generation.Describe alternatives you've considered
def create_grid(x: GridCoord, y: GridCoord, z: GridCoord) -> xr.Dataset:
Where GridCoord could be any of the following forms.
(name, data)
(name, data, attrs)
(name, data, bnds)
(name, data, bnds, attrs)
The
data
andbnds
options can beList
ornp.ndarray
.Additional context
Previous discussion #388 (comment).
The text was updated successfully, but these errors were encountered: