Add Convention.select_indexes()
method
#146
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds the methods
Convention.selector_for_indexes()
,Convention.select_indexes
, andConvention.select_points()
. These allow for more efficient extraction of multiple points at the same time. These are similar to their singular counterparts, but take lists of indexes or points instead.This introduces some changes which are backwards incompatible. These incompatibilities are hopefully minor.
Convention.selector_for_indexes()
is a new required abstract method, whileConvention.selector_for_index()
now has a default implementation.emsarray-smc
will need updating (Add support for emsarray 0.7.0 emsarray-smc#2).Convention.selector_for_index()
has been changed from adict
to an :class:xarray.Dataset
, but this new value is also designed to be passed directly to :meth:Dataset.isel() <xarray.Dataset.isel>
. The output ofConvention.selector_for_index()
has always been a convention-specific dict whos only purpose was to be passed toDataset.isel()
, now it is a convention-specific dataset whos only purpose is to be passed toDataset.isel()
..Convention.select_index()
and :meth:.Convention.select_indexes()
have a newdrop_geometry
flag which defaults to True. Previously these methods would act as ifdrop_geometry
was False, but this led to convention-dependent results as to which geometry variables were returned. The fragmented geometry variables from different conventions often did not contain enough data to be useful. By dropping geometry the results are more consistent across all conventions and do not contain potentially fragmented geometry information.Fixes #106