Skip to content

Commit

Permalink
pre-beta release
Browse files Browse the repository at this point in the history
  • Loading branch information
szymon-datalions committed Aug 31, 2020
1 parent 7074d89 commit f3cb34f
Show file tree
Hide file tree
Showing 103 changed files with 5,244 additions and 3,995 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
*.ipynb linguist-language=Python
*.ipynb linguist-detectable=false
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
eo/
test_cases/
scripts/
new_concepts/
tests/

# OS generated files #
.DS_Store
Expand Down Expand Up @@ -229,4 +231,3 @@ GitHub.sublime-settings
.history

# End of https://www.gitignore.io/api/pydev,python,pycharm,sublimetext,jupyternotebook,visualstudiocode

27 changes: 27 additions & 0 deletions DATA_STRUCTURE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Data Structure
==============

Library works with geospatial datasets but they could be different from project to project. To ensure stable calculations specific data structures must be preserved by all scripts. Here we have gathered all data structures used by the library:

POINTS:
------

Points are usually described only by their coordinates and value measured at a given location:

> [coordinate x, coordinate y, value] --> [float, float, float or int]


AREAS:
------

Areas (polygons) are more complex than points and they are described by their id (optional parameter), geometry (shapely.geometry.polygon.Polygon), centroid, value:

> [area id name, [geometry ... ... ... ... ...], [centroid coordinate x, centroid coordinate y], value] --> [str or int, Polygon, list, float or int]


POINTS WITHIN AREA:
-------------------

Points within area are described by the area id and a list of all points coordinates and their values:

> [area id name, [[coordinate x, coordinate y, value], ..., [coordinate x, coordinate y, value]]]
25 changes: 8 additions & 17 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
MIT License
BSD 3-Clause "New" or "Revised" License

Copyright (c) 2018 Szymon Moliński, Data Lions
Copyright (c) 2018-2020, Pyinterpolate Developers / Data Lions

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
All rights reserved.

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of the Pyinterpolate Developers Team and/or Data Lions company nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
89 changes: 89 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
PyInterpolate
=============

PyInterpolate is designed as the Python library for geostatistics. It's role is to provide access to spatial statistics tools used in a wide range of studies.


Status
------

Pre-Beta version: package is tested and the main structure is preserved but future changes are very likely to occur. Look into projects and issues tab to learn more.


Setup
-----

Setup is described in the file SETUP.md

Commercial and scientific projects where library has been used
--------------------------------------------------------------

* Tick-Borne Disease Detector (Data Lions company) for the European Space Agency (2019-2020).

Community
---------

Join our community in Dicord: https://discord.gg/3EMuRkj


Bibliography
------------

PyInterpolate was created thanks to many resources and all of them are pointed here:

- Armstrong M., Basic Linear Geostatistics, Springer 1998,
- GIS Algorithms by Ningchuan Xiao: https://uk.sagepub.com/en-gb/eur/gis-algorithms/book241284
- Pardo-Iguzquiza E., VARFIT: a fortran-77 program for fitting variogram models by weighted least squares, Computers & Geosciences 25, 251-261, 1999,
- Goovaerts P., Kriging and Semivariogram Deconvolution in the Presence of Irregular Geographical Units, Mathematical Geology 40(1), 101-128, 2008
- Deutsch C.V., Correcting for Negative Weights in Ordinary Kriging, Computers & Geosciences Vol.22, No.7, pp. 765-773, 1996

Requirements and dependencies
-----------------------------

* Python 3.7.6

* Numpy 1.18.3

* Scipy 1.4.1

* GeoPandas 0.7.0

* Fiona 1.18.13.post1 (Mac OS) / Fiona 1.8 (Linux)

* Rtree 0.9.4 (Mac OS), Rtree >= 0.8 & < 0.9 (Linux)

* Descartes 1.1.0

* Pyproj 2.6.0

* Shapely 1.7.0

* Matplotlib 3.2.1

Package structure
-----------------

High level overview:

::

- [ ] pyinterpolate
- [x] **calculations** - distance calculation
- [x] **data_processing** - preparation of spatial data and data processing tasks,
- [x] **data visualization** - interpolation of smooth surfaces as rasters,
- [x] **kriging** - Ordinary Kriging, Simple Kriging, Poisson Kriging: centroid based, area-to-area, area-to-point,
- [x] **misc** - compare different kriging techniques,
- [x] **semivariance** - calculate semivariance, fit semivariograms and regularize semivariogram,
- [x] **tutorials** - tutorials (Basic, Intermediate and Advanced)

Development
===========

- poisson kriging tutorials,
- inverse distance weighting,
- documentation

Known Bugs
==========

-
95 changes: 0 additions & 95 deletions README.rst

This file was deleted.

75 changes: 75 additions & 0 deletions SETUP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
Installation
------------

Package is working with linux and mac os systems. To install it download package and open it in the terminal then type:

```
pip install ./
```

This command runs **setup.py** file inside package and install requirements from the list provided there. Currently it is
the only way to install a package.

*****

> I'd like to run Jupyter Notebooks, what should I do?
*****

There is an additional step to run this library in Jupyter Notebooks. Before using pip you have to create conda
environment and install required dependencies:

#### Step 1:

```
conda create -n [NAME OF YOUR ENV]
```

#### Step 2:

```
conda activate [NAME OF YOUR ENV]
```

#### Step 3:

```
conda install -c conda-forge python=3.7 pip notebook
```

#### Step 4:

```
pip install ./
```

Now you are able to run library from conda notebooks.

*****

> libspatialindex_c.so dependency error
*****

Sometimes **rtree** (and / or **GeoPandas**) which are requirements for pyinterpolate may be not installed properly
because your operating system does not have **libspatialindex_c.so** file. In this case install it from terminal:

LINUX:

```
sudo apt install libspatialindex-dev
```

MAC OS:

```
brew install spatialindex
```

*****

> Do you plan to simplify installation?
*****

Answer is: yes, we do. Check status in Issues tab in the project Github.
1 change: 1 addition & 0 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = '0.2.0'
1 change: 0 additions & 1 deletion bin/activate

This file was deleted.

1 change: 0 additions & 1 deletion bin/conda

This file was deleted.

1 change: 0 additions & 1 deletion bin/deactivate

This file was deleted.

Loading

0 comments on commit f3cb34f

Please sign in to comment.