royallgroup / TCC

The Topological Cluster Classification algorithm
https://royallgroup.github.io/TCC/
GNU General Public License v3.0
12 stars 5 forks source link

importing python scripts #116

Closed yangyushi closed 5 years ago

yangyushi commented 5 years ago

In the python wrapper documentation, the code contains the follow import:

from tcc import wrapper
from file_readers import xyz

This will need two folders, TCC and TCC/tcc_python_scripts, being added to the PYTHONPATH, so that user can use both tcc_python_scripts and tcc inside the tcc_python_scripts. This can be counter intuitive.

Importing all the sub-packages inside TCC/tcc_python_scripts in the file TCC/tcc_python_scripts/__init__.py may be a way to make it better. Since users will be required to add only the TCC to the PYTHONPATH.

merrygoat commented 5 years ago

Thank you Yushi. I have been struggling to get this to work well and that is a very good idea. I will try that.

merrygoat commented 5 years ago

@yangyushi @tranqui I found some motivation to work on this at last!

It turns out that setuptools is an excellent way to deal with distribution of packages. I have implemented setuptools for the python scripts, tweaked a couple of the Python scripts a bit and updated the documentation.

It would be good if you could just have a go using the Python wrapper to see if that is better. The changes are in the setuptools branch. Note that the online documentation hasn't yet updated as it reads from the master branch, You will have to look at the documentation direct from the docs folder. To install the python scripts is just "pip install ." from the root folder.

All of the tests that use the wrapper have been broken. I will fix them tomorrow and also move the integration tests across to using the wrapper as well.

yangyushi commented 5 years ago

@merrygoat pip install . works for me!