Skip to content
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

atleast_2d before super-post-init #687

Merged
merged 4 commits into from
Aug 15, 2021
Merged

atleast_2d before super-post-init #687

merged 4 commits into from
Aug 15, 2021

Conversation

gdmcbain
Copy link
Contributor

Coercion of ‘scalar’ one-dimensional coordinates to 1-vectors needs to happen before Mesh.__post_init__; otherwise the trace of a two-dimensional basis with a ‘scalar’ one-dimensional projection hits #686.

@kinnala
Copy link
Owner

kinnala commented Aug 12, 2021

Why no test caught this?

@gdmcbain
Copy link
Contributor Author

Indeed. Let me fix that.

@gdmcbain gdmcbain marked this pull request as draft August 12, 2021 21:16
@gdmcbain
Copy link
Contributor Author

The only test always passes an (n − 1)-dimensional projection.

nbasis, y = basis.trace(xfun, lambda p: p[0:(p.shape[0] - 1)], target_elem=e2)

(It did cross my mind yesterday that maybe the points passed to construct a one-dimensional mesh should have ndim==2 and shape[0]==1 but that is a bit too strict, isn't it. People do want to be able to pass just ndim==1 arrays of just the x-coordinate, or even lists #663, and it would seem to be pythonic to accept them.)

@gdmcbain gdmcbain marked this pull request as ready for review August 12, 2021 23:51
@gdmcbain
Copy link
Contributor Author

This works (fails on master, passes here).

The pytest.mark.parametrize is getting verbose; maybe it could be shortened with some generation or itertools, but I've left that for now.

@gdmcbain
Copy link
Contributor Author

Maybe a full factorial test against #686 isn't required, just a single test with flat doflocs; I doubt it interacts with the other factors.

@kinnala kinnala merged commit 789da1b into kinnala:master Aug 15, 2021
@gdmcbain gdmcbain deleted the 686-trace-regression branch August 15, 2021 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants