|
|
@@ -236,7 +236,8 @@ pub trait PoreStateEntryExt {
|
|
|
|
|
|
impl PoreStateEntryExt for Vec<PoreStateEntry> {
|
|
|
fn group_by_state_and_time(&self, t: f32) -> Vec<PoreStateEntry> {
|
|
|
- let mut buckets: BTreeMap<(OrderedFloat<f32>, NanoporeChannelStatus), u64> = BTreeMap::new();
|
|
|
+ let mut buckets: BTreeMap<(OrderedFloat<f32>, NanoporeChannelStatus), u64> =
|
|
|
+ BTreeMap::new();
|
|
|
|
|
|
for entry in self {
|
|
|
let bucket_start = OrderedFloat((entry.experiment_time_minutes / t).floor() * t);
|
|
|
@@ -315,24 +316,26 @@ impl FromStr for NanoporeChannelStatus {
|
|
|
|
|
|
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
|
|
use NanoporeChannelStatus::*;
|
|
|
- match s.trim().to_lowercase().as_str() {
|
|
|
- "adapter" => Ok(Adapter),
|
|
|
- "disabled" => Ok(Disabled),
|
|
|
- "locked" => Ok(Locked),
|
|
|
- "multiple" => Ok(Multiple),
|
|
|
- "no_pore" => Ok(NoPore),
|
|
|
- "pending_manual_reset" => Ok(PendingManualReset),
|
|
|
- "pending_mux_change" => Ok(PendingMuxChange),
|
|
|
- "pore" => Ok(Pore),
|
|
|
- "saturated" => Ok(Saturated),
|
|
|
- "strand" => Ok(Strand),
|
|
|
- "unavailable" => Ok(Unavailable),
|
|
|
- "unblocking" => Ok(Unblocking),
|
|
|
- "unclassified" => Ok(Unclassified),
|
|
|
- "unclassified_following_reset" => Ok(UnclassifiedFollowingReset),
|
|
|
- "unknown_negative" => Ok(UnknownNegative),
|
|
|
- "unknown_positive" => Ok(UnknownPositive),
|
|
|
- "zero" => Ok(Zero),
|
|
|
+ match s.trim() {
|
|
|
+ "adapter" | "Adapter" => Ok(Adapter),
|
|
|
+ "disabled" | "Disabled" => Ok(Disabled),
|
|
|
+ "locked" | "Locked" => Ok(Locked),
|
|
|
+ "multiple" | "Multiple" => Ok(Multiple),
|
|
|
+ "no_pore" | "NoPore" => Ok(NoPore),
|
|
|
+ "pending_manual_reset" | "PendingManualReset" => Ok(PendingManualReset),
|
|
|
+ "pending_mux_change" | "PendingMuxChange" => Ok(PendingMuxChange),
|
|
|
+ "pore" | "Pore" => Ok(Pore),
|
|
|
+ "saturated" | "Saturated" => Ok(Saturated),
|
|
|
+ "strand" | "Strand" => Ok(Strand),
|
|
|
+ "unavailable" | "Unavailable" => Ok(Unavailable),
|
|
|
+ "unblocking" | "Unblocking" => Ok(Unblocking),
|
|
|
+ "unclassified" | "Unclassified" => Ok(Unclassified),
|
|
|
+ "unclassified_following_reset" | "UnclassifiedFollowingReset" => {
|
|
|
+ Ok(UnclassifiedFollowingReset)
|
|
|
+ }
|
|
|
+ "unknown_negative" | "UnknownNegative" => Ok(UnknownNegative),
|
|
|
+ "unknown_positive" | "UnknownPositive" => Ok(UnknownPositive),
|
|
|
+ "zero" | "Zero" => Ok(Zero),
|
|
|
_ => Err(format!("Unknown channel status: {}", s)),
|
|
|
}
|
|
|
}
|