Raphtory
Raphtory copied to clipboard
Balance only seems to work for float properties
Was working with the python version, it returns 0.0 for balance if the property is an integer. I think the problem is when it casts into_f64 it only works if the property is an f64 one. I guess the tricky part is if you're doing things with integers you need to worry about signed/unsigned etc.
.flat_map(|prop| {
prop.temporal().get(name).map(|val| {
val.values()
.into_iter()
.map(|valval| valval.into_f64().unwrap_or(0.0f64))
.sum::<f64>()
})
where into_f64 is
fn into_f64(self) -> Option<f64> {
if let Prop::F64(v) = self {
Some(v)
} else {
None
}
}
(not a problem for me right now as I can just cast the column as float before)