diff --git a/.gitignore b/.gitignore index 016e97be..8847ebd4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ build dist thermosteam.egg-info +thermosteam/preferences.yaml Ethanol-Water Property Package **/__pycache__ *.pyc diff --git a/thermosteam/equilibrium/dew_point.py b/thermosteam/equilibrium/dew_point.py index 7db6d63b..ca5960ac 100644 --- a/thermosteam/equilibrium/dew_point.py +++ b/thermosteam/equilibrium/dew_point.py @@ -31,7 +31,9 @@ def x_iter(x, x_gamma, T, P, f_gamma, gamma_args): except: return x if (x < 0).any(): return x mask = x > 1e3 - if mask.any(): x[mask] = 1e3 + np.log(x[mask] / 1e3) # Avoid crazy numbers + if mask.any(): x[mask] = 1e3 + np.log(x[mask] - 1e3) # Avoid crazy numbers + mask = x > 1e5 + if mask.any(): x[mask] = 1e5 return x # @njit(cache=True) diff --git a/thermosteam/preferences.yaml b/thermosteam/preferences.yaml index 86c6a2c2..3d721967 100644 --- a/thermosteam/preferences.yaml +++ b/thermosteam/preferences.yaml @@ -2,11 +2,11 @@ N: 7 P: Pa:.6g T: K:.5g autodisplay: true -background_color: transparent +background_color: '#ffffffff' composition: false depth_colors: -- '#5172512f' -- '#1111112f' +- '#d5edf02f' +- '#ffffffdf' fill_cluster: true flow: kmol/hr:.3g graphviz_format: svg @@ -20,7 +20,7 @@ graphviz_html_height: unit: !!python/tuple - 225px - 400px -label_color: '#e5e5e5' +label_color: '#4e4e4e' label_streams: true minimal_nodes: false number_path: false @@ -28,9 +28,9 @@ profile: false raise_exception: false show_all_streams: true sort: false -stream_color: '#98a2ad' +stream_color: '#4e4e4e' stream_width: F_mass tooltips_full_results: false -unit_color: '#555f69' -unit_label_color: white -unit_periphery_color: none +unit_color: white:#CDCDCD +unit_label_color: black +unit_periphery_color: '#4e4e4e' diff --git a/thermosteam/reaction/_reaction.py b/thermosteam/reaction/_reaction.py index c44dd54a..9e04891e 100644 --- a/thermosteam/reaction/_reaction.py +++ b/thermosteam/reaction/_reaction.py @@ -1134,6 +1134,9 @@ def __init__(self, reactions): X_index = [i._X_index for i in reactions] self._X_index = tuple(X_index) if self._phases else np.array(X_index) + def __iter__(self): + for i in range(self._X.size): yield ReactionItem(self, i) + def __getitem__(self, index): stoichiometry = self._stoichiometry[index] if stoichiometry.__class__ is list: @@ -1397,6 +1400,9 @@ class ParallelReaction(ReactionSet): """ __slots__ = () + def __add__(self, other): + return self.__class__([i + j for i, j in zip(self, other)]) + def _reaction(self, material_array): reacted = self._X * np.array([material_array[i] for i in self._X_index], float) for X, stoichiometry in zip(reacted, self._stoichiometry):