Repository navigation
Keep DataArray inputs as is in from_dict and dict_to_dataset - #231
Merged
aloctavodia merged 1 commit intoOct 10, 2026
Merged
Conversation
Documentation build overview
|
Contributor
Author
|
The failing ExternalTests Python_312_Special_versions job is not from this change. The same 3 cmdstanpy tests fail on main since build 7718 (2026-09-25) with |
aloctavodia
approved these changes
Oct 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #146
from_dict(throughdict_to_datasetandndarray_to_dataarray) treatedxarray.DataArrayvalues like plain arrays and relabelled their dims, so achanneldim becamealpha_dim_0.Following the approach discussed in the issue,
ndarray_to_dataarraynow returnsDataArrayinputs as they are, so their dims and coords are kept. That covers dicts with only DataArrays and dicts that mix DataArrays and ndarrays. As noted in the issue,dims,coordsandsample_dimsare not applied to DataArray inputs, and the docstrings ofndarray_to_dataarray,dict_to_datasetandfrom_dictnow say so. ndarray inputs are handled as before.Tests: added
test_ndarray_to_dataarray_keeps_dataarrayandtest_dict_to_dataset_mixed_dataarray_and_ndarrayintests/test_base.py, andtest_from_dict_keeps_dataarray_dims(the example from the issue) intests/test_io_dict.py. All three fail onmain. The full test suite passes locally, and the pre-commit hooks (ruff, mypy, pylint, docstub) pass on the changed files.