Simon Heybrock

Results 168 comments of Simon Heybrock

We could also do it in the spirit of `np.asarray`: ```python x = sc.asquantity(y, unit='m') ``` which would either (1) ensure that `y` has unit 'm', or (2) if `y.unit...

There is a significant subtlety here: Several accessors on the C++ side return by value, e.g., `Variable DataArray::data()`. This is to avoid breakage of invariants, since if we would return...

> How complicated would it be to implement this in copy. I.e. does it need intricate recursion or even a new function in VariableFactory? I think it should not be...

>> Also, are there other cases where this matters? Are there cases where slicing shares objects even though a user would expect otherwise? > > I think when we slice...

I found only two places where this is required currently (on the Python side), using `bins(**out.bins.constituents)` to bypass the issue. I am not aware of any user running into problems...

Another example: `NXcylindrical_geometry` would require a structured `dtype` containing 3 (named) `vector3` fields.

We should consider supporting both structure-of-array and array-of-structure types.

Hmm, so you are saying we should instead use a constant `pi = sc.scalar(..., unit='rad')`? I suppose the question is whether we consider `Hz` as an implicit `cycle/s`, or just...

We are already stretching it with using a 2-tuple for indexing a single dimension. Adding even more commas seems wrong.

We may consider adding a new method, returning a helper object implementing `__getitem__` (and `__setitem__`): ```python da.sel(time='s')[0.1:0.2] ``` `sel` is probably a bad name though, as `xarray.DataArray.sel` does something similar...