Open slimguat opened 3 months ago
to clarify, do you have an chianitrc file and if so where it it?
I don't know what is this file exactly and where it is supposed to be. So where should I search for it? BTW: I work with the database CHIANTI_10.0.2_database that's in my C:/ drive.
It is a file that set some default values. You have to actually put it in the #HOME/.config or the #HOME/.chianti directory manually. Since you have not done this you do not have the file.
I have not run chiantipy under 3.12 but will try that this morning. I do not have any problems with 3.10 or 3.11
Ken
I can not reproduce this under Python 3.12 so I am puzzled.
I am using the latest CHIANTI version 10.1 but I also tried CHIANTI version 10.0 and things still worked.
My best suggestion is to see if editing your version of defaultsRead works for you
Ken
another thing you might try is to see if XUVTOP is properly set
import ChiantiPy.tools.constants as chconst
and
import ChiantiPy.tools.io as chio
lvl = chio.elvlcRead('c_4')
I believe I have identified the root of the issue. It appears to be related to the Jupyter notebook environment I am using with Python 3.12. Specifically, the Jupyter server is incorrectly identifying the existence of a file when the os.path.isfile function is called with a boolean False value. This behavior seems to occur because, in Unix systems, the boolean False is equivalent to 0, which in turn corresponds to '/' (the root directory). As a result, os.path.isfile(False) is returning True.
However, this issue appears to be specific to Jupyter notebooks running Python 3.12 or later. I did not observe the same behavior when running the script directly in a terminal. Therefore, I believe this issue is not related to ChiantiPy, but rather to the interaction between Python 3.12 and the Jupyter environment.
I am running python 3.12.4 in a virtulall environment and do no have the problem. I checked my PYTHONPATH and it looks pretty clean. and, yes I do run linux.
thanks for letting me know.
Ken
Upon importing
ChiantiPy.tools.data
I have this errorFrom what I understand, in io.py>defaultsRead function rcfile is
False
and right after there is a check for a file existanceos.path.isfile(rcfile)
that actually checks with rcfile beingFalse
. so I think there might be a need to change rcfile toNone
instead or change the check fromif os.path.isfile(rcfile):
toif os.path.isfile(rcfile) and (rcfile!=False) :
I am on Windows 11 x64, Python 3.12.3 ChiantiPy 0.15.1