Skip to content

Commit

Permalink
Separate dem package (#84)
Browse files Browse the repository at this point in the history
* refactor dem method names to snake case

* add d8 validation data

* add d8 validation data

* refactor the slope calculation in the flow direction method

* separate fill sinks to a separate method

* refactor

* refactor

* test slope

* separate the flow_direction cell index loop from the slope loop in calculate_slope method

* separate flow direction routine to multiple methods

* update elevation validation array

* add missing data

* restructure the DEM class

* refactor

* add flow direction and flow accumulation methods

* refactor

* add documentations

* add missing data

* move data and files to the new repo digital-rivers

* exclude gdal 3.9.0

* fix gdal to 3.8.4

* move dem fixtures to the new repo

* update checklist files

* update scheme
  • Loading branch information
MAfarrag authored Feb 19, 2024
1 parent e7e3bbe commit 585d339
Show file tree
Hide file tree
Showing 19 changed files with 171 additions and 842 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pypi-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install --no-cache-dir Cython
pip install --find-links=https://girder.github.io/large_image_wheels --no-cache GDAL #==3.7.1
pip install --find-links=https://girder.github.io/large_image_wheels --no-cache GDAL==3.8.4
- name: Test GDAL installation
run: |
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install --no-cache-dir Cython
pip install --find-links=https://girder.github.io/large_image_wheels --no-cache GDAL #==3.7.1
pip install --find-links=https://girder.github.io/large_image_wheels --no-cache GDAL==3.8.4
- name: Test GDAL installation
run: |
Expand Down
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ venv.bak/
.spyderproject
.spyproject

*.npy
#*.npy
*.pkl

# conda smithy ci-skeleton start
Expand Down Expand Up @@ -162,3 +162,9 @@ tests/data/raster-folder-coello/*
examples/old/*
tests/data/not-used/*
*.xml
/tests/data/delete/central-europe.geojson
/tests/data/delete/delta.geojson
/tests/data/delete/delta.gpkg
/tests/data/delete/delta1.gpkg
/tests/data/delete/era5-mask.qmd
/tests/data/delete/mask.gpkg
5 changes: 5 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,8 @@ Dataset
handle overviews.
* The `plot` method takes an extra parameters `overviews` and `overview_index` to enable plotting overviews instead
of the real values in the bands.


0.6.0 (2024-02-24)
------------------
* move the dem module to a separate package "digital-rivers".
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Installing pyramids
Installing `pyramids` from the `conda-forge` channel can be achieved by:

```
conda install -c conda-forge pyramids=0.5.6
conda install -c conda-forge pyramids=0.6.0
```

It is possible to list all the versions of `pyramids` available on your platform with:
Expand All @@ -68,7 +68,7 @@ pip install git+https://github.com/Serapieum-of-alex/pyramids
to install the last release, you can easily use pip

```
pip install pyramids-gis==0.5.6
pip install pyramids-gis==0.6.0
```

Quick start
Expand Down
3 changes: 0 additions & 3 deletions docs/dem.rst

This file was deleted.

22 changes: 14 additions & 8 deletions docs/pyramids.drawio
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<mxfile host="Electron" modified="2024-01-09T18:49:02.236Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/22.1.16 Chrome/120.0.6099.109 Electron/28.1.0 Safari/537.36" etag="2l-kc7pQKFXsyKWGGF4o" version="22.1.16" type="device" pages="5">
<mxfile host="Electron" modified="2024-01-22T23:15:16.606Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/22.1.21 Chrome/120.0.6099.109 Electron/28.1.0 Safari/537.36" etag="tPpwQ0fq6a7hLKY8xN8L" version="22.1.21" type="device" pages="5">
<diagram id="C5RBs43oDa-KdzZeNtuy" name="general">
<mxGraphModel dx="2634" dy="1334" grid="0" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="0" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
Expand Down Expand Up @@ -1341,25 +1341,25 @@
<mxCell id="UqiNyKsmV0SrrWY506cY-71" value="plot" style="text;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="UqiNyKsmV0SrrWY506cY-70" vertex="1">
<mxGeometry y="26" width="150" height="34" as="geometry" />
</mxCell>
<mxCell id="Jrj3qPOKdaGwG1NXBlqk-3" value="overview_count" style="text;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="UqiNyKsmV0SrrWY506cY-70">
<mxCell id="Jrj3qPOKdaGwG1NXBlqk-3" value="overview_count" style="text;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="UqiNyKsmV0SrrWY506cY-70" vertex="1">
<mxGeometry y="60" width="150" height="34" as="geometry" />
</mxCell>
<mxCell id="Jrj3qPOKdaGwG1NXBlqk-2" value="read_overview_array" style="text;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="UqiNyKsmV0SrrWY506cY-70">
<mxCell id="Jrj3qPOKdaGwG1NXBlqk-2" value="read_overview_array" style="text;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="UqiNyKsmV0SrrWY506cY-70" vertex="1">
<mxGeometry y="94" width="150" height="34" as="geometry" />
</mxCell>
<mxCell id="Jrj3qPOKdaGwG1NXBlqk-1" value="create_overviews" style="text;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="UqiNyKsmV0SrrWY506cY-70">
<mxCell id="Jrj3qPOKdaGwG1NXBlqk-1" value="create_overviews" style="text;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="UqiNyKsmV0SrrWY506cY-70" vertex="1">
<mxGeometry y="128" width="150" height="34" as="geometry" />
</mxCell>
<mxCell id="Jrj3qPOKdaGwG1NXBlqk-7" value="recreate_overviews" style="text;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="UqiNyKsmV0SrrWY506cY-70">
<mxCell id="Jrj3qPOKdaGwG1NXBlqk-7" value="recreate_overviews" style="text;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="UqiNyKsmV0SrrWY506cY-70" vertex="1">
<mxGeometry y="162" width="150" height="34" as="geometry" />
</mxCell>
<mxCell id="Jrj3qPOKdaGwG1NXBlqk-6" value="get_overview" style="text;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="UqiNyKsmV0SrrWY506cY-70">
<mxCell id="Jrj3qPOKdaGwG1NXBlqk-6" value="get_overview" style="text;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="UqiNyKsmV0SrrWY506cY-70" vertex="1">
<mxGeometry y="196" width="150" height="34" as="geometry" />
</mxCell>
<mxCell id="Jrj3qPOKdaGwG1NXBlqk-5" style="text;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="UqiNyKsmV0SrrWY506cY-70">
<mxCell id="Jrj3qPOKdaGwG1NXBlqk-5" style="text;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="UqiNyKsmV0SrrWY506cY-70" vertex="1">
<mxGeometry y="230" width="150" height="34" as="geometry" />
</mxCell>
<mxCell id="Jrj3qPOKdaGwG1NXBlqk-4" style="text;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="UqiNyKsmV0SrrWY506cY-70">
<mxCell id="Jrj3qPOKdaGwG1NXBlqk-4" style="text;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="UqiNyKsmV0SrrWY506cY-70" vertex="1">
<mxGeometry y="264" width="150" height="34" as="geometry" />
</mxCell>
<mxCell id="UqiNyKsmV0SrrWY506cY-72" style="edgeStyle=none;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=12;startSize=8;endSize=8;" parent="1" source="UqiNyKsmV0SrrWY506cY-63" target="UqiNyKsmV0SrrWY506cY-1" edge="1">
Expand Down Expand Up @@ -1862,6 +1862,12 @@
<mxCell id="y2Jb5s1yBq3k6s6yfvwS-3" value="setter sets the&lt;br&gt;attribute not array value only" style="ellipse;shape=cloud;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="856" y="1002" width="120" height="80" as="geometry" />
</mxCell>
<mxCell id="abWmYq2iZLW_FQl3ZGDr-2" style="edgeStyle=none;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;fontSize=12;startSize=8;endSize=8;" edge="1" parent="1" source="abWmYq2iZLW_FQl3ZGDr-1" target="z8qa-Tkssb2Rg_uU2_yS-20">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="abWmYq2iZLW_FQl3ZGDr-1" value="&lt;div style=&quot;&quot;&gt;&lt;pre style=&quot;&quot;&gt;&lt;font face=&quot;times new romans&quot; style=&quot;&quot; color=&quot;#ffffff&quot;&gt;The new dataset will have &lt;br&gt;an array filled with the &lt;br&gt;no_data_value&lt;/font&gt;&lt;span style=&quot;font-family: &amp;quot;JetBrains Mono&amp;quot;, monospace; color: rgb(171, 178, 191); background-color: rgb(40, 44, 52); font-size: 9pt;&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;" style="ellipse;shape=cloud;whiteSpace=wrap;html=1;fontSize=16;align=center;" vertex="1" parent="1">
<mxGeometry x="3157" y="408" width="346" height="123" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
Expand Down
2 changes: 1 addition & 1 deletion environment-optional-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ dependencies:
- numpy >=1.25.2
- hpc >=0.1.3
- pip >=23.3.1
- gdal >=3.7.0
- gdal ==3.8.4
- pandas >=2.1.0
- geopandas >=0.14.1
- Shapely >=2.0.2
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ dependencies:
- numpy >=1.25.2
- hpc >=0.1.3
- pip >=23.3.1
- gdal >=3.7.0
- gdal ==3.8.4
- pandas >=2.1.0
- geopandas >=0.14.1
- Shapely >=2.0.2
Expand Down
Loading

0 comments on commit 585d339

Please sign in to comment.