gustavochm / sgtpy Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
Dear Gustavo,
I have a problem with installing sgtpy:
pip3 install sgtpy
Defaulting to user installation because normal site-packages is not writeable
Collecting sgtpy
Using cached sgtpy-0.0.15.tar.gz (165 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [8 lines of output]
running egg_info
creating /tmp/pip-pip-egg-info-9vochw75/sgtpy.egg-info
writing /tmp/pip-pip-egg-info-9vochw75/sgtpy.egg-info/PKG-INFO
writing dependency_links to /tmp/pip-pip-egg-info-9vochw75/sgtpy.egg-info/dependency_links.txt
writing requirements to /tmp/pip-pip-egg-info-9vochw75/sgtpy.egg-info/requires.txt
writing top-level names to /tmp/pip-pip-egg-info-9vochw75/sgtpy.egg-info/top_level.txt
writing manifest file '/tmp/pip-pip-egg-info-9vochw75/sgtpy.egg-info/SOURCES.txt'
error: package directory 'sgtpy' does not exist
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
Thank you for your help.
Hello Gustavo.
I just ran the creating components and mixtures example for saft gamma mie provide in the documentation. It ran fine when I calculating the density of water. However there was a ValueError for benzene. Here is my calculation code:
benzene = component(GC={'aCH':6})
benzene.saftgammamie()
eos = saftgammamie(benzene)
T = 373. # K
P = 1e5 # Pa
rhol = eos.density(T, P, 'L')
print(rhol)
According to the example, I need to create a dictionary using the group's names as keys and the numbers of times this group is present as values. But according to my code above, the program cannot proceed. I can't find a solution. Can you give me an example of computing density of benzene.
Thank you very much.
Best whises!
Hello, maybe not suitable for posting here.
I'm currently wondenring for a new component such as H2O2, if I need to regress and check the phase equilibrium between H2O2 and methanol.
The first step is try to add a new componetn H2O2 into the database along with the regressed pure component data. From the group point of view, will H2O2 = OH + OH work? if this works, than maybe we need to follow the example 14_fit_phase_equilibria_cross_association_water_ethanol?
Thansk.
error like below
C:\Users\cools\AppData\Roaming\Python\Python311\site-packages\sgtpy\sgt\sgtpure.py:65: RuntimeWarning: invalid value encountered in sqrt
tenint = np.nan_to_num(np.sqrt(2*dOm))
In saftgamma_database.xlsx, sheet groups, row 53 there is a group named HCO- but it seems to me it was meant to be formate HCOO-.
Hi I'm on ubuntu and have python3 installed. I can't run the pip install it gets an error when it trys to run the setup.py file. Its a command error. Any idea on how to get around this.
Hello Gustavo,
I encountered an IndexError while trying to compute get_lngamma of a mixture with saftgammamie.
When I run this code:
from sgtpy import component, mixture, saftgammamie
comp1 = component(GC={'aCH':8,'C':4,'[CH2][OCH2]':1})
comp2 = component(GC={"CH3":2, "CH2":1, "COO":1})
mix = comp1+comp2
mix.saftgammamie()
eos = saftgammamie(mix)
eos.get_lngamma([0.1, 0.9], 320, 101325)
It throws the call stack with the bottom being:
File "/usr/local/lib/python3.10/dist-packages/sgtpy-0.0.15-py3.10-linux-x86_64.egg/sgtpy/gammamie_mixtures/ares.py", line 483, in d2ares_drho
Dijklab[self.indexABij] *= Iijklab[self.indexAB_id]
IndexError: arrays used as indices must be of integer (or boolean) type
I know I am using the ether group without CH2 groups.
Do you know how I could make it compute?
Thank you very much for providing this resource and the support for it.
Have a nice day
Kycilak
Congratulations to author; I am using sgtpy
on Android via Termux. And it works great.
With many notebook examples this library is a must have. I hope author remains in good health & keep this project alive
Hello Gustavo.
I just ran the n-hexane parameter estimation example provided in the documentation (page 43). It ran fine, I got the same set of values. However there was a RunTimeWarning alert for the ideal Helmholtz computation:
SAFTpkgs/lib/python3.9/site-packages/sgtpy/vrmie_pure/ideal.py:25: RuntimeWarning: invalid value encountered in log a = np.log(rho * broglie_vol**3) - 1
Is there something that could be done to suppress this alert? I am just wondering if this causes any accuracy problems to the computation.
Also, the solver happens to be rather sensitive to the data input type: there was an error if I had input the attractive exponent without the decimal.
ValueError: Integers to negative integer powers are not allowed.
Thank you.
Best wishes,
JY
Currently the source directory is name 'sgtpy' but the package is named 'SGTPy'. This works on some, like Mac OS and Windows, but not on Linux, where I can only do 'import sgtpy' and not import 'SGTPy' but on Mac OS I can only do 'import SGTPy' but not 'import sgtpy'.
It's apparently standard to use all lowercase module names get around this, see here:
https://stackoverflow.com/questions/43130046/capitalization-standards-in-importing-in-python
I currently get around that issue by renaming my source folder on Linux (which is not ideal, but works), but long term for other people to use it would be easier to use the standard of all lowercase package naming.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.