telmonteiro / SAITAMA

1 stars 0 forks source link

pyrhk dependence #1

Open sousasag opened 3 months ago

sousasag commented 3 months ago

Not clear how to solve this issue:

Traceback (most recent call last): File "/home/sousasag/Programas/GIT_projects/Others/PEEC-24/ACTINometer.py", line 79, in from pyrhk.pyrhk import calc_smw, get_bv, calc_rhk, calc_prot_age ModuleNotFoundError: No module named 'pyrhk'

Maybe a good solution could be to include it here as a nested repository / submodule...

telmonteiro commented 2 months ago

pyrhk is not formatted as a downloadable package (no setup.py), so I couldn't find a way to link it as a submodule. For this reason, for now the pyrhk files are included in the same repository as this work.

sousasag commented 1 week ago

I see pyrhk inside pipeline functions, but the import is not going there. I have the error:

python SAITAMA_run.py 
Traceback (most recent call last):
  File "/home/sousasag/Programas/GIT_projects/Others/SAITAMA/SAITAMA_run.py", line 15, in <module>
    from SAITAMA import SAITAMA
  File "/home/sousasag/Programas/GIT_projects/Others/SAITAMA/SAITAMA.py", line 67, in <module>
    from pipeline_functions.general_funcs import (read_fits, plot_line, stats_indice, plot_RV_indices, sigma_clip, instrument_fits_file, 
  File "/home/sousasag/Programas/GIT_projects/Others/SAITAMA/pipeline_functions/general_funcs.py", line 10, in <module>
    from pyrhk.pyrhk import calc_smw, get_bv, calc_rhk, calc_prot_age
ModuleNotFoundError: No module named 'pyrhk'

I overcome the error by creating a symbolic link to the folder (in SAITAMA location I did:): ln -s pipeline_functions/pyrhk

telmonteiro commented 1 week ago

A quick fix implemented was to add import sys, os sys.path.insert(0, os.path.abspath(os.path.dirname(__file__))) at the beggining of the general_funcs.py file. This way, the "absolute path" is used.