Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[refactor] make s2p a python package that can be installed with pip #198

Merged
merged 26 commits into from
Mar 15, 2019

Conversation

carlodef
Copy link
Contributor

@carlodef carlodef commented Mar 1, 2019

This pull request reorganises the sources in order to make s2p installable with pip. The main changes are:

  • s2p is now a python package (instead of a python module)
  • the folder s2plib was renamed to s2p
  • the file s2p.py has disappeared and its content is split among s2p/__init__.py (most of the code) and s2p/cli.py (command line parsing code)
  • when one installs s2p with pip, a CLI tool named s2p becomes available in the system PATH
  • the file s2p_test.py was moved to tests/test_s2p.py
  • the folder testdata was moved to tests/data
  • the README has been updated with simpler install instructions and CLI usage examples

Python codes that depend on s2p should not be affected: import s2p still works in the same way.

Shell scripts running python /path/to/your/clone/of/s2p/s2p.py should be updated to run instead s2p as a standalone command line tool.

This pull request contains the changes of pull request #191.

EDIT: A source distribution of s2p corresponding to this branch's version is available on PyPI and can be installed with pip:

pip install s2p

@jmichel-otb
Copy link
Member

I think there should be only a few minor conflicts with #196:

  • Name of the data dir
  • Imports (unlikely)
  • Calls to read_config_file and main in s2p.py

from s2p import masking
from s2p import triangulation
from s2p import fusion
from s2p import visualisation


def pointing_correction(tile, i):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe those functions should not be in init but in a dedicated module in s2p package no ? If we were to write tests for each of them, how would we proceed ?

@jmichel-otb
Copy link
Member

I just did a merge by hand with #196 and it is fairly easy. There are a few minor conflicts on .travis.yaml and imports needs to be changed from s2plib to s2p in tests folder.

@jmichel-otb jmichel-otb merged commit 445d67c into MISS3D:master Mar 15, 2019
@carlodef carlodef deleted the python_packaging branch March 15, 2019 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants