MolSSI-Education / QM_2017_SSS_Team11

BSD 3-Clause "New" or "Revised" License
0 stars 4 forks source link

Awkward importing #41

Open bennybp opened 7 years ago

bennybp commented 7 years ago

In SCF.py, do you really need the second block (ie, does the first part ever raise an exception?). If it does, there should be a better way to do this

try:
    from . import params
    from . import diis
    from . import jk
except SystemError:
    import params
    import diis
    import jk
bgpeyton commented 7 years ago

This is something I've been meaning to ask about. We sort of hacked this together for now. The problem arises because when we import in our test functions, we need to do it as shown in the top block. But, when trying to run the code as a script (running python SCF.py) we have to have our imports set up as in the bottom block.

bennybp commented 7 years ago

Oh I see. Typically, you don't mix library functionality with command line functionality like that. Usually a script is either part of a library, or meant to be run directly.

kml5480 commented 7 years ago

I think we should leave it as is for now to allow us to test the code to the fullest ability. Once the code does everything we want it to, we can circle back around to whether we want input to come from a "params" file or command line input. Personally, I'm partial to the idea of input files because I think they are less susceptible to mistakes (they can be read over multiple times before a job is submitted) but it's a conversation worth having.