-
Notifications
You must be signed in to change notification settings - Fork 1
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
refactor!: rework cmap2 index & attribute system #36
Conversation
they now return previous value if existing
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.
Ok with the main changes.
@@ -25,6 +25,7 @@ use num::ToPrimitive; | |||
/// | |||
/// todo | |||
/// | |||
#[cfg_attr(feature = "utils", derive(Clone))] |
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.
Why the condition?
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.
The same condition is put on the CMap2
structure; the reasoning for CMap2
is that it's not a good idea to give a "free" Clone
implementation to the user on such a structure. As for the storage, I didn't need the implementation for anything else than the case where it is required by the map itself.
Orbit2::new(self, OrbitPolicy::Vertex, dart_id) | ||
.min() | ||
.unwrap() as VertexIdentifier | ||
} |
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.
Why unwrap
?
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.
Essentially, an orbit is always non-empty, therefore the min()
method will always yield a result. The fact that the orbit is always non-empty is because of its definition: it will always include the dart passed as an argument since it is the starting point of the internal BFS. Because of that, all darts (even the null dart!) yield a non-empty orbit (given that the policy is valid).
honeycomb-core/src/twomap.rs
Outdated
Orbit2::new(self, OrbitPolicy::Edge, dart_id).min().unwrap() as EdgeIdentifier | ||
} |
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.
Why as
and not into()
?
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.
Because the identifier types are aliases (not structs) and the aliases point to the same primitives, clippy
detect it as a useless type conversion & throws a warning. This might actually be an inconsistent behavior of the linter; I'll look into it.
map: std::marker::PhantomData<&'a CMap2<T>>, | ||
pub identifiers: Vec<VertexIdentifier>, |
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.
map
is not a good name.
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.
renamed it to lifetime_indicator
in decb9ac
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #36 +/- ##
=========================================
Coverage ? 44.45%
=========================================
Files ? 15
Lines ? 2166
Branches ? 0
=========================================
Hits ? 963
Misses ? 1203
Partials ? 0 ☔ View full report in Codecov by Sentry. |
Description
Full rework of the
CMap2
structure & interfaces. Changes mainly concern how attributes (currently vertices) are handled, as well as the cell index computation logic. For a detailed breakdown of the system, refer to:Scope
honeycomb-core
for content, the rest is just updates dictated by core changesType of change
Other
Necessary follow-up
Mentions
...