Fix reshaping/unreshaping for tensor product spaces in 1D #105
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.
unreshape_array_for_tensor_product_spacecurrently fails for 1D. It checksspace.bases, but in 1D this isPN, which doesn't have abasesattribute. This leads to a bunch of unnecessary checks on spatial dimension before attempting to reshape in an upstream package to guarantee we don't fail.reshape_array_for_tensor_product_spaceworks in the 1D case, but does some unnecessary work since the input array and returned array will be the same.If the spatial dimension of the space is 1, we should just return the array in both cases since there's nothing to do. This PR updates corresponding functions to do just that. Also updates one of the tests to test for
unreshape_array_for_tensor_product_spaceto test the 1D case.