Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
iamumairs committed Feb 15, 2021
1 parent 9688ed9 commit 6cf0a25
Show file tree
Hide file tree
Showing 16 changed files with 24 additions and 131 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ FT-MCS is small library which computes the minimal cutsets of a given fault tree

Install from [PyPi](https://pypi.org/project/cutsets/)

> pip install cutsets==1.2
> pip install cutsets
## Usage

Expand Down
Binary file removed build/.DS_Store
Binary file not shown.
112 changes: 0 additions & 112 deletions build/lib/cutsets.py

This file was deleted.

Binary file removed dist/cutsets-1.0-py2-none-any.whl
Binary file not shown.
Binary file removed dist/cutsets-1.0.tar.gz
Binary file not shown.
Binary file removed dist/cutsets-1.1-py2-none-any.whl
Binary file not shown.
Binary file removed dist/cutsets-1.1.tar.gz
Binary file not shown.
Binary file removed dist/cutsets-1.2-py2-none-any.whl
Binary file not shown.
Binary file removed dist/cutsets-1.2.tar.gz
Binary file not shown.
Binary file added dist/cutsets-1.3.tar.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="cutsets",
version="1.2",
version="1.3",
author="Umair Siddique",
url="https://github.com/iamumairs/fault-tree-mcs",
description="Computation of minimal cutsets using MOCUS Algorithm",
Expand All @@ -21,5 +21,5 @@
python_requires='>=3.6',
py_modules=["cutsets"],
package_dir={'':'src'},
install_requires=["pandas"]
install_requires=[]
)
Binary file removed src/__pycache__/cutsets.cpython-39.pyc
Binary file not shown.
20 changes: 13 additions & 7 deletions src/cutsets.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
Metadata-Version: 2.1
Name: cutsets
Version: 1.2
Version: 1.3
Summary: Computation of minimal cutsets using MOCUS Algorithm
Home-page: https://github.com/iamumairs/fault-tree-mcs
Author: Umair Siddique
License: MIT
Description: # FT-MCS
FT-MCS is small library which computes the minimal cutsets of a given fault tree using the famous MOCUS algorithm [1,2].
FT-MCS is small library which computes the minimal cutsets of a given fault tree using the famous MOCUS algorithm [1, 2].

## Installation

> pip install cutsets
Install from [PyPi](https://pypi.org/project/cutsets/)

> pip install cutsets==1.2

## Usage

Expand All @@ -33,13 +35,17 @@ Description: # FT-MCS
C7,And,D8 E7
E7,Or,D4 D9
```
> import cutsets

> ft = cutsets.get_ft(aircraft.csv)
```python
import cutsets

ft = cutsets.get_ft(aircraft.csv)

> cs = cutsets.mocus(ft)
cs = cutsets.mocus(ft)

print (cs)
```

> print (cs)
```
output:

Expand Down
1 change: 0 additions & 1 deletion src/cutsets.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ src/cutsets.py
src/cutsets.egg-info/PKG-INFO
src/cutsets.egg-info/SOURCES.txt
src/cutsets.egg-info/dependency_links.txt
src/cutsets.egg-info/requires.txt
src/cutsets.egg-info/top_level.txt
1 change: 0 additions & 1 deletion src/cutsets.egg-info/requires.txt

This file was deleted.

15 changes: 8 additions & 7 deletions src/cutsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,18 @@
'''
import os
import itertools
import pandas
import csv


class ErrorMsg(Exception):
pass

class ErrorMsg(Exception):
"""
Taken from https://community.esri.com/thread/140022
"""
pass

def get_ft(name):
ft = []
with open(name, newline='') as file:
Expand All @@ -31,10 +36,6 @@ def get_ft(name):
return(ft)


And = "And"
Or = "Or"


def rewrite_and(e, r, l):
r.remove(e)
for i in l:
Expand Down Expand Up @@ -79,7 +80,7 @@ def find_element_to_expand(paths, d):
for row in paths:
for e in row:
try:
# x = d[e] # Optional -- we can return x as well
x = d[e] # Optional -- we can return x as well
return (paths.index(row), row.index(e))
except KeyError:
continue
Expand Down Expand Up @@ -109,4 +110,4 @@ def mocus(fault_tree):
css.remove(b)
except BaseException:
continue
return(css)
return(css)

0 comments on commit 6cf0a25

Please sign in to comment.