Code Monkey home page Code Monkey logo

Comments (5)

yalinli2 avatar yalinli2 commented on June 24, 2024

Hi @jbolorinos , thanks for posting this issue! The problem actually comes from one of QSDsan's dependent package (BioSTEAM), it removed the _islinked property at a certain point.

Can you try to install the following versions: biosteam==2.32.6, thermosteam==0.28.8? It worked on my end, let me know if you still run into problems!

from qsdsan.

jbolorinos avatar jbolorinos commented on June 24, 2024

Thanks @yalinli2!

I installed those versions of biosteam and thermosteam and now, when I run the first line:

ins1 = qs.WasteStream(H2O=100)

I get the following:

`---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
Input In [7], in <cell line: 5>()
1 # Make three random influents, I'm deliberately using different ways to make these streams
2 # as a recap previous tutorials
3
4 # Method 1: by directly providing the flow rates of select components
----> 5 ins1 = qs.WasteStream(H2O=100)

File ~/.local/share/virtualenvs/energy_inflows-sTQfUhBs/lib/python3.9/site-packages/qsdsan/_waste_stream.py:276, in WasteStream.init(self, ID, flow, phase, T, P, units, price, thermo, pH, SAlk, COD, BOD, uBOD, ThOD, cnBOD, TC, TOC, TN, TKN, TP, TK, TMg, TCa, dry_mass, charge, ratios, stream_impact_item, **component_flows)
269 def init(self, ID='', flow=(), phase='l', T=298.15, P=101325.,
270 units='kg/hr', price=0., thermo=None,
271 pH=7., SAlk=2.5, COD=None, BOD=None, uBOD=None,
(...)
274 TMg=None, TCa=None, dry_mass=None, charge=None, ratios=None,
275 stream_impact_item=None, **component_flows):
--> 276 SanStream.init(self=self, ID=ID, flow=flow, phase=phase, T=T, P=P,
277 units=units, price=price, thermo=thermo,
278 stream_impact_item=stream_impact_item, **component_flows)
280 self._init_ws(pH, SAlk, COD, BOD, uBOD, TC, TOC, TN, TKN,
281 TP, TK, TMg, TCa, ThOD, cnBOD, dry_mass, charge, ratios)

File ~/.local/share/virtualenvs/energy_inflows-sTQfUhBs/lib/python3.9/site-packages/qsdsan/_sanstream.py:59, in SanStream.init(self, ID, flow, phase, T, P, units, price, thermo, stream_impact_item, **component_flows)
56 if 'impact_item' in component_flows.keys():
57 raise ValueError('The keyword impact_item is deprecated, '
58 'please use stream_impact_item instead.')
---> 59 super().init(ID=ID, flow=flow, phase=phase, T=T, P=P,
60 units=units, price=price, thermo=thermo,
61 **component_flows)
62 if stream_impact_item:
63 stream_impact_item._linked_stream = self

File ~/.local/share/virtualenvs/energy_inflows-sTQfUhBs/lib/python3.9/site-packages/thermosteam/_stream.py:270, in Stream.init(self, ID, flow, phase, T, P, units, price, total_flow, thermo, characterization_factors, **chemical_flows)
268 self.characterization_factors = {} if characterization_factors is None else {}
269 self._thermal_condition = tmo.ThermalCondition(T, P)
--> 270 thermo = self._load_thermo(thermo)
271 chemicals = thermo.chemicals
272 self.price = price

File ~/.local/share/virtualenvs/energy_inflows-sTQfUhBs/lib/python3.9/site-packages/thermosteam/utils/decorators/thermo_user.py:22, in _load_thermo(self, thermo)
21 def _load_thermo(self, thermo):
---> 22 self._thermo = thermo = tmo.settings.get_default_thermo(thermo)
23 return thermo

File ~/.local/share/virtualenvs/energy_inflows-sTQfUhBs/lib/python3.9/site-packages/thermosteam/_settings.py:74, in Settings.get_default_thermo(self, thermo)
68 def get_default_thermo(self, thermo):
69 """
70 Return default Thermo object if thermo is None. Otherwise, return
71 the same object.
72
73 """
---> 74 return thermo if thermo else self.get_thermo()

File ~/.local/share/virtualenvs/energy_inflows-sTQfUhBs/lib/python3.9/site-packages/thermosteam/_settings.py:130, in Settings.get_thermo(self)
128 """Return a default Thermo object."""
129 thermo = self._thermo
--> 130 if not thermo: raise_no_thermo_error()
131 return thermo

File ~/.local/share/virtualenvs/energy_inflows-sTQfUhBs/lib/python3.9/site-packages/thermosteam/_settings.py:16, in raise_no_thermo_error()
15 def raise_no_thermo_error():
---> 16 raise RuntimeError("no available 'Thermo' object; "
17 "use settings.set_thermo")

RuntimeError: no available 'Thermo' object; use settings.set_thermo

`

I get the same error if I use qsdsan 0.3.5

from qsdsan.

yalinli2 avatar yalinli2 commented on June 24, 2024

Hi @jbolorinos , the issue comes exactly from what the message says - you'll need to set the CompiledComponents object so that QSDsan knows what components you'll want to work with in the system (only including the components you want helps speed things up), see the note in Cell 3 in the WasteStream tutorial

is it possible that you didn't run Cell 11 (specifically, the qs.set_thermo(cmps) line)?

BTW, we'll start up the weekly QSDsan office hour soon (Mondays 4-5pm CT, either the coming Monday or the Monday after), we will send out a group email once we schedule it, I can make sure you get the notice if you are interested :)

If you want help before that, we can have a Zoom call this week, just let me know!

from qsdsan.

jbolorinos avatar jbolorinos commented on June 24, 2024

Hi @yalinli2,

Yes it was exactly that (apologies), forgot to run that line after restarting my notebook kernel. Got it working with qsdsan==1.2.0, biosteam==2.32.6 and thermosteam==0.28.8.

Really appreciate the help! And I would definitely be interested in getting the office hours notice (intend to use QSDSAN for my research), email is [email protected]

from qsdsan.

yalinli2 avatar yalinli2 commented on June 24, 2024

@jbolorinos sure thing! I just added you to QSDsan's newsletter group (feel free to unsubscribe whenever you want :) ) so you'll get important updates. We should send out the announcement before/during the weekend.

I'll close this issue since you got things working, but feel free to reopen/post new ones!

from qsdsan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.