Analysis tools using xarray for OPERA Surface Displacement from Sentinel-1 (DISP-S1) and Surface Displacement from NISAR (DISP-NISAR).
- Download source code:
git clone https://github.com/opera-adt/disp-xr.git- Install dependencies, either to a new environment:
mamba env create --name disp_xr --file disp-xr/environment.yml
conda activate disp_xror install within your existing env with mamba.
- Install
disp_xrvia pip in editable mode
python -m pip install --no-deps -e disp-xrWe use pre-commit to automatically run linting, formatting, and mypy type checking.
Additionally, we follow numpydoc conventions for docstrings.
To install pre-commit locally, run:
pre-commit installThis adds a pre-commit hooks so that linting/formatting is done automatically. If code does not pass the checks, you will be prompted to fix it before committing.
Remember to re-add any files you want to commit which have been altered by pre-commit. You can do this by re-running git add on the files.
Since we use black for formatting and flake8 for linting, it can be helpful to install these plugins into your editor so that code gets formatted and linted as you save.
NOTE: ADD TESTS
After making functional changes and/or have added new tests, you should run pytest to check that everything is working as expected.
First, install the extra test dependencies:
python -m pip install --no-deps -e .[test]Then run the tests:
pytest