Skip to main content

Slow Fault Tree Analyser (SFTA)

A slow (also shitty) fault tree analyser inspired by the idea presented in:

Text-driven

SFTA reads a textual representation of a fault tree. For example:

- time_unit: yr

Gate: FB
- label: Conway causeth floor to be buttered
- type: OR
- inputs: BF, TFBSD

Event: BF
- label: Conway knocketh butter onto floor
- rate: 0.1

Gate: TFBSD
- label: Conway knocketh toast onto floor butter side down
- type: AND
- inputs: TF, TB, BSD

Event: TF
- label: Conway knocketh toast onto floor
- rate: 0.2

Event: TB
- label: Falling toast is buttered
- probability: 0.75

Event: BSD
- label: Buttered toast landeth butter side down
- probability: 0.9

This allows for sensible diffing between two versions of a fault tree.

Output

Output consists of:

  • an events summary,
  • a gates summary,
  • cut set listings, and
  • SVGs for all top gates and paged gates.

For the example above, we get the following SVG for the top gate FB:

Nice looking SVG showing the example fault tree.

Limitations

  • Only supports coherent fault trees, which have only AND gates and OR gates.

  • The probability or rate for a gate is approximated by simply summing the contributions from each minimal cut set (rare event approximation). The higher-order terms (subtraction of pairwise intersections, addition of triplet-wise intersections, etc.) have been neglected. This is conservative, as the first-order sum is an upper bound for the actual probability or rate.

Installation

$ pip3 install sfta
  • If simply using as a command line tool, do pipx instead of pip3 to avoid having to set up a virtual environment.
  • If using Windows, do pip instead of pip3.

Usage (command line)

$ sfta [-h] [-v] ft.txt

Perform a slow fault tree analysis.

positional arguments:
  ft.txt         name of fault tree text file; output is written unto the
                 directory `{ft.txt}.out/`

optional arguments:
  -h, --help     show this help message and exit
  -v, --version  show program's version number and exit

Usage (scripting example)

from sfta.core import FaultTree, Gate

fault_tree = FaultTree('''
Event: A
- rate: 0.9

Event: B
- probability: 0.7

Event: C
- rate: 1e-4

Gate: AB
- label: This be an AND gate.
- type: AND
- inputs: A, B

Gate: AB_C
- label: This be an OR gate.
- type: OR
- inputs: AB, C
''')

fault_tree.gate_from_id['AB'].quantity_value
# 0.63

fault_tree.gate_from_id['AB_C'].quantity_value
# 0.6301

fault_tree.gate_from_id['AB_C'].input_ids
# ['AB', 'C']

fault_tree.gate_from_id['AB_C'].type_ == Gate.TYPE_OR
# True

License

Copyright 2022–2024 Conway
Licensed under the GNU General Public License v3.0 (GPL-3.0-only).
This is free software with NO WARRANTY etc. etc., see LICENSE.

Metadata

Release files for sfta 0.9.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sfta 0.9.1
File Size Uploaded Provenance Actions
sfta-0.9.1.tar.gz 18.5 kB With provenance Details for sfta-0.9.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sfta 0.9.1
File Interpreter ABI Platform Actions
sfta-0.9.1-py3-none-any.whl Python 3 none any Details for sfta-0.9.1-py3-none-any.whl

Total release size: 37.3 kB

Release files / sfta-0.9.1.tar.gz

Download URL sfta-0.9.1.tar.gz
Size 18.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7fe93db1207b80393f8cb74eb60504758317ddf40a22a00291a7f946b6542001
BLAKE2b-256 checksum
How to use checksums
fc9372a2a1a036287294bac28dba814cd799b642bc416c501abfa08823807a88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2024.

Transparency log

Release files / sfta-0.9.1-py3-none-any.whl

Download URL sfta-0.9.1-py3-none-any.whl
Size 18.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c6a0fff8932a604f3416f2802fd75f1dd72b7b5a534198308cdd9f544024520b
BLAKE2b-256 checksum
How to use checksums
b1928df7195c765edd7ba2bc8a556a61668d8343ea0d5653fe5a3ef7316a6c4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2024.

Transparency log

Security for sfta 0.9.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for sfta-0.9.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2024.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page