Skip to content

Commit

Permalink
Merge a31c408 into f5c4e77
Browse files Browse the repository at this point in the history
  • Loading branch information
fnattino committed Sep 5, 2022
2 parents f5c4e77 + a31c408 commit f52229a
Show file tree
Hide file tree
Showing 16 changed files with 118 additions and 62 deletions.
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[run]
relative_files = True
branch = True
omit = */test_*.py
55 changes: 55 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Build

on:
push:
pull_request:
schedule:
- cron: '0 0 1 * *'

jobs:

build:
name: Build for ${{ matrix.python-version }}
runs-on: 'ubuntu-latest'
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.8', '3.9']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Python info
shell: bash -l {0}
run: |
which python
python --version
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Build
shell: bash -l {0}
run: |
python setup.py build
- name: Test
shell: bash -l {0}
run: |
pip install pytest pytest-cov
pytest --cov=laserchicken --cov-report xml:coverage.xml
- name: Coveralls
uses: AndreMiras/coveralls-python-action@develop
with:
parallel: true
flag-name: Unit Test

coveralls_finish:
needs: build
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: AndreMiras/coveralls-python-action@develop
with:
parallel-finished: true
25 changes: 25 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Publish

on:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
python setup.py bdist_wheel
- name: Publish package
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
38 changes: 0 additions & 38 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"license": {
"id": "Apache-2.0"
},
"publication_date": "2022-05-20",
"publication_date": "2022-09-05",
"title": "Laserchicken: toolkit for ALS point clouds",
"version": "0.5.0"
"version": "0.6.0"
}
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

## 0.6.0 - 2022-09-05
## Changed:
- continuous integration moved from travis to GH actions
- naming of band ratio's modified (symbol "<" dropped from label)

## Added
- releases published on PyPI using GH actions
- checklists included

## Fixed
- Fixed import of deprecated `scipy.stats.stats`

## 0.5.0 - 2022-05-20
## Changed:
- update documentation with table of features
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ authors:
family-names: Koma
given-names: Zsófia
cff-version: "1.0.3"
date-released: 2022-05-20
date-released: 2022-09-05
doi: "10.5281/zenodo.1219422"
keywords:
- "airborne laser scanning"
Expand All @@ -62,5 +62,5 @@ keywords:
license: "Apache-2.0"
message: "If you use this software, please cite it using these metadata."
title: "Laserchicken: toolkit for ALS point clouds"
version: "0.5.0"
version: "0.6.0"
...
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ Please cite the software if you are using it in your scientific publication.
<img src="https://raw.githubusercontent.com/eEcoLiDAR/laserchicken/master/laserchicken_logo.png" width="500"/>
</p>

