-
Notifications
You must be signed in to change notification settings - Fork 91
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
Fix centering of full-symmetry cartesian latticeMaps #346
Conversation
Asciimaps assume everything starts at (0,0), so grid blueprints need to offset indices when reading in full geometry inputs. Also, when writing asciimaps, gridContents need to be offset in the other direction for things to work out correctly. This also fixes a bug related to asciimaps writing cartesian maps at all.
Fixes #332 |
The code changes look good. Can you post a screenshot of the before and after for the full core Cartesian case with the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we improve some of the grids
documentation to include the images that you provided me with where the origin points are for the different grid types and symmetries? I think that this will be very useful going forward as a visual aid for users and developers.
gridDesign2 = self.grids["sfp"] | ||
_grid = gridDesign2.construct() | ||
self.assertEqual(gridDesign2.gridContents[1, 1], "3") | ||
self.assertEqual(gridDesign2.gridContents[1, 1], "1") | ||
self.assertEqual(gridDesign2.gridContents[0, 0], "3") | ||
self.assertEqual(gridDesign2.gridContents[-1, -1], "3") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add unit tests to cover the following scenarios:
- Cartesian, Full Core, Even
- Cartesian, Quarter Core, Odd
- Cartesian, Quarter Core, Even
The SFP test is nice, but let's make sure that we have the other variations tested too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added quarter and even cases
Asciimaps assume everything starts at (0,0), so grid blueprints need to
offset indices when reading in full geometry inputs. Also, when writing
asciimaps, gridContents need to be offset in the other direction for
things to work out correctly.
This also fixes a bug related to asciimaps writing cartesian maps at
all.