Closed jbarnoud closed 6 years ago
Note: for development purpose, I recommend installing the package with the '-e' option of pip. Then, pip creates a link to the package instead of copying the files. It means that changes made to the code in the repository are directly accessible without having to reinstall.
To do so I had to change a bit the organization of the repository. I moved the python module in the new "polyply" directory, but I let the metadata files (README, etc) at the top level of the repository for github to find them.
I moved polyply.py in the new "bin" directory. I renamed the script "polyply" instead of "polyply.py" as it was referred at under the former name in the README, and because it was causing conflicts with the module being called polyply.
Initially by mistake, but also for aesthetic reasons, I renamed the module polyply. Importing the module is therefore done with
instead of
With this commit, PolyPly can be installed using pip by calling
More easily, when in the Martini_PolyPly directory, the module can be installed with
The development version can be installed directly from github with
The polyply module then becomes available for import with
The polyply script is made accessible in the research PATH, and can be called from anywhere.
The path to the distributed data was making wrong assumptions regarding the location of the polyply script relative to the data. This PR creates a
polyply.DATA_PATH
variable that should always point toward the right place. Update the variable is the data are moved.Also, this PR replaces path concatenation (using
+
on strings) byos.path.join
. The latter method makes it more robust to join path. It, for instance, avoids to make assumption on the presence or not of a / at the end of the path elements.This PR adapts test.sh to called polyply with the installed version. It also remove the direct calls to "python3.5" in the same file.
Calling a specific version of python can make things break when the user uses a different version of python, or when using virtual/conda environment.
Also, calling "python polyply" will break as it circumvent the research PATH, and therefore does not know where to look for the script.