babbush / HistoricalFermiLib

This is repo where we developed FermiLib, which then became OpenFermion
Apache License 2.0
1 stars 0 forks source link

Set up proper python package structure #26

Closed maffoo closed 7 years ago

maffoo commented 7 years ago

Currently the code is in a directory called src so if you have the repo checked out and on the python path you'd have to import things from a package called src, which is not ideal.

My suggestion: move code into src/fermilib and then include a note in the readme that when running from source the user should put <checkout_dir>/src on the python path. Then can do things like from fermilib import chemical_series.

Another option would be to just rename the existing src folder to fermilib and recommend that people put the checkout directory onto the python path directly, however, there are some advantages to putting code into a subdirectory like src, especially in dev setups where you might want to have compiled extensions.

damiansteiger commented 7 years ago

Agree. We will move the parts which need to be compiled to the ProjectQ repo (also for other reasons) and hence we could rename the src folder to fermilib as no installation will be required.

thomashaener commented 7 years ago

I think we should also consider grouping modules into subpackages to clean up the fermilib directory and having a separate directory for examples would make the distinction between library code and code using the library a bit clearer.

babbush commented 7 years ago

Sounds good to me. This will a step in the ProjectQ / FermiLib integration that we're going to be working on pretty seriously in April.

babbush commented 7 years ago

I moved things around a little bit to separate actual source from examples. But eventually we will still do what Mathew suggests.