Skip to content

Commit cfe72d4

Browse files
author
miranov25
committed
add FormulaLinearModel.py used for the dEdx and distortion calibration
1 parent fcb9bb9 commit cfe72d4

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

UTILS/dfextensions/FormulaLinearModel.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
Utility helpers extension for FormulaLinearModel.py
66
"""
77

8-
import ast
9-
import numpy as np
10-
from sklearn.linear_model import LinearRegression
118

129
import ast
1310
import numpy as np
@@ -127,7 +124,7 @@ def to_javascript(self):
127124
args = ", ".join(self.variables)
128125
return f"function {self.name}({args}) {{ return {expr}; }}"
129126

130-
def to_cppstd(name, variables, expression, precision=6):
127+
def to_cppstd(self, name, variables, expression, precision=6):
131128
args = ", ".join([f"const std::vector<float>& {v}" for v in variables])
132129
output = [f"std::vector<float> {name}(size_t n, {args}) {{"]
133130
output.append(f" std::vector<float> result(n);")
@@ -144,7 +141,7 @@ def to_cppstd(name, variables, expression, precision=6):
144141
return "\n".join(output)
145142

146143

147-
def to_cpparrow(name, variables, expression, precision=6):
144+
def to_cpparrow(self, name, variables, expression, precision=6):
148145
args = ", ".join([f"const arrow::FloatArray& {v}" for v in variables])
149146
output = [f"std::shared_ptr<arrow::FloatArray> {name}(int64_t n, {args}, arrow::MemoryPool* pool) {{"]
150147
output.append(f" arrow::FloatBuilder builder(pool);")

0 commit comments

Comments
 (0)