-
Notifications
You must be signed in to change notification settings - Fork 21
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
🐛 Bug fixes and improvements related to the coordinate system #225
Conversation
… now resizes the layout appropriately
# Conflicts: # include/fiction/io/print_layout.hpp # include/fiction/layouts/coordinates.hpp # test/io/print_layout.cpp # test/layouts/coordinates.cpp
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #225 +/- ##
==========================================
+ Coverage 94.41% 94.44% +0.03%
==========================================
Files 82 82
Lines 7436 7477 +41
==========================================
+ Hits 7021 7062 +41
Misses 415 415
Continue to review full report in Codecov by Sentry.
|
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.
Many thanks for these great additions and fixes. Looks very good overall. You have really improved the code stability! Just a couple of minor comments from my side here.
clang-tidy review says "All clean, LGTM! 👍" |
clang-tidy review says "All clean, LGTM! 👍" |
It seems that some compilers generate a warning when the result of the new abs function is casted to an integer. Apparently they do not take the type traits check for integrality into account. I will drop the support for floating point values from this function as this can be achieved without ambiguity using EDIT: The latest commit fixed this issue and no extra warnings are generated |
Windows CI build is out of heap space again 🙄 |
clang-tidy review says "All clean, LGTM! 👍" |
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.
Looks essentially done. I just spotted a small inconsistency. After this, it's done, I promise 😆
clang-tidy review says "All clean, LGTM! 👍" |
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.
Many thanks!
Description
This PR is a collection of bug fixes in order to make the experience working with layouts of different coordinate types more seamless. In particular, the following changes are introduced:
wrap
function added to their respective namespaces that takes a dimension coordinate. When the coordinate is beyond the given dimension, it wraps to the next coordinate within the dimension. If no such coordinate exists, it becomes a dead copy of the dimension coordinate.integral_abs
function defined on integral number types was added tomath_utils.hpp
. Simply usingstd::abs
could give an ambiguity error or a compiler warning when applied to an unsigned integer. This function handles these concerns such that it can be applied to any integral number type without compiler errors or warnings.static_assert
checks were added toapply_gate_layout
andrelative_to_absolute_cell_position
, making sure that theCellLyt
template parameter is not based in SiQAD coordinates.siqad
namespace incoordinates.hpp
had missing docs; the "Offset coordinates are required" line was removed fromcartesian_layout.hpp
.layout_utils.hpp
, converting between SiQAD and fiction coordinates now appropriately resizes the layout. Note that since layouts with SiQAD coordinates must always have full dimer rows, the area of the transformed layout is not always equal to the area of the original layout when converting to SiQAD coordinates. The tests have thus been updated accordingly.print_charge_layout
function was adapted to the new changes. Also layout cropping is now optional (default false).Tests were added for all of the new behaviour. The
wrap
function implementations are tested through the coordinate iterator tests.Checklist: