UCBerkeleySETI / blimpy

Breakthrough Listen I/O Methods for Python
https://blimpy.readthedocs.io
BSD 3-Clause "New" or "Revised" License
46 stars 40 forks source link

Allow use of software without installation. #58

Closed jeenriquez closed 6 years ago

jeenriquez commented 6 years ago

Can we leave the try except option? The except was there for the cases where people want to use blimpy without installing it, by just adding it to their PYTHONPATH.

So, can we change this last changes:

- try:
-    from .filterbank import Filterbank
-    from . import file_wrapper as fw
-    from .sigproc import *
- except:
-    from filterbank import Filterbank
-    import file_wrapper as fw
-    from sigproc import *
+ from blimpy.filterbank import Filterbank
+ from blimpy import file_wrapper as fw
+ from blimpy.sigproc import *

for this?

try:
   from blimpy.filterbank import Filterbank
   from blimpy import file_wrapper as fw
   from blimpy.sigproc import *
except:
    from filterbank import Filterbank
    import file_wrapper as fw
    from sigproc import *
gijzelaerr commented 6 years ago

That is the wrong usage of the PYTHONPATH. you need to add the parent to the PYHTHONPATH, not the blimpy folder.

jeenriquez commented 6 years ago

what do you mean with the parent?

gijzelaerr commented 6 years ago

the parent folder.

So if you did a git clone in your homefolder, set PYTHONPATH to ~/blimpy and import your modules like from blimpy import filterbank.

that try except is just terrible.