Skip to content

Commit

Permalink
Add guidance on how to expand exisiting verifications.
Browse files Browse the repository at this point in the history
  • Loading branch information
lymereJ committed May 13, 2024
1 parent 0e8b817 commit 382e903
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
5 changes: 5 additions & 0 deletions docs/source/Code Documentation.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Code Documentation
===================

.. automodule:: checklib
:members:
:inherited-members:
:undoc-members:
:show-inheritance:
.. automodule:: api.brick_compliance
:members:
:inherited-members:
Expand Down
21 changes: 20 additions & 1 deletion docs/source/Expand Exisiting Verifications.rst
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

0 comments on commit 382e903

Please sign in to comment.