Skip to content

Commit

Permalink
Merge pull request #708 from kordejong/gh707
Browse files Browse the repository at this point in the history
Add pre-commit hooks for checking markdown formatting and spelling / prose errors
  • Loading branch information
kordejong authored Aug 14, 2024
2 parents afcee0c + b40141a commit 614b8eb
Show file tree
Hide file tree
Showing 143 changed files with 532 additions and 429 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ insert_final_newline = true
max_line_length = 80
trim_trailing_whitespace = true

[*.{c,cpp,h,hpp,md,rst,txt}]
[*.{c,cpp,h,hpp,md,rb,rst,txt,yaml,yml}]
max_line_length = 110

[*.py]
Expand Down
4 changes: 3 additions & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Contributing

There are various ways to contribute to the development of LUE. Please visit the [Contributing page](https://lue.computationalgeography.org/doc/contribute) in the LUE documentation, which contains information about all of these.
There are various ways to contribute to the development of LUE. Please visit the [Contributing
page](https://lue.computationalgeography.org/doc/contribute) in the LUE documentation, which contains
information about all of these.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/1_bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ body:
required: true

- type: textarea
id: bug_expexted
id: bug_expected
attributes:
label: Expected behaviour
placeholder: A concise description of what you expected to happen.
Expand Down
15 changes: 15 additions & 0 deletions .mdl_style.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# https://github.com/markdownlint/markdownlint/blob/main/docs/configuration.md
# https://github.com/markdownlint/markdownlint/blob/main/docs/RULES.md
all
exclude_rule 'MD004'
exclude_rule 'MD005'
exclude_rule 'MD012'
exclude_rule 'MD024'
exclude_rule 'MD030'
exclude_rule 'MD034'
exclude_rule 'MD041'
exclude_rule 'MD046'

# The parameters which can be changed are mentioned in the rules page (Parameters: ...)
rule 'MD013', :line_length => 110
rule 'MD007', :indent => 4
1 change: 1 addition & 0 deletions .mdlrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
style '.mdl_style.rb'
21 changes: 19 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ repos:
# - id: check-yaml
- id: check-added-large-files
- repo: https://github.com/psf/black
rev: 24.4.2
rev: 24.8.0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.0
rev: v1.11.1
hooks:
- id: mypy
# args: [--verbose]
Expand All @@ -45,6 +45,22 @@ repos:
.*\.py|
.*\.py.in|
)$
- repo: https://github.com/markdownlint/markdownlint
rev: v0.13.0
hooks:
- id: markdownlint
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
additional_dependencies:
- tomli
- repo: https://github.com/crate-ci/typos
rev: v1.23.6
hooks:
- id: typos
args: [] # Relevant: don't update files, just report
# This one last. It is the slowest. --------------------------------------------
- repo: https://github.com/pocc/pre-commit-hooks
rev: v1.3.5
hooks:
Expand All @@ -55,6 +71,7 @@ repos:
exclude: |
(?x)^(
source/data_model/cxx/.*|
source/data_model/gdal/include/lue/gdal/library.hpp|
source/data_model/hl/.*|
source/data_model/python/.*|
source/data_model/test/.*|
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ 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.
SOFTWARE.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# LUE

LUE scientific database and environmental modelling framework

LUE is software for storing and manipulating large amounts of information
Expand Down Expand Up @@ -27,13 +28,16 @@ the related technology.
- [Documentation](https://lue.computationalgeography.org/doc)
- [Publications](https://lue.computationalgeography.org/publication)
- [R&D team](https://www.computationalgeography.org)
- [![Chat with us on Matrix](https://img.shields.io/badge/chat-on%20Matrix-%230098D4)](https://matrix.to/#/#lue:matrix.org) (users)
- [![Chat with us on Matrix](https://img.shields.io/badge/chat-on%20Matrix-%230098D4)](https://matrix.to/#/#lue-dev:matrix.org) (developers)
- [![Chat with us on Matrix](https://img.shields.io/badge/chat-on%20Matrix-%230098D4)](https://matrix.to/#/#lue:matrix.org)
(users)
- [![Chat with us on Matrix](https://img.shields.io/badge/chat-on%20Matrix-%230098D4)](https://matrix.to/#/#lue-dev:matrix.org)
(developers)

[![Latest release](https://zenodo.org/badge/DOI/10.5281/zenodo.5535685.svg)](https://doi.org/10.5281/zenodo.5535685)


## Source code

[![License](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/computationalgeography/lue/)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/2c02fc1c5b13424abfc414b82104801d)](https://www.codacy.com/gh/computationalgeography/lue/dashboard?utm_source=github.com&utm_medium=referral&utm_content=computationalgeography/lue&utm_campaign=Badge_Grade)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)
Expand All @@ -43,18 +47,21 @@ the related technology.


## C/I builds

[![Linux build status](https://github.com/computationalgeography/lue/actions/workflows/linux.yml/badge.svg)](https://github.com/computationalgeography/lue/actions/workflows/linux.yml)
[![macOS build status](https://github.com/computationalgeography/lue/actions/workflows/macos.yml/badge.svg)](https://github.com/computationalgeography/lue/actions/workflows/macos.yml)
[![Windows build status](https://github.com/computationalgeography/lue/actions/workflows/windows.yml/badge.svg)](https://github.com/computationalgeography/lue/actions/workflows/windows.yml)

[![Conda packages build status](https://github.com/computationalgeography/lue/actions/workflows/conda.yml/badge.svg)](https://github.com/computationalgeography/lue/actions/workflows/conda.yml)

## Installation

[![Anaconda-Server Badge](https://anaconda.org/conda-forge/lue/badges/version.svg)](https://anaconda.org/conda-forge/lue)
[![Anaconda-Server Badge](https://anaconda.org/conda-forge/lue/badges/platforms.svg)](https://anaconda.org/conda-forge/lue)
[![Anaconda-Server Badge](https://anaconda.org/conda-forge/lue/badges/downloads.svg)](https://anaconda.org/conda-forge/lue)

The easiest way to install LUE is using Conda:

```bash
conda install -c conda-forge lue
```
Expand Down
1 change: 1 addition & 0 deletions conanfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Conan recipe
"""

import os
import shutil

Expand Down
1 change: 1 addition & 0 deletions document/doc/about/project.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(doc-about-project)=

# Project

```{include} short_description.md
Expand Down
12 changes: 8 additions & 4 deletions document/doc/about/related.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@
% rasdaman / SciDB (distributed storage, computing?)
%
% https://geotrellis.io/
% GeoTrellis provides a number of operations to manipulate raster data, including cropping/warping, Map Algebra operations, and rendering operations, as well as vector to raster operations such as Kernel Density and vectorization of raster data.
% GeoTrellis provides a number of operations to manipulate raster data, including cropping/warping, Map
% Algebra operations, and rendering operations, as well as vector to raster operations such as Kernel
% Density and vectorization of raster data.
%
%
% https://openeo.org/
% openEO develops an open API to connect R, Python, JavaScript and other clients to big Earth observation cloud back-ends in a simple and unified way.
% openEO develops an open API to connect R, Python, JavaScript and other clients to big Earth observation
% cloud back-ends in a simple and unified way.
%
%
% xarray combined with dask (distributed computing)
Expand All @@ -27,12 +30,13 @@
% agents:
%
% https://en.wikipedia.org/wiki/SARL_language
% SARL language level are supported by this run-time environment: fully distributed, parallel execution of agent’s behaviors
% SARL language level are supported by this run-time environment: fully distributed, parallel execution of
% agent’s behaviors
%
% hier vandaan...
% https://en.wikipedia.org/wiki/Comparison_of_agent-based_modeling_software
%
% ik denk niet dat netlogo distributed kan, repast misschien wel...
% ik denk niet dat netlogo distributed kan, repast misschien well...
%
%
%
Expand Down
1 change: 1 addition & 0 deletions document/doc/about/release.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(doc-about-release)=

# Releases

## 0.3.8 (WIP)
Expand Down
1 change: 1 addition & 0 deletions document/doc/contribute/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(doc-contribute)=

# Contribute

Thank you for investing your time in contributing to this project!
Expand Down
2 changes: 1 addition & 1 deletion document/doc/contribute/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Information about this can be found on the [lue-feedstock page](https://github.c
at Github.

The pull request is based on a new branch in a clone of the `lue-feedstock` repository, located in the
`regro-cf-autotick-bot` Github organisation. To make changes to this branch, the folowing workflow can be
`regro-cf-autotick-bot` Github organisation. To make changes to this branch, the following workflow can be
used:

```bash
Expand Down
1 change: 1 addition & 0 deletions document/doc/manual/framework/execute.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ starting LUE Python scripts like this solved the crashes:
```bash
LD_PRELOAD=<prefix>/lib/libtcmalloc_minimal.so.4 python ./my_lue_script.py
```

:::


Expand Down
1 change: 1 addition & 0 deletions document/doc/manual/index.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
(doc-manual)=

# Manual
10 changes: 5 additions & 5 deletions document/doc/manual/install/source.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ Optional features:
| --- | --- | --- |
| `LUE_QA_WITH_PYTHON_API` | `FALSE` | Build QA Python API |
| `LUE_QA_WITH_TESTS` | `FALSE` | Build test targets |
| `LUE_QA_TEST_NR_LOCALITIES_PER_TEST` | `1` | Number of localities used when testing the framework |
| `LUE_QA_TEST_NR_THREADS_PER_LOCALITY` | `1` | Number of threads per locality used when testing the framework |
| `LUE_QA_TEST_NR_LOCALITIES_PER_TEST` | `1` | Localities used when testing the framework |
| `LUE_QA_TEST_NR_THREADS_PER_LOCALITY` | `1` | Threads per locality used when testing the framework |
| `LUE_QA_TEST_HPX_RUNWRAPPER` | `none` | Runwrapper to use (see `hpxrun.py`) |
| `LUE_QA_TEST_HPX_PARCELPORT` | `tcp` | Parcelport to use (see `hpxrun.py`) |

Expand All @@ -106,7 +106,7 @@ requires that HPX is built with support for networking.
#### Dependencies

- Nlohmann JSON
- `LUE_QA_WITH_TESTS`: Boost filesytem, sytem, unit-test framework libraries
- `LUE_QA_WITH_TESTS`: Boost filesystem, system, unit-test framework libraries
- `LUE_QA_WITH_PYTHON_API`: pybind11, Python


Expand All @@ -115,8 +115,8 @@ requires that HPX is built with support for networking.
There are at least three options for installing prerequisite libraries and tools:

1. Install using platform specific package manager
2. Install using Conan, either before building LUE or by the LUE build scripts
3. Build by the LUE build scripts
1. Install using Conan, either before building LUE or by the LUE build scripts
1. Build by the LUE build scripts

The next variables determine what happens in each case by default.

Expand Down
1 change: 1 addition & 0 deletions document/doc/pcraster/status.md
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ these differences as much as possible.
* - ycoordinate
- 🗑
- Not sure why this is useful...

:::

% In LUE, not in PCRaster:
Expand Down
2 changes: 1 addition & 1 deletion document/doc/quick_start/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Quick start

Here, you will find just enough information to get started with using LUE. It is targetted at model
Here, you will find just enough information to get started with using LUE. It is targeted at model
developers. We will be implementing [Conway's Game of
Life](https://en.wikipedia.org/wiki/Conway's_Game_of_Life) and execute it in parallel, using a single process.
1 change: 1 addition & 0 deletions document/doc/quick_start/python.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Game of Life in Python

## Install

```bash
conda install -c conda-forge lue
```
Expand Down
16 changes: 8 additions & 8 deletions document/doc/reference/python/framework/trigonometry.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Trigonometry
Compute the principal value of the arc cosine

:parm cosine: Datastructure containing cosines
:param cosine: Datastructure containing cosines
:return: New instance of the same datastructure as passed in

This function is overloaded for arrays containing float32 and float64 elements.
Expand All @@ -27,7 +27,7 @@ Trigonometry
Compute the principal value of the arc sine

:parm sine: Datastructure containing sines
:param sine: Datastructure containing sines
:return: New instance of the same datastructure as passed in

This function is overloaded for arrays containing float32 and float64 elements.
Expand All @@ -37,7 +37,7 @@ Trigonometry
Compute the principal value of the arc tangent

:parm tangent: Datastructure containing tangents
:param tangent: Datastructure containing tangents
:return: New instance of the same datastructure as passed in

This function is overloaded for arrays containing float32 and float64 elements.
Expand All @@ -47,8 +47,8 @@ Trigonometry
Compute the arc tangent of y/x

:parm y: Datastructure containing distances in y-direction
:parm x: Datastructure containing distances in x-direction
:param y: Datastructure containing distances in y-direction
:param x: Datastructure containing distances in x-direction
:return: New instance of the same datastructure as passed in

This function is overloaded for arrays containing float32 and float64 elements.
Expand All @@ -60,7 +60,7 @@ Trigonometry
Compute the cosine

:parm angle: Datastructure containing angles in radians
:param angle: Datastructure containing angles in radians
:return: New instance of the same datastructure as passed in

This function is overloaded for arrays containing float32 and float64 elements.
Expand All @@ -70,7 +70,7 @@ Trigonometry
Compute the sine

:parm angle: Datastructure containing angles in radians
:param angle: Datastructure containing angles in radians
:return: New instance of the same datastructure as passed in

This function is overloaded for arrays containing float32 and float64 elements.
Expand All @@ -80,7 +80,7 @@ Trigonometry
Compute the tangent

:parm angle: Datastructure containing angles in radians
:param angle: Datastructure containing angles in radians
:return: New instance of the same datastructure as passed in

This function is overloaded for arrays containing float32 and float64 elements.
4 changes: 2 additions & 2 deletions document/luepy/case_study/elevation.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
### time_boxes = time_domain.reserve(nr_time_boxes)
### # A box is defined by a begin and end time point (two coordinates per box)
### # Here, we configure time boxes with a duration of 10 days. The time
### # inbetween the boxes is time were we don't have information.
### # in between the boxes is time were we don't have information.
### time_boxes[:] = np.array([ # Dummy data...
### [10, 20],
### [30, 40],
Expand Down Expand Up @@ -67,7 +67,7 @@
### nr_cells = nr_cells.reshape(nr_areas, 2)
### space_discretization.values.reserve(nr_areas)[:] = nr_cells
###
### # Re-use nr_cells array with shapes of spatial fields, but add information
### # Reuse nr_cells array with shapes of spatial fields, but add information
### # about the number of time steps. The resulting values will be
### # [nr_time_steps, nr_rows, nr_cols], where nr_rows, nr_cols is different
### # for each raster.
Expand Down
9 changes: 7 additions & 2 deletions document/luepy/discretization.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Discretization
==============
LUE property values can be discretized. This is one way to store the continuous variation of some property value through the time and/or space domain. For example, to store the continuous variation of topographic elevation in an area, to folowing approach can be used (assuming elevation does not change over the time considered):

LUE property values can be discretized. This is one way to store the continuous variation of some property
value through the time and/or space domain. For example, to store the continuous variation of topographic
elevation in an area, to following approach can be used (assuming elevation does not change over the time
considered):

- property set
- time domain: omnipresent
Expand All @@ -18,7 +22,8 @@ LUE property values can be discretized. This is one way to store the continuous

The result of this layout is a representation in the LUE data model of zero or more rasters. In general, the information required to understand the way a property value is discretized is stored itself in a property. This discretization property is a property like any other property, but it is linked to a property whose values are discretized using a special keyword (`lue_space_discretization` in the above example). This means that the domain of a discretization property can be different from the property being discretized.

In the folowing sections the approach is described of storing continuous varying property values according to different kinds of discretization.
In the following sections the approach is described of storing continuous varying property values according to
different kinds of discretization.


Variation through time
Expand Down
2 changes: 1 addition & 1 deletion document/luepy/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The LUE package can be installed with `conda`::
$ pip install --upgrade lue

During the installation a C++ compiler will be used to compile some source files. The LUE C++ sources depend on the folowing packages to be installed:
During the installation a C++ compiler will be used to compile some source files. The LUE C++ sources depend on the following packages to be installed:

- `boost`_ C++ libraries (headers)
- `hdf5`_ C library (library and headers)
Expand Down
2 changes: 1 addition & 1 deletion document/luepy/naming.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The LUE datamodel requires you to provide names for various things. Here, we pro

Style
-----
See `PEP 8 -- Style Guide for Python Code`_, especially the `section about naming conventions`_ for information about styling Python code in general. Given the information in PEP 8, we adopted the folowing naming rule for naming things in de LUE datamodel: "use lowercase with words separated by underscores as necessary to improve readability".
See `PEP 8 -- Style Guide for Python Code`_, especially the `section about naming conventions`_ for information about styling Python code in general. Given the information in PEP 8, we adopted the following naming rule for naming things in de LUE datamodel: "use lowercase with words separated by underscores as necessary to improve readability".


.. _PEP 8 -- Style Guide for Python Code: https://www.python.org/dev/peps/pep-0008/
Expand Down
Loading

0 comments on commit 614b8eb

Please sign in to comment.