[![Build Status](https://travis-ci.org/eEcoLiDAR/laserchicken.svg?branch=master)](https://travis-ci.org/eEcoLiDAR/laserchicken)
[![Build Status](https://github.com/eEcoLiDAR/laserchicken/workflows/Build/badge.svg)](https://github.com/eEcoLiDAR/laserchicken/actions)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/6e3836750fe14f34ba85e26956e8ef10)](https://www.codacy.com/app/c-meijer/eEcoLiDAR?utm_source=www.github.com&amp;utm_medium=referral&amp;utm_content=eEcoLiDAR/eEcoLiDAR&amp;utm_campaign=Badge_Grade)
[![Coverage Status](https://coveralls.io/repos/github/eEcoLiDAR/eEcoLiDAR/badge.svg)](https://coveralls.io/github/eEcoLiDAR/eEcoLiDAR)
[![Coverage Status](https://coveralls.io/repos/github/eEcoLiDAR/laserchicken/badge.svg)](https://coveralls.io/github/eEcoLiDAR/laserchicken)
[![DOI](https://zenodo.org/badge/95649056.svg)](https://zenodo.org/badge/latestdoi/95649056)
[![Documentation Status](https://readthedocs.org/projects/laserchicken/badge/?version=latest)](https://laserchicken.readthedocs.io/en/latest/)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/4524/badge)](https://bestpractices.coreinfrastructure.org/projects/4524)

Toolkit for handling point clouds created using airborne laser scanning (ALS). Find neighboring points in your point cloud and describe them as feature values. Read our [user manual](https://laserchicken.readthedocs.io/) and our (very modest) [tutorial](https://github.com/eEcoLiDAR/laserchicken/blob/master/tutorial.ipynb).

# Installation
Prerequisites:
- Python 3.6 or higher
- Python 3.7 or higher
- pip
```
pip install laserchicken
Expand All @@ -29,7 +30,7 @@ pip install laserchicken
* Edit Changelog (based on commits in https://github.com/eecolidar/laserchicken/compare/v0.3.2...master)
* Test if package can be installed with pip (`pip install .`)
* Create Github release
* Upload to pypi:
* Upload to pypi (now implemented via GitHub Actions):
```python setup.py sdist bdist_wheel```
```python -m twine upload --repository-url https://upload.pypi.org/legacy/ dist/*```
(or ```python -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*``` to test first)
Expand Down
2 changes: 1 addition & 1 deletion laserchicken/_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.0
0.6.0
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ def provides(self):
"""
name = 'band_ratio_'
if self.lower_limit is not None:
name += str(self.lower_limit) + '<'
name += str(self.lower_limit) + '_'
name += self.data_key
if self.upper_limit is not None:
name += '<' + str(self.upper_limit)
name += '_' + str(self.upper_limit)
return [name]

def extract(self, point_cloud, neighborhoods, target_point_cloud, target_index, volume_description):
Expand Down
4 changes: 2 additions & 2 deletions laserchicken/feature_extractor/kurtosis_feature_extractor.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
import scipy.stats.stats as stat
import scipy.stats as stats

from laserchicken.feature_extractor.base_feature_extractor import FeatureExtractor
from laserchicken.keys import point
Expand All @@ -23,7 +23,7 @@ def extract(self, point_cloud, neighborhoods, target_point_cloud, target_indices
def _extract_one(self, sourcepc, neighborhood):
if neighborhood:
z = sourcepc[point][self.data_key]['data'][neighborhood]
kurtosis_z = stat.kurtosis(z)
kurtosis_z = stats.kurtosis(z)
else:
kurtosis_z = np.NaN
return kurtosis_z
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import scipy.stats.stats as stats
import scipy.stats as stats

from laserchicken.feature_extractor.base_feature_extractor import FeatureExtractor
from laserchicken.keys import point
Expand Down
4 changes: 2 additions & 2 deletions laserchicken/feature_extractor/skew_feature_extractor.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
import scipy.stats.stats as stat
import scipy.stats as stats

from laserchicken.feature_extractor.base_feature_extractor import FeatureExtractor
from laserchicken.keys import point
Expand All @@ -23,7 +23,7 @@ def extract(self, point_cloud, neighborhoods, target_point_cloud, target_indices
def _extract_one(self, point_cloud, neighborhood):
if neighborhood:
source_data = point_cloud[point][self.data_key]['data'][neighborhood]
skew = stat.skew(source_data)
skew = stats.skew(source_data)
else:
skew = np.NaN
return skew
Original file line number Diff line number Diff line change
Expand Up @@ -86,22 +86,22 @@ def test_cell_volume(self):
assert_expected_ratio(volume=InfiniteCylinder(5))

def test_provides_simple(self):
self.assertEqual(['band_ratio_6<z<20'], BandRatioFeatureExtractor(6, 20).provides())
self.assertEqual(['band_ratio_6_z_20'], BandRatioFeatureExtractor(6, 20).provides())

def test_provides_with_only_upper_limit(self):
self.assertEqual(['band_ratio_z<20'], BandRatioFeatureExtractor(None, 20).provides())
self.assertEqual(['band_ratio_z_20'], BandRatioFeatureExtractor(None, 20).provides())

def test_provides_with_only_lower_limit(self):
self.assertEqual(['band_ratio_20<z'], BandRatioFeatureExtractor(20, None).provides())
self.assertEqual(['band_ratio_20_z'], BandRatioFeatureExtractor(20, None).provides())

def test_provides_with_zero_lower_limit(self):
self.assertEqual(['band_ratio_0<z'], BandRatioFeatureExtractor(0, None).provides())
self.assertEqual(['band_ratio_0_z'], BandRatioFeatureExtractor(0, None).provides())

def test_provides_with_zero_upper_limit(self):
self.assertEqual(['band_ratio_z<0'], BandRatioFeatureExtractor(None, 0).provides())
self.assertEqual(['band_ratio_z_0'], BandRatioFeatureExtractor(None, 0).provides())

def test_provides_with_data_key(self):
self.assertEqual(['band_ratio_1<normalized_height<3'],
self.assertEqual(['band_ratio_1_normalized_height_3'],
BandRatioFeatureExtractor(1, 3, data_key=keys.normalized_height).provides())


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_use_norm_z(self):
point_cloud = create_point_cloud(x, y, z, normalized_z=normalized_z)
neighborhood = [[0, 1, 2]]

skew = self.extractor.extract(point_cloud, [neighborhood], None, None, None)[0]
skew = self.extractor.extract(point_cloud, neighborhood, None, None, None)[0]

self.assertGreater(skew, 0.1)

Expand Down
2 changes: 1 addition & 1 deletion laserchicken/test_integration_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def test_tutorial_once(self):

cylinder = build_volume("infinite cylinder", radius=5)
neighborhoods = compute_neighborhoods(point_cloud, targets, cylinder)
compute_features(point_cloud, neighborhoods, targets, ['band_ratio_1<normalized_height<2'], cylinder)
compute_features(point_cloud, neighborhoods, targets, ['band_ratio_1_normalized_height_2'], cylinder)

from laserchicken import export
export(point_cloud, 'my_output.ply')
Expand Down

0 comments on commit f52229a

Please sign in to comment.