We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 195131b commit d81c53dCopy full SHA for d81c53d
examples/smoking/src/run.rs
@@ -88,6 +88,22 @@ fn reason_causal_chain(
88
causes: &BaseCausaloidVec,
89
data: &[NumericalValue],
90
) -> Result<bool, CausalityError> {
91
+ if causes.is_empty() {
92
+ return Err(CausalityError(
93
+ "Cannot reason over empty causal chain.".into(),
94
+ ));
95
+ }
96
+ if data.is_empty() {
97
+ return Err(CausalityError("Cannot reason with empty data.".into()));
98
99
+ if causes.len() != data.len() {
100
+ return Err(CausalityError(format!(
101
+ "Mismatch between number of causes ({}) and data points ({}).",
102
+ causes.len(),
103
+ data.len()
104
+ )));
105
106
+
107
if causes.len() != data.len() {
108
return Err(CausalityError(format!(
109
"Mismatch between number of causes ({}) and data points ({}).",
0 commit comments