MineralsCloud / qha

A Python package for calculating thermodynamic properties under quasi-harmonic approximation, using data from ab-initio calculations
https://mineralscloud.github.io/qha/
GNU General Public License v3.0
27 stars 13 forks source link

Make scripts to be invoked more conveniently under multiple platform #4

Closed chazeon closed 6 years ago

chazeon commented 6 years ago

Something to consider: we could follow Python's official packages' organization in order that they can be more easily invoked. Good examples are http.server and pip, they could both be invoked with python -m, like:

python -m http.server

or

python -m pip

and pip could also be invoked as scripts under Unix based system. To allow python -m, we could move the main part of scripts/qha to qha/__main__.py, and scripts/qha-convert to qha/convert.py, thus they would be runnable use

python -m qha

or

python -m qha.convert

and create the scripts at the old places to invoke those two scripts.

We could refer to distributions of the official packages as examples.

singularitti commented 6 years ago

That was actually the first implementation of the qha/scripts/qha, I wrote something as qha/__main__.py. But later on I referred this, and decided to use a scripts folder and add them into setup.py. I think this is more intuitive to me. Do you have any problem of installing those scripts? I think

When we install the package, setuptools will copy the script to our PATH and make it available for general use.

according to the doc I pasted. And it is verified by me.

chazeon commented 6 years ago

Well, I think we could keep them both.

The script installed fine, they are copied to the righteous position, but under Windows, there is no way to start them directly because the way of open the file is determined based on extension, and that's what these two guys doesn't have.

singularitti commented 6 years ago

Could you please check whether bracnch release/v1.0.1 help to solve this issue? @chazeon

chazeon commented 6 years ago

Bracnch release/v1.0.1 resolves this issue.

singularitti commented 6 years ago

Thanks!