Huite

Results 199 comments of Huite

Should be obvious if you think about it: the major difference is that numpy unique basically does a lexsort. So it ends up doing more sorting work. This is disabled...

The sorting doesn't take enough time in actual workflows to make this worthwhile.

There's the (copied from xarray) `either_dict_or_kwargs` function to enable this: https://github.com/Deltares/xugrid/blob/b2f9dd6498042af4ff6e10105afe41c9b72a9068/xugrid/core/utils.py#L24

More notes: These explicit indexes are currently insufficiently mature (e.g. tries to convert to PandasIndex now when accessing via `ds.indexes`), but once mature enough: * The UGRID topology could be...

Alternatively, maybe a topology and its data should be grouped together in a completely different way, see: https://xarray-datatree.readthedocs.io/en/latest/ This also has a similar drawback, which is that the API looks...

> I think you can handle this in Index.sel which will be called by Dataset.sel Yes, I think so too now. That would be a very comfortable solution. > The...

Reading this again: the problem is that a circumcenter is defined for triangles, but not for arbitrary n-gons. This means that in any internal method, centroids should be used, because...

I would've expected as much, essentially. Median just wraps numpy nan percentile. I even left a TODO there about better performance: https://github.com/Deltares/xugrid/blob/fd1938aa84e54e81f788a04be01962c663626ff9/xugrid/regrid/reduce.py#L133 We're numba jitting, so it'll call the numba...

Actually, it looks like I'm mistaken. `make_regrid` uses a closure to insert the redunction function `f` here: ```python def _regrid(source: FloatArray, A: MatrixCSR, size: int): n_extra = source.shape[0] out =...

Actually, deciding on the size of the buffer is probably also quite easy. In the sparse matrix, the largest number of non-zeros in any row suffices.