-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
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
assign_coords with mixed DataArray / array args removes coords #3483
Comments
The The last example raises a |
would it not be possible to always convert DataArray args using obj.assign_coords(x=obj.x.copy(data=list("efgh")).variable, y=(obj.y * 2).variable)
obj.assign_coords(x=list("efgh"), y=(obj.y * 2).variable) both work |
That is a good point. Let's see what @shoyer thinks. |
It might make sense to change how |
agreed, my suggestion only applies to Edit: this could be fixed by changing how |
* don't use the index to construct the condition array * use drop_vars to drop variables and coordinates * update the xfail reason for astype and item * remove the xfails due to np.result_type not being implemented * make array_extract_units a bit more robust * add the missing dataset apply_ufunc test * use None as the dict key for quantities * convert to variable to avoid the merge / assign_coords issue relevant issue: #3483 * update the align tests * fix the bugs introduced by converting to variables * update a few more tests * update the aggregation tests * update a few more tests * don't test rank which was deprecated in numpy 1.9 * update the DataArray.fillna tests * update most of the remaining DataArray tests * remove a debug assert * fix the broadcast_equals tests * update the indexing tests * update the tests depending on einsum * update the squeeze tests * fix a bug in the head / tail / thin test design * use dictionaries to index in the loc tests * update the expected unit of the computation tests * update the grouped operations tests * update the where tests * update most of the remaining dataset tests * create new tests for drop_sel * final batch of updated tests * rename result to actual to match the other test files * fix some more test bugs * update the xfail marks
I'm not sure if using
assign_coords
to overwrite the data of coords is the best way to do so, but using mixed args (on current master) turns out to have surprising results:Passing a
DataArray
fory
, likeobj.y * 2
while also changingx
(the type does not matter) always results in aMergeError
:I would expect the result to be the same regardless of the type of the new coords.
The text was updated successfully, but these errors were encountered: