In [ ]:
import pandas as pd
import matplotlib.pyplot as plt, mpld3
import ThermoPyle as TP
import numpy as np
import itertools as it
%matplotlib notebook
mpld3.enable_notebook()
#print(plt.style.available)
plt.style.use(["seaborn-talk","seaborn-notebook","seaborn-paper"])

In [ ]:
Water = TP.ThermoFluid(fluid="Water", xvar="T", yvar="P", zvar="U", numPoints=[217,217])

In [ ]:
Water.add_column(["S", "D"])

In [ ]:
Water.data["V"] = pd.Series(Water.M / Water.data["D"], index=Water.data.index)

In [ ]:
Water.refresh()
Water.vars

In [ ]:
d_vars = set(Water.vars).difference({"V"})
newCols = {f"d({z})/d({y})|{x}" for x,y,z in it.permutations(d_vars, 3)}.union(d_vars).difference(set(Water.vars))
# print(newCols)
#len(newCols)

In [ ]:
for col in newCols:
    try:    
        Water.add_column(col)
    except:
        print("Failed")
Water.refresh()

In [ ]:
Water.write_data(path="../finalData/", filename="_withVolume", mode="dual")

In [ ]:
print(Water.write_data.__doc__)

In [ ]: