qutip / qutip-tensorflow

TensorFlow linear-algebra backend for QuTiP
BSD 3-Clause "New" or "Revised" License
15 stars 9 forks source link

Create initial Python package skeleton #1

Closed jakelishman closed 3 years ago

jakelishman commented 3 years ago

This sets up a basic Python skeleton for a package. It has single-source versioning, a readme, licence, code of conduct, etc. It includes the current recommended set of Python metadata files, and a basic __init__.py and (autogenerated) version.py so the built package can be imported.

AGaliciaMartinez commented 3 years ago

Thank you for the comments and for clarifying my questions!! I will now merge this pull request.

jakelishman commented 3 years ago

The src directory is technically (almost) never a requirement for a Python package*, so there's quite a school of thought who say "it's meaningless detritus, so it's better to skip it". This is usually my approach in most of programming, but I've more recently been moving in favour of a src directory in packaging. It has the advantages that you can it makes quite a lot of discovery-based options (e.g. setup.py, MANIFEST.in) really easy for a similar reason, especially if there are multiple packages in the repository. That's a pretty minor reason, but the advantages of not having a src directory are at least as small, so it's pretty easy to argue in favour of either.

Consistency is good; in this case, we're actually being a bit more consistent with newer QuTiP packages, and it's more like qutip/qutip is the odd-one-out for the time being. That said, this isn't really a user-facing thing, so we don't necessarily have to fee like our hands are tied by a requirement to be consistent (though it's still desirable).

_* if you wanted to create a package called build, dist, tests or doc or something like that, you'd need a separate directory._