Skip to content

Commit

Permalink
Merge pull request #201 from BioSTEAMDevelopmentGroup/bioreactor
Browse files Browse the repository at this point in the history
Make catch warnings python 3.9 compatible
  • Loading branch information
yoelcortes committed Apr 29, 2024
2 parents e5f9f62 + 3312da2 commit 4ad5d9f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Bioindustrial-Park
Submodule Bioindustrial-Park updated 45 files
+11 −20 biorefineries/HP/TRY_analysis_new.py
+1 −1 biorefineries/HP/analyses/1_full_evaluation.py
+0 −994 biorefineries/HP/analyses/models_2021.py
+0 −19 biorefineries/OHFA/__init__.py
+0 −153 biorefineries/OHFA/biorefinery.py
+0 −35 biorefineries/OHFA/chemicals.py
+0 −42 biorefineries/OHFA/process_settings.py
+0 −124 biorefineries/OHFA/systems.py
+0 −37 biorefineries/OHFA/units.py
+0 −12 biorefineries/TAL/_general_utils.py
+3 −4 .../decarboxylation/analytical_methods/decarboxylation_TALconversion_PDreq_PDprice_purchasing_PD_analytical.py
+1 −3 ...es/decarboxylation/numerical_methods/decarboxylation_TALconversion_PDreq_PDprice_purchasing_PD_numerical.py
+19 −20 ...es/decarboxylation/numerical_methods/decarboxylation_TALconversion_PDreq_recycling_supernatant_numerical.py
+1 −1 ...carboxylation/numerical_methods/decarboxylation_TALconversion_PDreq_recycling_supernatant_vapor_fraction.py
+ ...efineries/TAL/analyses/fermentation/AOC_animated_contourplot__(60, 60, 1)_steps_TAL_TRY_2024.4.15-19.21.gif
+ ...efineries/TAL/analyses/fermentation/FEC_animated_contourplot__(60, 60, 1)_steps_TAL_TRY_2024.4.15-19.21.gif
+ ...efineries/TAL/analyses/fermentation/GWP_animated_contourplot__(60, 60, 1)_steps_TAL_TRY_2024.4.15-19.21.gif
+ ...fineries/TAL/analyses/fermentation/MPSP_animated_contourplot__(60, 60, 1)_steps_TAL_TRY_2024.4.15-19.21.gif
+ ...neries/TAL/analyses/fermentation/Purity_animated_contourplot__(60, 60, 1)_steps_TAL_TRY_2024.4.15-19.21.gif
+ ...efineries/TAL/analyses/fermentation/TCI_animated_contourplot__(60, 60, 1)_steps_TAL_TRY_2024.4.15-19.21.gif
+21 −41 biorefineries/TAL/analyses/fermentation/TRY_analysis_TAL.py
+9 −7 biorefineries/TAL/analyses/full/1_uncertainties_TAL_solubility_exploit.py
+12 −27 biorefineries/TAL/analyses/production_operation/TALproductioncapacity_operatingdays.py
+2 −5 biorefineries/TAL/chemicals_data.py
+4 −6 biorefineries/TAL/models/models_TAL_solubility_exploit.py
+10 −49 biorefineries/TAL/process_areas.py
+1 −1 biorefineries/TAL/process_settings.py
+3 −7 biorefineries/TAL/systems/system_SA_solubility_exploit_ethanol_sugarcane.py
+0 −813 biorefineries/TAL/systems/system_SA_solubility_exploit_ethanol_sugarcane_new.py
+1 −1 biorefineries/TAL/systems/system_TAL_adsorption_sugarcane.py
+55 −91 biorefineries/TAL/systems/system_TAL_solubility_exploit_ethanol_sugarcane.py
+4 −4 biorefineries/TAL/units.py
+1 −1 biorefineries/__init__.py
+50 −50 biorefineries/cane/contour_plots.py
+ biorefineries/cane/images/metrics_biomass_yield_contours.png
+2,353 −3,636 biorefineries/cane/images/metrics_biomass_yield_contours.svg
+170 −5 biorefineries/cane/systems/fermentation.py
+160 −122 biorefineries/cane/uncertainty_plots.py
+2 −4 biorefineries/cane/units.py
+1 −1 biorefineries/cellulosic/systems/fermentation/cofermentation.py
+1 −372 biorefineries/cellulosic/systems/fermentation/general_interface.py
+1 −1 biorefineries/cellulosic/systems/fermentation/simultaneous_saccharification_cofermentation.py
+1 −1 biorefineries/succinic/analyses/TRY_analysis.py
+74 −157 biorefineries/tests/test_biorefineries.py
+2 −2 setup.py
2 changes: 1 addition & 1 deletion How2STEAM
11 changes: 7 additions & 4 deletions biosteam/units/aerated_bioreactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import numpy as np
from scipy.constants import g
import flexsolve as flx
from warnings import catch_warnings
from warnings import filterwarnings, catch_warnings
from scipy.optimize import minimize_scalar, minimize, least_squares
from biosteam.units.design_tools import aeration

Expand Down Expand Up @@ -582,7 +582,8 @@ def total_power_at_substrate_flow(F_substrates):
return total_power

f = total_power_at_substrate_flow
with catch_warnings(action='ignore'):
with catch_warnings():
filterwarnings('ignore')
results = minimize(f, 1.2 * SURs, bounds=bounds, tol=SURs.max() * 1e-6)
load_flow_rates(results.x / x_substrates)
else:
Expand All @@ -598,9 +599,11 @@ def gas_flow_rate_objective(F_substrates):

f = gas_flow_rate_objective
bounds = bounds.T
with catch_warnings(action='ignore'):
with catch_warnings():
filterwarnings('ignore')
results = least_squares(f, 1.2 * SURs, bounds=bounds, ftol=SURs.min() * 1e-6)
load_flow_rates(results.x / x_substrates)
load_flow_rates(results.x / x_substrates)


# self.show()
# breakpoint()
Expand Down

0 comments on commit 4ad5d9f

Please sign in to comment.