# requirements pack 6 nodes, in `noodlelab` and above. ## Requirements (node-requirements.check_candidates)= ### Check Candidates `requirements.check_candidates` Score candidate designs, one per row, against the requirements whose quantity is a column of the table. Adds a `` margin`` column for each, and ``compliant``: whether the row meets them all. ``compliant`` (the output) keeps only those rows, ready to sort and pick from. **Inputs** | Name | Type | Description | |---|---|---| | `table` | `DataFrame` | | | `requirements` | `RequirementSet` | | | `only` | `str` | Requirement IDs to apply, comma-separated; empty: all Default `''`. | **Outputs** | Name | Type | Description | |---|---|---| | `table` | `DataFrame` | | | `compliant` | `DataFrame` | | (node-requirements.load_requirements)= ### Load Requirements `requirements.load_requirements` Read requirements from a specification file: a CSV (or a YAML or JSON list) with the columns id, quantity, op, limit and optionally unit, upper, tolerance, text, method, priority and parent. **Inputs** | Name | Type | Description | |---|---|---| | `path` | `FileRef` | | **Outputs** | Name | Type | Description | |---|---|---| | `result` | `RequirementSet` | | (node-requirements.merge_requirements)= ### Merge Requirements `requirements.merge_requirements` One set from two, such as system and subsystem requirements. An ID may appear only once. **Inputs** | Name | Type | Description | |---|---|---| | `a` | `RequirementSet` | | | `b` | `RequirementSet` | | **Outputs** | Name | Type | Description | |---|---|---| | `result` | `RequirementSet` | | (node-requirements.requirement_value)= ### Requirement Value `requirements.requirement_value` A requirement's limit, to design with: a quantity when it has a unit (for a range, the lower limit). The required data rate, say, sets the bandwidth the link needs. **Inputs** | Name | Type | Description | |---|---|---| | `requirements` | `RequirementSet` | | | `id` | `str` | Which requirement Default `''`. | **Outputs** | Name | Type | Description | |---|---|---| | `result` | `Any` | | (node-requirements.requirements)= ### Requirements `requirements.requirements` Write down what the design must achieve, one requirement per line: **Inputs** | Name | Type | Description | |---|---|---| | `text` | `str` | One per line: ID quantity >= limit unit [method] # statement. Also <=, > and < (strict), == limit ± tolerance, between low and high Default `'REQ-001 margin >= 3 dB # The design shall have 3 dB of margin'`. | **Outputs** | Name | Type | Description | |---|---|---| | `result` | `RequirementSet` | | (node-requirements.verify_requirement)= ### Verify Requirement `requirements.verify_requirement` Check a result against a requirement. The check passes when the value is within the limit (every element of an array: the margin is then the worst case) and reports the margin, how far inside the limit it is in the requirement's unit. A failed requirement does not stop the run: it marks the node, is listed in the Problems tab and fails ``noodlelab test``. Chain ``log`` from node to node and put it in a report with Add Compliance Matrix. **Inputs** | Name | Type | Description | |---|---|---| | `requirements` | `RequirementSet` | | | `value` | `Any` | | | `id` | `str` | Which requirement Default `''`. | | `log` | `Verifications \| None` | Earlier verifications: chain these nodes into one matrix Optional. | **Outputs** | Name | Type | Description | |---|---|---| | `value` | `Any` | | | `check` | `Check` | | | `log` | `Verifications` | |