From f1f6ed5f9346993a2917d1e69b501891b37e1fbb Mon Sep 17 00:00:00 2001 From: "Federico E. Benelli" Date: Thu, 10 Oct 2024 10:45:48 -0300 Subject: [PATCH] flake8 --- python/yaeos/core.py | 20 +++++++++---------- python/yaeos/models/excess_gibbs/unifac.py | 4 +--- .../residual_helmholtz/cubic_eos/__init__.py | 2 +- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/python/yaeos/core.py b/python/yaeos/core.py index f9e3b8ea..8ca3265a 100644 --- a/python/yaeos/core.py +++ b/python/yaeos/core.py @@ -436,7 +436,7 @@ def gibbs_residual_vt( dv: bool = False, dn: bool = False, ): - """Calculate residual Gibbs energy given volume and temperature [bar L/mol]. + """Rresidual Gibbs energy given volume and temperature [barL/mol]. Parameters ---------- @@ -534,7 +534,7 @@ def entropy_residual_vt( def cv_residual_vt( self, moles, volume: float, temperature: float ) -> float: - """Calculate residual isochoric heat capacity given V and T [barL/molK]. + """Residual isochoric heat capacity given V and T [barL/molK]. Parameters ---------- @@ -692,15 +692,15 @@ def flash_pt_grid( pressures = [10, 20, 30] """ - xs, ys, Vxs, Vys, betas = yaeos_c.flash_grid( + xs, ys, vxs, vys, betas = yaeos_c.flash_grid( self.id, z, pressures, temperatures, parallel=parallel ) flash = { "x": xs, "y": ys, - "Vx": Vxs, - "Vy": Vys, + "Vx": vxs, + "Vy": vys, "P": pressures, "T": temperatures, "beta": betas, @@ -709,7 +709,7 @@ def flash_pt_grid( return flash def saturation_pressure( - self, z, temperature: float, kind: str = "bubble", P0: float = 0 + self, z, temperature: float, kind: str = "bubble", p0: float = 0 ) -> dict: """Saturation pressure at specified temperature. @@ -767,7 +767,7 @@ def saturation_pressure( print(model.saturation_pressure(np.array([0.5, 0.5]), 350.0)) """ p, x, y, volume_x, volume_y, beta = yaeos_c.saturation_pressure( - id=self.id, z=z, t=temperature, kind=kind, p0=P0 + id=self.id, z=z, t=temperature, kind=kind, p0=p0 ) return { @@ -781,7 +781,7 @@ def saturation_pressure( } def saturation_temperature( - self, z, pressure: float, kind: str = "bubble", T0: float = 0 + self, z, pressure: float, kind: str = "bubble", t0: float = 0 ) -> dict: """Saturation pressure at specified temperature. @@ -839,7 +839,7 @@ def saturation_temperature( print(model.saturation_temperature(np.array([0.5, 0.5]), 12.99)) """ t, x, y, volume_x, volume_y, beta = yaeos_c.saturation_pressure( - id=self.id, z=z, p=pressure, kind=kind, t0=T0 + id=self.id, z=z, p=pressure, kind=kind, t0=t0 ) return { @@ -848,7 +848,7 @@ def saturation_temperature( "Vx": volume_x, "Vy": volume_y, "T": t, - "P": p, + "P": pressure, "beta": beta, } diff --git a/python/yaeos/models/excess_gibbs/unifac.py b/python/yaeos/models/excess_gibbs/unifac.py index 734728a3..70c0dbc9 100644 --- a/python/yaeos/models/excess_gibbs/unifac.py +++ b/python/yaeos/models/excess_gibbs/unifac.py @@ -2,8 +2,6 @@ from typing import List -import numpy as np - from yaeos.core import GeModel from yaeos.lib import yaeos_c from yaeos.models.groups import groups_from_dicts @@ -34,7 +32,7 @@ class UNIFACVLE(GeModel): model.ln_gamma([0.5, 0.5], 298.15) """ - def __init__(self, molecules) -> None: + def __init__(self, molecules: List[dict]) -> None: (number_of_groups, groups_ids, groups_ammounts) = groups_from_dicts( molecules diff --git a/python/yaeos/models/residual_helmholtz/cubic_eos/__init__.py b/python/yaeos/models/residual_helmholtz/cubic_eos/__init__.py index 479e1c26..32162d90 100644 --- a/python/yaeos/models/residual_helmholtz/cubic_eos/__init__.py +++ b/python/yaeos/models/residual_helmholtz/cubic_eos/__init__.py @@ -20,7 +20,7 @@ RKPR, SoaveRedlichKwong, ) -from .mixing_rules import CubicMixRule, MHV, HV, QMR +from .mixing_rules import CubicMixRule, HV, MHV, QMR __all__ = [