Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip install exposan leads to _heat_exchanging.py out of date #102

Closed
hccroll opened this issue Jun 21, 2023 · 2 comments
Closed

pip install exposan leads to _heat_exchanging.py out of date #102

hccroll opened this issue Jun 21, 2023 · 2 comments
Assignees

Comments

@hccroll
Copy link

hccroll commented Jun 21, 2023

I recently installed exposan with the intent to simulate the BSM1 WWTF process. I used pip install exposan --user to avoid needing to uninstall other libraries.

Upon attempting to run from exposan import bsm1 I received the following error:

ModuleNotFoundError                       Traceback (most recent call last)
Cell In[1], line 1
----> 1 from exposan import bsm1

File ~\AppData\Roaming\Python\Python310\site-packages\exposan\__init__.py:25
     22 es_path = os.path.dirname(__file__)
     23 del os, pkg_resources
---> 25 from . import utils

File ~\AppData\Roaming\Python\Python310\site-packages\exposan\utils.py:23
     21 from chaospy import distributions as shape
     22 from thermosteam.functional import rho_to_V
---> 23 from qsdsan import ImpactItem, sanunits as su
     24 from qsdsan.utils import time_printer, AttrSetter
     25 from . import es_path

File ~\AppData\Roaming\Python\Python310\site-packages\qsdsan\__init__.py:72
     68 from ._tea import *
     69 from ._lca import *
---> 72 from . import (
     73     _component,
     74     _components,
     75     _construction,
     76     _equipment,
     77     _impact_indicator,
     78     _impact_item,
     79     _lca,
     80     _process,
     81     _sanstream,
     82     _sanunit,
     83     _tea,
     84     _transportation,
     85     _waste_stream,
     86     equipments,
     87     processes,
     88     sanunits,
     89     stats,
     90     )
     92 utils._secondary_importing()
     93 for _slot in utils.doc_examples.__all__:

File ~\AppData\Roaming\Python\Python310\site-packages\qsdsan\sanunits\__init__.py:44
     42 from ._encapsulation_bioreactor import *
     43 from ._excretion import *
---> 44 from ._heat_exchanging import *
     45 from ._junction import *
     46 from ._non_reactive import *

File ~\AppData\Roaming\Python\Python310\site-packages\qsdsan\sanunits\_heat_exchanging.py:27
     25 from math import ceil, pi
     26 from biosteam.units import HXprocess as HXP, HXutility as HXU
---> 27 from biosteam.units.facilities import HeatExchangerNetwork as HXN
     28 from biosteam.units.design_tools.specification_factors import material_densities_lb_per_ft3
     29 from biosteam.exceptions import bounds_warning, DesignWarning

ModuleNotFoundError: No module named 'biosteam.units.facilities'

Looking at the native _heat_exchanging.py file in QSDsan, it looks like the import lines do not match with the version installed through original pip command.

Native QSDsan File:

from warnings import warn
from math import ceil, pi
from biosteam import HeatExchangerNetwork as HXN, HXprocess as HXP, HXutility as HXU
from biosteam.units.design_tools.specification_factors import material_densities_lb_per_ft3
from biosteam.exceptions import bounds_warning, DesignWarning
from biosteam.units.design_tools import flash_vessel_design
from .. import SanUnit, Construction
from ..utils import auom

Pip download File:

import biosteam as bst
from warnings import warn
from math import ceil, pi
from biosteam.units import HXprocess as HXP, HXutility as HXU
from biosteam.units.facilities import HeatExchangerNetwork as HXN
from biosteam.units.design_tools.specification_factors import material_densities_lb_per_ft3
from biosteam.exceptions import bounds_warning, DesignWarning
from biosteam.units.design_tools import flash_vessel_design
from .. import SanUnit, Construction
from ..utils import auom

Replacing the downloaded block with the native block fixes the error, and I was able to reproduce the dynamic simulation example, though I have not yet tested additional simulations.

Versions of the following packages:
- QSDsan: 1.2.5
- EXPOsan: 1.2.5
- BioSTEAM: 2.37.3
- Thermosteam: 0.35.0

Operating on windows 11

@yalinli2
Copy link
Member

Thanks @hccroll for reporting this! Yea the pip version is really outdated, biosteam reorganized the modules at some point. I'll leave this issue until I release a new version, which hopefully will happen within the next week.

@yalinli2 yalinli2 self-assigned this Jun 21, 2023
@yalinli2
Copy link
Member

Just released v1.3.0 and this should be fixed now, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants