Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdbc99ec

Browse files
committed
Explain clean vs compare in README
1 parent0039b70 commitdbc99ec

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

‎README.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,19 @@ end
241241

242242
Note that the`#clean` method will discard the previous cleaner block if you call it again. If for some reason you need to access the currently configured cleaner block,`Scientist::Experiment#cleaner` will return the block without further ado._(This probably won't come up in normal usage, but comes in handy if you're writing, say, a custom experiment runner that provides default cleaners.)_
243243

244+
The`#clean` method will not be used for comparison of the results, so in the following example it is not possible to remove the`#compare` method without the experiment failing:
245+
246+
```ruby
247+
defuser_ids
248+
science"user_ids"do
249+
e.use { [1,2,3] }
250+
e.try { [1,3,2] }
251+
e.clean { |value| value.sort }
252+
e.compare { |a,b| a.sort== b.sort }
253+
end
254+
end
255+
```
256+
244257
###Ignoring mismatches
245258

246259
During the early stages of an experiment, it's possible that some of your code will always generate a mismatch for reasons you know and understand but haven't yet fixed. Instead of these known cases always showing up as mismatches in your metrics or analysis, you can tell an experiment whether or not to ignore a mismatch using the`ignore` method. You may include more than one block if needed:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp