Skip to content

Commit

Permalink
Merge branch 'release/0.13.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
jorenham committed Apr 21, 2024
2 parents 4ee17f9 + 9a00975 commit 9923181
Show file tree
Hide file tree
Showing 45 changed files with 1,572 additions and 1,364 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ trim_trailing_whitespace = true
max_line_length = 79

# 2 space indentation
[*.yml]
[{*.json,*.jsonc,*.yaml,*.yml}]
indent_size = 2
25 changes: 16 additions & 9 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
- package-ecosystem: pip
directory: /
schedule:
interval: weekly
insecure-external-code-execution: allow
- package-ecosystem: github-actions
directory: /
target-branch: "dev"
labels:
- "github actions"
schedule:
interval: weekly

- package-ecosystem: pip
versioning-strategy: lockfile-only
directory: /
target-branch: "dev"
labels:
- "dependencies"
schedule:
interval: weekly
49 changes: 40 additions & 9 deletions .github/workflows/CI.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- master
- dev
pull_request:
workflow_dispatch:

Expand All @@ -12,17 +13,13 @@ concurrency:
cancel-in-progress: true

jobs:
ci:
lint:
timeout-minutes: 10

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ['3.10', '3.12']
pandas: ['without', 'with']

runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
Expand All @@ -32,7 +29,7 @@ jobs:

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
python-version: "3.12"
cache: poetry

- name: poetry check
Expand All @@ -42,10 +39,9 @@ jobs:
run: >
poetry install
--sync
--with github
--without docs
--without debug
--${{ matrix.pandas }} pandas
--with pandas
- name: codespell
run: poetry run codespell .
Expand All @@ -56,5 +52,40 @@ jobs:
- name: pyright
run: poetry run pyright

test:
timeout-minutes: 10

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.10", "3.12"]
pandas: ["without", "with"]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- name: install poetry
run: pipx install poetry

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: poetry

- name: poetry check
run: poetry check

- name: poetry install
run: >
poetry install
--sync
--with github
--without docs
--without debug
--${{ matrix.pandas }} pandas
- name: pytest
run: poetry run pytest
38 changes: 4 additions & 34 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,51 +4,21 @@ __pycache__/
*$py.class

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
site/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# Unit test / coverage reports
.coverage
.coverage.*
# Cache
.cache
coverage.xml
*.cover
*.py,cover
.hypothesis/
.hypothesis
.pytest_cache/
cover/
.ruff_cache/
.pyright/

# Jupyter Notebook
.ipynb_checkpoints

# Environments
.env
.venv/
env/
venv/
ENV/
env.bak/
venv.bak/

# IDE configuration
# IntelliJ
.idea/
.vscode/
.run/
13 changes: 13 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
default: true
no-hard-tabs: true
MD007:
indent: 4
MD033:
allowed_elements:
- 'br'
- 'table'
- 'tr'
- 'th'
- 'td'
- 'img'
MD041: false
61 changes: 61 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-case-conflict
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-symlinks
- id: check-toml
- id: check-vcs-permalinks
- id: check-yaml
args: [--unsafe]
- id: destroyed-symlinks
- id: detect-private-key
- id: fix-byte-order-marker
- id: forbid-submodules
- id: name-tests-test
args: [--pytest-test-first]
- id: no-commit-to-branch
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
exclude_types: [svg]

- repo: local
hooks:
- id: mkdocs-build
name: mkdocs build
entry: bash -c 'poetry run mkdocs build'
language: system
types: [markdown]
pass_filenames: false

- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.39.0
hooks:
- id: markdownlint

- repo: https://github.com/python-poetry/poetry
rev: 1.8.2
hooks:
- id: poetry-check

- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
additional_dependencies:
- tomli

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.1
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]

- repo: https://github.com/RobertCraigie/pyright-python
rev: v1.1.359
hooks:
- id: pyright
14 changes: 14 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"recommendations": [
"charliermarsh.ruff",
"codezombiech.gitignore",
"davidanson.vscode-markdownlint",
"editorconfig.editorconfig",
"elagil.pre-commit-helper",
"ms-python.python",
"ms-python.vscode-pylance",
"serhioromano.vscode-gitflow",
"yzhang.markdown-all-in-one",
"zeshuaro.vscode-python-poetry"
]
}
68 changes: 33 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,26 @@
<!--overview-start-->

<img src="https://jorenham.github.io/Lmo/img/lmo.svg" alt="jorenham/lmo" width="128" align="right">

# Lmo - Trimmed L-moments and L-comoments

[![license](https://img.shields.io/github/license/jorenham/lmo?style=flat-square)](https://github.com/jorenham/lmo/blob/master/LICENSE?)
[![PyPI](https://img.shields.io/pypi/v/lmo?style=flat-square)](https://pypi.org/project/lmo/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/Lmo?style=flat-square)](https://pypi.org/project/lmo/)
[![versions](https://img.shields.io/pypi/pyversions/lmo?style=flat-square)](https://github.com/jorenham/lmo)
![GitHub Workflow Status (with branch)](https://img.shields.io/github/actions/workflow/status/jorenham/lmo/CI.yml?branch=master&style=flat-square)
![GitHub commit activity (branch)](https://img.shields.io/github/commit-activity/m/jorenham/Lmo?style=flat-square)
[![Checked with pyright](https://microsoft.github.io/pyright/img/pyright_badge.svg)](https://microsoft.github.io/pyright/)



~~~
Is your tail too heavy?
Can't find a moment?
Are the swans black?
The distribution pathological?
... then look no further: Lmo's got you covered!
Uniform or multi-dimensional, Lmo can summarize it all with one quick glance!
~~~

Unlike the legacy [moments](https://wikipedia.org/wiki/Moment_(mathematics)),
[L-moments](https://wikipedia.org/wiki/L-moment) **uniquely describe** a
![GitHub Workflow Status][IMG-GHA]
![license][IMG-BSD]
[![Lmo - PyPI][IMG-PYPI]](https://pypi.org/project/Lmo/)
[![Lmo - Versions][IMG-VER]](https://github.com/jorenham/Lmo)
[![Ruff][IMG-RUFF]](https://github.com/astral-sh/ruff)
[![Pyright][IMG-PYRIGHT]](https://microsoft.github.io/pyright/)

[IMG-GHA]: https://img.shields.io/github/actions/workflow/status/jorenham/Lmo/CI.yml?branch=master
[IMG-BSD]: https://img.shields.io/github/license/jorenham/Lmo
[IMG-PYPI]: https://img.shields.io/pypi/v/Lmo
[IMG-VER]: https://img.shields.io/pypi/pyversions/Lmo
[IMG-RUFF]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
[IMG-PYRIGHT]: https://microsoft.github.io/pyright/img/pyright_badge.svg

Unlike the legacy
[product-moments](https://wikipedia.org/wiki/Moment_(mathematics)), the
[*L-moments*](https://wikipedia.org/wiki/L-moment) **uniquely describe** a
probability distribution, and are more robust and efficient.

The "L" stands for Linear; it is a linear combination of order statistics.
So Lmo is as fast as sorting your samples (in terms of time-complexity).

Expand Down Expand Up @@ -98,17 +89,24 @@ pip install lmo

These are automatically installed by your package manager, alongside `lmo`.

| Package | Minimum version |
| --- | --- |
| [Python](https://github.com/python/cpython) | `3.10` |
| [NumPy](https://github.com/numpy/numpy) | `1.22` |
| [SciPy](https://github.com/scipy/scipy) | `1.9` |
| Package | Minimum version |
| ------------ | ------------------- |
| [Python][PY] | `3.10` |
| [NumPy][NP] | See [NEP 29][NEP29] |
| [SciPy][SP] | `1.9` |

[PY]: https://github.com/python/cpython
[NP]: https://github.com/numpy/numpy
[SP]: https://github.com/scipy/scipy
[NEP29]: https://numpy.org/neps/nep-0029-deprecation_policy.html#support-table

### Optional dependencies

| Package | Minimum version | Notes
| --- | --- | --- |
| [Pandas](https://github.com/pandas-dev/pandas) | `1.4` | Lmo extends `pd.Series` and `pd.DataFrame` with convenient methods, e.g. `df.l_scale(trim=1)`. Install as `pip install lmo[pandas]` to ensure compatibility. |
| Package | Minimum version | Notes |
| ------------ | --------------- | ---------------------------- |
| [Pandas][PD] | `1.4` | Installable as `lmo[pandas]` |

[PD]: https://github.com/pandas-dev/pandas

## Foundational Literature

Expand Down

0 comments on commit 9923181

Please sign in to comment.