Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error when time series includes nan values #40

Merged
merged 8 commits into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Bug report
about: Create a report to help us improve
title: ""
labels: ""
labels: "Bug"
assignees: ""
---

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Feature request
about: Suggest an idea for this project
title: ""
labels: ""
labels: "Feature"
assignees: ""
---

Expand Down
21 changes: 17 additions & 4 deletions .github/workflows/_build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2023 Benjamin Thomas Schwertfeger
# Github: https://github.com/btschwertfeger
# GitHub: https://github.com/btschwertfeger
#
# Template workflow to build the project for a specific os
# and Python version.
Expand Down Expand Up @@ -33,9 +33,22 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build

- name: Build the package
run: python -m pip wheel -w dist --no-deps .
run: python -m build --outdir .

- name: Install the package
run: python3 -m pip install dist/python_cmethods*.whl
- name: Install the package on Linux or MacOS
if: runner.os != 'Windows'
run: python -m pip install python_cmethods*.whl

- name: Install the package on Windows
if: runner.os == 'Windows'
run: |
try {
$WHEEL = Get-ChildItem -Path . -Filter "python_cmethods*.whl" -ErrorAction Stop
python -m pip install $WHEEL
} catch {
Write-Error "Error: .whl file not found in the current directory."
exit 1
}
2 changes: 1 addition & 1 deletion .github/workflows/_build_doc.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2023 Benjamin Thomas Schwertfeger
# Github: https://github.com/btschwertfeger
# GitHub: https://github.com/btschwertfeger
#
# Template workflow to build documentation.
#
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/_codecov.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2023 Benjamin Thomas Schwertfeger
# Github: https://github.com/btschwertfeger
# GitHub: https://github.com/btschwertfeger
#
# Template workflow to build the project for a specific os
# and Python version, run the tests and upload the results to codecov.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/_pre_commit.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2023 Benjamin Thomas Schwertfeger
# Github: https://github.com/btschwertfeger
# GitHub: https://github.com/btschwertfeger
#
# Template workflow to run pre-commit.
#
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/_pypi_publish.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2023 Benjamin Thomas Schwertfeger
# Github: https://github.com/btschwertfeger
# GitHub: https://github.com/btschwertfeger
#
# Template workflow to build the project and publish
# the package to PyPI. It can be used to publish on the
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/_test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2023 Benjamin Thomas Schwertfeger
# Github: https://github.com/btschwertfeger
# GitHub: https://github.com/btschwertfeger
#
# Template workflow to run the unit tests of the package
#
Expand Down Expand Up @@ -38,4 +38,4 @@ jobs:
run: python -m pip install ".[dev]"

- name: Run unit tests
run: pytest tests/
run: pytest tests
10 changes: 5 additions & 5 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2023 Benjamin Thomas Schwertfeger
# Github: https://github.com/btschwertfeger
# GitHub: https://github.com/btschwertfeger
#
# Workflow to apply pre-commit, build, test and upload the package
# to the test index of PyPI.
Expand Down Expand Up @@ -36,7 +36,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest] # todo: windows-latest
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
with:
os: ${{ matrix.os }}
Expand All @@ -48,7 +48,7 @@ jobs:
needs: [Pre-Commit]
uses: ./.github/workflows/_build_doc.yml
with:
os: "ubuntu-latest"
os: ubuntu-latest
python-version: "3.11"

