gaia-dpci / GaiaXPy

Gaia BP/RP spectra package
BSD 3-Clause "New" or "Revised" License
36 stars 9 forks source link

Basic usage examples failing #65

Closed bmorris3 closed 10 months ago

bmorris3 commented 10 months ago

I've installed GaiaXPy, both via pip and from source, and run:

from gaiaxpy import generic_function

as the docs recommend. I'm getting the following error:

ImportError: cannot import name 'generic_function' from 'gaiaxpy' (/Users/bmmorris/miniconda3/envs/research3/lib/python3.10/site-packages/gaiaxpy/__init__.py)

Desktop:

druzm commented 10 months ago

Hi, generic_function is used as a placeholder for any of the main functions in the package (calibrate, convert, etc.) As most functions shared many of the same parameters, the use of generic_function avoids duplication in the documentation. There's a note about this right above the section of the page your link points to (no worries, it happens.)

You can find more detailed tutorials on this link. The linefinder is only available through a development branch at this point.

bmorris3 commented 10 months ago

Ah, I see. I find it quite confusing to have "code" examples that are not code! Thanks 😄

druzm commented 10 months ago

Yes. We added the note to try to clarify this point, but I understand it may be confusing if you're just trying the package and trying to run some basic code just to see it work. At the same time, adding the same instructions for every function would be unnecessarily long.

At least in the official docs and not in the RST file, the note is more visible.

Let me know if you get any idea of how to avoid this problem. This is the best solution we could find.