-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
40 lines (33 loc) · 1.56 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
A Ruby Component Value Matcher
------------------------------
Overview: Matches components on a single measured
axis that is orderable (float). Input can
be programatic via array or by way of CSV
with column number specified. Results can
be computed and returned in absolute terms
or in percentage terms, absolute being the
default. There are accessors for the
matched and residual component data if one
needs to use it as a library, and a
convenience report generator if one needs a
one-liner part matching utility.
Method: Iterative passes taking best adjacent pairing
in forward and reverse sweeps until there are
no more potential pairs meeting tolerance
criteria.
Examples: See example.rb for a running example.
Match 1st column of CSV to 0.02 (absolute) and
produce a printed report:
ComponentMatch.new('some.csv')
.match(0.02)
.report
Match array to 2 (percent) and produces a
printed report:
ComponentMatch.new([1,2,3])
.match(2,'percent')
.report
Match 3rd column of CSV to 0.3 (absolute) and
return the matched data:
ComponentMatch.new('some.csv',2)
.match(0.3)
.matched