## Run the unit tests for Python 3.8 until 3.11
Expand All @@ -58,7 +58,7 @@ jobs:
uses: ./.github/workflows/_test.yml
strategy:
matrix:
os: [ubuntu-latest]
os: [ubuntu-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
with:
os: ${{ matrix.os }}
Expand All @@ -83,6 +83,6 @@ jobs:
needs: [Test]
uses: ./.github/workflows/_codecov.yml
with:
os: "ubuntu-latest"
os: ubuntu-latest
python-version: "3.11"
secrets: inherit
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2023 Benjamin Thomas Schwertfeger
# Github: https://github.com/btschwertfeger
# GitHub: https://github.com/btschwertfeger
#
# Workflow that gets triggered, when a release was created in the
# Github UI. This enables the upload of the python-cmethods package
# GitHub UI. This enables the upload of the python-cmethods package
# for the latest tag to PyPI.
#

Expand All @@ -14,7 +14,7 @@ on:
types: [created]

jobs:
## Run pre-commit - just to make shure that the code is still
## Run pre-commit - just to make sure that the code is still
## in the proper format
##
Pre-Commit:
Expand All @@ -28,7 +28,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: ["macos-latest", "ubuntu-latest"]
os: [macos-latest, ubuntu-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
with:
os: ${{ matrix.os }}
Expand All @@ -40,7 +40,7 @@ jobs:
needs: [Pre-Commit]
uses: ./.github/workflows/_build_doc.yml
with:
os: "ubuntu-latest"
os: ubuntu-latest
python-version: "3.11"

## Run the unit tests for Python 3.8 until 3.11
Expand All @@ -50,7 +50,7 @@ jobs:
uses: ./.github/workflows/_test.yml
strategy:
matrix:
os: [ubuntu-latest]
os: [ubuntu-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
with:
os: ${{ matrix.os }}
Expand Down
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,5 @@ repos:
rev: v2.7.1
hooks:
- id: prettier

exclude: (\.ipynb$)
17 changes: 14 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
# Changelog

## [Unreleased](https://github.com/btschwertfeger/python-cmethods/tree/HEAD)
## [v1.0.2](https://github.com/btschwertfeger/python-cmethods/tree/v1.0.2) (2023-06-18)

[Full Changelog](https://github.com/btschwertfeger/python-cmethods/compare/v1.0.0...HEAD)
[Full Changelog](https://github.com/btschwertfeger/python-cmethods/compare/v1.0.1...v1.0.2)

**Merged pull requests:**

- Clarified difference between stochastic and non-stochastic climate variables in doc and readme [\#36](https://github.com/btschwertfeger/python-cmethods/pull/36) ([btschwertfeger](https://github.com/btschwertfeger))
- Fix typos [\#38](https://github.com/btschwertfeger/python-cmethods/pull/38) ([btschwertfeger](https://github.com/btschwertfeger))

## [v1.0.1](https://github.com/btschwertfeger/python-cmethods/tree/v1.0.1) (2023-04-17)

[Full Changelog](https://github.com/btschwertfeger/python-cmethods/compare/v1.0.0...v1.0.1)

**Breaking changes:**

- Split Quantile Mapping into Quantile Mapping and Detrended Quantile Mapping [\#18](https://github.com/btschwertfeger/python-cmethods/issues/18)
- Split Quantile Mapping into Quantile Mapping and Detrended Quantile Mapping [\#34](https://github.com/btschwertfeger/python-cmethods/pull/34) ([btschwertfeger](https://github.com/btschwertfeger))

**Fixed bugs:**

- Multiplicative Quantile Delta Mapping is not applying scaling where the delta is infinite [\#32](https://github.com/btschwertfeger/python-cmethods/issues/32)
- Fixed bug where division lead to nan or inf values [\#33](https://github.com/btschwertfeger/python-cmethods/pull/33) ([btschwertfeger](https://github.com/btschwertfeger))
- Fixed PyPI repository URL [\#16](https://github.com/btschwertfeger/python-cmethods/pull/16) ([btschwertfeger](https://github.com/btschwertfeger))
- Fixed bug where division lead to nan or inf values [\#33](https://github.com/btschwertfeger/python-cmethods/pull/33) ([btschwertfeger](https://github.com/btschwertfeger))

**Closed issues:**

Expand All @@ -22,6 +32,7 @@

- Create a Changelog [\#21](https://github.com/btschwertfeger/python-cmethods/pull/21) ([btschwertfeger](https://github.com/btschwertfeger))
- Extended the description of quantile mapping with text and images [\#20](https://github.com/btschwertfeger/python-cmethods/pull/20) ([btschwertfeger](https://github.com/btschwertfeger))
- Prepare release [\#35](https://github.com/btschwertfeger/python-cmethods/pull/35) ([btschwertfeger](https://github.com/btschwertfeger))

## [v1.0.0](https://github.com/btschwertfeger/python-cmethods/tree/v1.0.0) (2023-04-10)

Expand Down
15 changes: 11 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!make
# -*- coding: utf-8 -*-
# Copyright (C) 2023 Benjamin Thomas Schwertfeger
# Github: https://github.com/btschwertfeger
# GitHub: https://github.com/btschwertfeger

VENV := venv
GLOBAL_PYTHON := $(shell which python3)
PYTHON := $(VENV)/bin/python3

.PHONY := build dev install test test_upload live_upload clean
.PHONY := build dev install test tests doc doctest pre-commit changelog clean

## Builds the python-kraken-sdk
##
Expand All @@ -24,11 +24,13 @@ dev:
install:
$(PYTHON) -m pip install .

## Run the unittests
## Run the unit tests
##
test:
$(PYTHON) -m pytest tests/

tests: test

## Build the documentation
##
doc:
Expand Down Expand Up @@ -58,7 +60,12 @@ changelog:
## Clean the workspace
##
clean:
rm -rf .pytest_cache build/ dist/ python_cmethods.egg-info docs/_build examples/.ipynb_checkpoints
rm -rf .pytest_cache \
build/ dist/ python_cmethods.egg-info \
docs/_build \
examples/.ipynb_checkpoints .ipynb_checkpoints \
.mypy_cache .pytest_cache

rm -f .coverage cmethods/_version.py

find tests -name "__pycache__" | xargs rm -rf
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div align="center">

[![GitHub](https://badgen.net/badge/icon/github?icon=github&label)](https://github.com/btschwertfeger/Bias-Adjustment-Python)
[![Generic badge](https://img.shields.io/badge/python-3.8_|_3.9_|_3.10_|_3.11-yellow.svg)](https://shields.io/)
[![Generic badge](https://img.shields.io/badge/python-3.8_|_3.9_|_3.10_|_3.11-blue.svg)](https://shields.io/)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-orange.svg)](https://www.gnu.org/licenses/gpl-3.0)
[![Downloads](https://pepy.tech/badge/python-cmethods)](https://pepy.tech/project/python-cmethods)

Expand Down
Loading