ipqa-research / yaeos

Thermodynamic Equations of State, Fortran library with both automatic and anallytical derivation capabilities
https://ipqa-research.github.io/yaeos/
Mozilla Public License 2.0
26 stars 4 forks source link

Python API #93

Closed fedebenelli closed 1 month ago

fedebenelli commented 1 month ago

restarting PR since another merge closed the original: https://github.com/ipqa-research/yaeos/pull/86

We are in the process of adding a Python API that wraps our library, that it is instalable with pip.

Things I consider needed to merge into dev

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 93.41%. Comparing base (481389a) to head (e0469ab).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev #93 +/- ## ========================================== + Coverage 93.33% 93.41% +0.07% ========================================== Files 57 57 Lines 2686 2687 +1 Branches 193 194 +1 ========================================== + Hits 2507 2510 +3 + Misses 128 127 -1 + Partials 51 50 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

fedebenelli commented 1 month ago

flash_pt gets stuck when variables are part of a for loop for some reason.

import yaeos
import numpy as np

P, T = 60.0, 294.0

n = [0.4, 0.6]
tc = [190.564, 425.12]
pc = [45.99, 37.96]
w = [0.0115478, 0.200164]
model = yaeos.PengRobinson76(tc, pc, w)

# This works
model.flash_pt(n, P, T)

ts = np.linspace(300, 400, 5)
ps = np.linspace(60, 100, 5)

# This does not
for i in range(len(ts)):
    for j in range(len(ps)):
       model.flash_pt(n, pressure=ps[j], temperature=ts[i])