IPython-Notebook
Example on how to use pyhasse.acm¶
Objectives¶
The module pyhasse.core is a tool to import data from a CSV file.
It is the basic module for other calcualtions and modules to calculate partial order sets.
After successful importing the data, some basic calculations are performed.
In [10]:
import pathlib
from pyhasse.core.csv_io import CSVReader
In [11]:
TESTFILENAME = '/csvdata/example_r6_k4_fresh.csv'
HERE = pathlib.Path('__file__').parent
csv = CSVReader(fn=str(HERE) + TESTFILENAME, ndec=3)
red = csv.calc_reduced_system()
Check if all data are correct imported¶
All data¶
In [12]:
for row in csv.data:
print(row)
Basic calculations¶
Antichain¶
In [13]:
from pyhasse.acm.calc import ACM
acm = ACM(csv.data, csv.rows, csv.cols)
define a user list¶
In [14]:
user_list = ["a", "b", "d", "e"]
In [15]:
px, pq = acm.generate_setofpairs(csv.objred, user_list)
In [16]:
ac = acm.calc_acm(px, pq)
In [18]:
for row in ac:
print(row)
usw. usw.....