Skip to content

Commit

Permalink
Dev1 (#23)
Browse files Browse the repository at this point in the history
* Fix the probme when alpha is too low the result is incorrect.

* ignore slice type limit (int)

* Fix ruff syntax

* add pyright config and type ignore

* Fix type in rcimodel and remove responsibility of scale from Indexsnapshot

* Remove floating point error in intensity.

* Fix tox (mypy)

* IndexedSnapshop accept nan value inside with corrsponding tests.

* Tests for input data with NAN values.

* Quick_start and some features in blrprx model.

* Delete useless file.

* Fix some typing and linting for mypy and ruff.

* Fix tox and use poetry correctly. Minor text change in quick_start.py.

* Testing Github workflow doc generation.

* Fixing python 3.10 treated as 3.1. Now using 3.11.

* Publish the 1.0.0 pyblrp. Change theme of doc.

* Fix doc theme package name.

* Fix the READMD url and image trasparency.

* Fix s some requirements.txt files and tox.ini settings for mypy and ruff using poetry export command.

* Remove hash from requirements.txt requirements-dev.txt and docs/requirements-doc.txt

* Only run mypy and ruff on ubuntu-latest.

* Fix github action envs.

* Fix github action envs.

* Fix github action.:

* Fix github action.

* Remove doc building from tox.ini.

* Remove all requirements.txt files and rename doce building github action.

* Fix Doc building with github action.

* Fix tox.ini for python3.12.

* Fix github action python version. Remove blue underscore of badges in README.md.

* Adding Documentation link to README.md.

* Fine tuning on github action for performance.

* Rename the github action name.

* Rename the github action name.

* Rename the github action name.
  • Loading branch information
KilinW authored Jul 1, 2024
1 parent df3e5e7 commit 536408f
Show file tree
Hide file tree
Showing 11 changed files with 507 additions and 521 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Docs

on:
push:
branches:
- main
- dev1

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup up Python
uses: actions/setup-python@v2
with:
python-version: 3.11

- name: Install poetry
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Install dependencies
run: |
poetry install --only doc
- name: Build docs
run: |
poetry run sphinx-build -M html docs/source docs/build
- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/dev1'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/build/html

29 changes: 29 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Lint

on:
- push
- pull_request

jobs:
linting-with-mypy-and-ruff:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10'] # Adjust as necessary based on your setup

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Install dependencies with Poetry
run: poetry install
- name: Run mypy
run: poetry run tox -e mypy
- name: Run ruff
run: poetry run tox -e ruff
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: Tests
name: Test

on:
- push
- pull_request

jobs:
tests:
testing-with-pytest:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.9', '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11', '3.12']
include:
- os: ubuntu-latest
envs: ruff,mypy # Specify environments to run only on Ubuntu
Expand All @@ -30,4 +30,4 @@ jobs:

- name: Test using poetry run tox
run: |
poetry run tox
poetry run tox -e py${{ matrix.python-version }}
55 changes: 21 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,21 @@
<h2 align="center">pyBL: An open-source Python package for stochastic modeling of rainfall using the Bartlett-Lewis Rectangular Pulse model.</h2>

<p align="center">
<a href="http://makeapullrequest.com">
<img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg">
</a>
<a href="#">
<img src="https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square">
</a>
<a href="http://makeapullrequest.com"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg"></a>
<a href="https://github.com/NTU-CompHydroMet-Lab/pyBL/actions/workflows/test.yml"><img src="https://github.com/NTU-CompHydroMet-Lab/pyBL/actions/workflows/test.yml/badge.svg"></a>
<a href="https://github.com/NTU-CompHydroMet-Lab/pyBL/actions/workflows/docs.yml"><img src="https://github.com/NTU-CompHydroMet-Lab/pyBL/actions/workflows/docs.yml/badge.svg"></a>
<a href="https://github.com/NTU-CompHydroMet-Lab/pyBL/actions/workflows/lint.yml"><img src="https://github.com/NTU-CompHydroMet-Lab/pyBL/actions/workflows/lint.yml/badge.svg"></a>
<a><img src="https://img.shields.io/pypi/pyversions/pyBLRP"></a>
</p>

<p align="center">
<a href="#key-features">Key Features</a> •
<a href="#model-description">Model Description</a> •
<a href="#workflow-of-pybl">Workflow of pyBL</a> •
<a href="#installation-guide">Installation Guide</a> •
<a href="#usage">Usage</a> •
<!-- <a href="#community">Community</a> • -->
<!-- <a href="#acknowledgements">Acknowledgements</a> • -->
<!-- <a href="#license">License</a> -->
<a href="#references">References</a>
</p>
## Table of Content

- [Key Features](#key-features)
- [Model Description](#model-description)
- [Installation](#installation-guide)
- [Getting Started](#workflow-of-pyBL)
- Documentation: https://ntu-comphydromet-lab.github.io/pyBL/


## Key Features
- **Realistic rainfall Modelling**: Simulations of rainfall time series with realistic feaytures using the Bartlett-Lewis Rectangular Pulse model.
Expand All @@ -42,6 +38,11 @@ The Bartlett-Lewis Rectangular Pulses model, enhanced in this package, draws on

![fig01-RBL](https://raw.githubusercontent.com/NTU-CompHydroMet-Lab/pyBL/main/assets/fig01-RBL.png)

## Installation Guide
To install the pyBL package, simply install with `pip`.
```bash
pip install pyblrp
```

## Workflow of pyBL

Expand All @@ -55,34 +56,20 @@ The pyBL package employs a systematic workflow to generate synthetic rainfall ti
- Sampling storms and generating synthetic rainfall time series.
- Rescaling and validating the synthesized time series.

You can refer to the tutorial in [**`examples/quick_start`**](https://github.com/NTU-CompHydroMet-Lab/pyBL/blob/main/examples/quick_start/quick_start.ipynb).

<!-- //CY: the necessarity of adding this line? -->
<!-- For a detailed breakdown of each step, see our Detailed Workflow Documentation. -->

![fig02-package-workflow](https://raw.githubusercontent.com/NTU-CompHydroMet-Lab/pyBL/main/assets/fig02-package-workflow.png)


## Installation Guide

To install the pyBL package, follow these steps:

1. **Clone the project:**

```sh
git clone https://github.com/NTU-CompHydroMet-Lab/pyBL.git
cd pyBL
```
2. **Install dependencies:**

```sh
pip install -r requirements.txt
```

## Usage

Here's a simple example of how to use the pyBL package:


1. **Start quickly**: Begin with `quick_start.py`, which demonstrates the end-to-end process using historical rainfall data from Bochum, Germany.
1. **Start quickly**: Begin with [**`examples/quick_start`**](https://github.com/NTU-CompHydroMet-Lab/pyBL/blob/main/examples/quick_start/quick_start.ipynb), which demonstrates the end-to-end process using historical rainfall data from Bochum, Germany.
<!--
2. **Some simple examples**
Expand Down
30 changes: 0 additions & 30 deletions docs/requirements-doc.txt

This file was deleted.

2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
project = "pyBL"
copyright = "2023, KilinWei"
author = "KilinWei"
release = "1.0.0"
release = "1.0.1"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
Loading

0 comments on commit 536408f

Please sign in to comment.