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

DM-10946: Non-square MatrixMap composed with a ShiftMap cannot be simplified #23

Merged
merged 2 commits into from Jun 16, 2017

Conversation

kfindeisen
Copy link
Member

Test that a non-square matrix map followed by a shift map can be simplified and performs as expected.

Copy link
Member Author

@kfindeisen kfindeisen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering why you have what seem like redundant checks on SeriesMap composing the operations correctly, but otherwise looks good.

[0.0, 1.0, 2.0],
], dtype=float)
pred_outdata = np.array(m1 * indata[0] + m2 * indata[1] + shift)
pred_outdata.shape = (1, len(indata[0]))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems really verbose. Why not just trust the unsimplified seriesMap (calling the SeriesMap constructor if needed to guarantee that it hasn't been simplified)?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did it this way to make the test as rigorous as possible. I agree it is more than the ticket requires, but I prefer to prove that a map does what it should do when possible. I tried to simplify the code slightly.

Also I realized the code should be in test_cmpMap.py so I moved it there. Then I discovered that was missing tests for Mapping.then and Mapping.under so I added those (as very simple additions to the existing test cases, with minor associated cleanup).

Test that a non-square matrix map followed by a shift map
can be simplified and performs as expected.
test_cmpMap.py should have been testing `Mapping.from` and
`Mapping.under` but was not doing so. Add tests as simple additions
to the existing test cases.
@r-owen r-owen merged commit 2d078b2 into master Jun 16, 2017
@ktlim ktlim deleted the tickets/DM-10946 branch August 25, 2018 04:29
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.

None yet

2 participants