-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add guidance on how to expand exisiting verifications.
- Loading branch information
Showing
2 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,23 @@ | ||
Expand Exisiting Verifications | ||
=============================== | ||
|
||
1. | ||
.. role:: python(code) | ||
:language: python | ||
|
||
1. A new verification logic file should be added to the `contrain/library` folder which already includes several verification logic | ||
- At a minimum (for rule-based verification) the logic should be wrapped into a :python:`verify()` function as shown below where :python:`df` is a :python:`pandas.DataFrame` that contains the data needed for the verification | ||
- For more complicated verifications (e.g., procedure-based) the functions in the :meth:`checklib.CheckLibBase` class can be overloaded | ||
|
||
.. sourcecode:: python | ||
|
||
from constrain.checklib import RuleCheckBase | ||
|
||
|
||
class NewVerificationLogicClassName(RuleCheckBase): | ||
points = ["point_1", "point_2"] | ||
|
||
def verify(self): | ||
self.result = (self.df["point_1"] > self.df["point_2"]) | ||
|
||
2. The new verification class name should be added to the list of class already listed in the `__init__.py` file located in that same directory | ||
3. A library file that includes all the information needed by the verification logic should be created or appended if it already exists |