xcompact3d / x3d2

https://xcompact3d.github.io/x3d2
BSD 3-Clause "New" or "Revised" License
3 stars 4 forks source link

Querying RDR returns wrong reordering value #105

Closed pbartholomew08 closed 2 months ago

pbartholomew08 commented 2 months ago

Problem description calling get_rdr_from_dirs(DIR_X, DIR_C) returns RDR_C2X when RDR_X2C would be expected. The 2D map is created by using reshape, this appears to be a row/column error.

Proposed solution Add order keyword to the map constructor to ensure correct ordering, verify with unit tests (and also for get_dirs_from_rdr).

Nanoseb commented 2 months ago

If that's the case this is confusing indeed. Though it is kind of in line with the arguments ordering in x3d2. The output are placed first and then followed by the inputs, so it is a bit similar here.

pbartholomew08 commented 2 months ago

Unit tests (in linked PR) seem to pass OK, so I'm not sure what was going on in my code when I opened this. Still, more tests don't hurt :)

Nanoseb commented 2 months ago

ah ok yeah, I was getting confused by reading your test :)

pbartholomew08 commented 2 months ago

Just to check there is no confusion, the test checks that

DIR_X -> DIR_Y == RDR_X2Y DIR_X -> DIR_Z == RDR_X2Z RDR_X2Y == DIR_X -> DIR_Y RDR_X2Z == DIR_X -> DIR_Z

etc.

Nanoseb commented 2 months ago

Yes, that's what I would expect too. I meant I was getting confused reading your test after reading your issue here because it didn't match. But the tests and x3d2 behaviour are what they should be