Skip to content

Retrieve From TableMatrixData

Choose a tag to compare

@sinagilassi sinagilassi released this 31 Mar 21:23
· 1685 commits to main since this release

New Features

  • Introducing the ij Method: Retrieve data from TableMatrixData with ease. This new method allows you to access properties using a compact ij notation.

Example Usage

The following example demonstrates how to use the ij method to retrieve the "Alpha" property for components comp1 and comp2:

The following components are available in Table Non-randomness parameters of the NRTL equation-2.

release-img-1

# component list 
comp1 = "methanol"
comp2 = "ethanol"
comp3 = 'benzene'
prop_name = f"Alpha_{comp1}_{comp3}"
print(nrtl_alpha.ij(prop_name))
print(nrtl_alpha.ij(prop_name).get('value'))

You can also loop through matrix data using the ij method:

components = [comp1, comp2, comp3]
for comp1 in components:
    for comp2 in components:
        prop_name = f"Delta_{comp1}_{comp2}"
        prop_value = nrtl_alpha.ij(prop_name).get('value')
        print(f"Property: {prop_name} = {prop_value}")