Python Forum
How to import the name of the fluid in CoolProp from an yml file
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to import the name of the fluid in CoolProp from an yml file
#1
Hello!
I have a file with this class

class AAA:

    def __init__(self,data):
   
        #self.fluid = data['fluid']
        self.H_p = data['H_p']
        self.P_p = data['P_p']

    def Calculate(self):
    
        self.T_wf = TempCalc(self.H_p,self.P_p)
where TempCalc is the function

def TempCalc(h,p):
    T_wf = PropsSI('T','H',h,'P',p,'air')
    return T_wf
that I have in another file.
It works, but I'd like to import also the name of the fluid (that I wrote in the .yml file with other inputs) and use it as input in PropsSI (CoolProp) instead of 'air'.
I tried with the above commented line and then I replaced 'air' with fluid, but it doesn't work.
Could someone suggest me a method to make it works?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Video doing data treatment on a file import-parsing a variable EmBeck87 15 2,669 Apr-17-2023, 06:54 PM
Last Post: EmBeck87
  Import XML file directly into Excel spreadsheet demdej 0 801 Jan-24-2023, 02:48 PM
Last Post: demdej
  How from sklearn.datasets import load_diabetes change to import to CSV file Anldra12 0 1,814 Dec-25-2021, 07:20 PM
Last Post: Anldra12
  How to import file and function in another folder SriRajesh 1 3,079 Dec-18-2021, 08:35 AM
Last Post: Gribouillis
  Python - Import file sequence into Media Pool jensenni 1 2,081 Feb-02-2021, 05:11 PM
Last Post: buran
Smile Import error with local file colt 1 1,878 Nov-08-2020, 07:56 AM
Last Post: Gribouillis
  Code import .CSV file to MySQL table rtakle 4 2,803 Apr-30-2020, 03:16 PM
Last Post: anbu23
  Regarding import library in two different program file Rohit 3 2,408 Jan-22-2020, 07:14 AM
Last Post: buran
  How do you import a dictionary from a .csv file? SteampunkMaverick12 2 2,175 Jul-29-2019, 09:20 AM
Last Post: sudheerm
  looking for sample py to read from txt file into XML using lxml import etree venkat18 3 2,934 Jun-02-2019, 04:34 AM
Last Post: venkat18

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020