Skip to content

Commit

Permalink
restructure the distrubutions module (#91)
Browse files Browse the repository at this point in the history
* move all docs inside the `sources` file

* move all docs inside the `sources` file

* add auto docs

* replace using the environment.yml by requirements.txt

* adjust the naming convention

* adjust the naming convention

* adjust the naming convention

* remove the naming ci

* update hooks

* add example for the plotting position

* update dev dependencies

* make 3.11, 3.12 the testing python versions

* remove macos from ci

* add sensitivity to docs

* add sensitivity to docs

* add eva to docs

* update sensitivity

* fix senstivity docs

* add missing members

* update docs

* reformat

* reformat

* fix equation

* reformat

* add extensions for math equations

* reformat

* reformat

* add make docs files

* reformat

* reformat

* add plot docs

* add plot docs

* add gev equation

* fix error in gev equation

* fix the `\left` error in gev equation

* try to separate the two line equation

* try to separate the two line equation

* try to separate the two line equation

* try to separate the two line equation

* try to separate the two line equation

* add labels to the equations

* fix equation labels

* fix equation labels

* unify gev and gumbel

* add cdf to gev and gumbel

* add cdf to normal and exponential dists

* add fx and FX

* reformat

* add check to test_fit_model

* add check to test_fit_model

* add check to test_fit_model

* use Agg as backend in test files

* simplify the test `TestGUMBEL::test_probability_plot`

* simplify the test `TestGEV::test_probability_plot`

* fix the Extreme value analysis.ipynb notebook

* remove spaces from scripts names

* use the factory class `Distribution` in the notebook

* add examples

* rename `theoretical_estimate`  to `inverse_cdf`

* remove the `chisquare` test from the `fit_model`

* add examples

* add missing images

* correct images path

* add properties

* the `parameter` argument is optional for the pdf and cdf

* switch parameters for the `inverse_cdf` method

* reformat

* add docstring

* add images

* reformat

* correct the `inverse_cdf` parameter order in the abstract class method

* remove the `dstatic`, `chi_pvalue`, `ks_pvalue properties

* reformat

* rename the metrics module to descriptors

* rename metrics to descriptors

* instantiating the distribution by either the parameter or the data

* add description to gumbel

* correct the `actual_data` parameter in the `cdf` method

* correct the `actual_data` parameter in the `pdf` method

* update the docstring for the `pdf` and `cdf` methods

* return lost commits

* validate parameters and data in the distribution constructor

* add `random` method to `gumbel`

* test providing the `pdf` and `cdf` with data parameters

* add example to the `random` method in `gumbel` distribution

* add example to the `random` method in `gev` distribution

* reformat

* add examples to the `exponential` class

* update examples of the `gumbel` class

* update examples of the `GEV` class

* unifyt the docs of `ks` method

* the argument `parameter` in the `confidence_interval` method is now optional and moved to the end

* check the length of the cdf and data

* abstract code into `confidence_level` function

* provide the parameters as a kwarg in the `probability_plot`.

* reformat docstring

* the `prob_non_exceed` is now optional for the `confidence_interval` function

* make the `prob_non_exceed` optional in the `confidence_interval` for the GEV class

* remove duplicate test

* reformat

* test `confidence_interval` with the default parameters

* update example

* add example and test Gumbel.confidence_interval

* add example and test GEV.confidence_interval

* add images for the examples

* move the `cdf` parameter to the end and make it kwarg in the `probability_plot` in gumbel and gev

* update dependencies

* add the main features to docs

* update installation docs

* add plt.show at the end of all the plots

* remove the `confidence_interval` plot from the `probability_plot` method

* update rhine example

* update docstring

* add `__str__` method

* rename `probability_plot` to "plot"

* move the `parameters` argument in the `pdf` and `cdf` function to the end

* correct the matplotlib backend

* update plot gumbel example

* update plot gev example

* rename the figsize parameter to fig_size for all functions

* update the docstring of the `AbstractDistribution.plot`

* add missing figures for the docstring

* reorder the `plot` method `parameters` in the abstract method

* reorder the `confidence_interval` method `parameters` in all classes

* rename the `significance_level` parameter to the `ams_analysis` to `alpha`

* add examples to the `ams_analysis`

* update the examples of the `ams_analysis`

* add missing images

* rename the objective_fn to truncated_distribution

* comment the truncated_distribution function

* update checklist files

* update ci workflows

* rename `statfunction` to `state_function`in the `confidence_interval.boot_strap`

* add a script for the truncated_distribution

* update examples

* update examples

* remove the python version from the environment.yml
  • Loading branch information
MAfarrag authored Aug 18, 2024
1 parent b3a7525 commit 9328e31
Show file tree
Hide file tree
Showing 92 changed files with 6,508 additions and 2,786 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/conda-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:

- name: Install dev-dependencies
run: |
python -m pip install -r requirements-dev.txt
pip install .[dev] --no-deps
- name: Run tests
shell: bash -el {0}
Expand Down
29 changes: 0 additions & 29 deletions .github/workflows/pull-request-naming-validation.yml

This file was deleted.

7 changes: 3 additions & 4 deletions .github/workflows/pypi-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.9", "3.10", "3.11"]
os: [ubuntu-latest, windows-latest] # , macos-latest
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
Expand All @@ -25,8 +25,7 @@ jobs:

- name: Install dependencies
run: |
pip install -r requirements.txt -r requirements-dev.txt
python setup.py install
pip install .[dev]
- name: Generate coverage report
run: |
Expand Down
22 changes: 19 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
fail_fast: true
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: end-of-file-fixer
name: "[py - check] validate yaml"
Expand Down Expand Up @@ -58,7 +58,7 @@ repos:
files: ^Hapi/

- repo: https://github.com/pycqa/flake8
rev: 6.1.0
rev: 7.1.0
hooks:
- id: flake8
name: "[py - check] flake8"
Expand All @@ -70,7 +70,7 @@ repos:
# hooks:
# - id: black
- repo: https://github.com/ambv/black
rev: 22.8.0
rev: 24.8.0
hooks:
- id: black
name: "[py - format] black"
Expand Down Expand Up @@ -112,3 +112,19 @@ repos:
language: system
pass_filenames: false
always_run: true

- repo: local
hooks:
- id: examples-notebook-check
name: nbval
entry: pytest --nbval
language: system
files: \.ipynb$

- repo: local
hooks:
- id: doctest
name: doctest
entry: pytest --doctest-modules
language: system
files: statista\.py$
19 changes: 12 additions & 7 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,20 @@
# Required
version: 2

conda:
environment: docs/environment.yml
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py
#Build documentation with MkDocs
#mkdocs:
# configuration: mkdocs.yml
configuration: docs/source/conf.py

build:
os: "ubuntu-22.04"
tools:
python: "3.12"

python:
install:
- method: pip
path: .
extra_requirements:
- docs

# Optionally build your docs in additional formats such as PDF and ePub
formats: all
24 changes: 24 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,27 @@ History
* Use factory design pattern to create the distributions.
* add tests for the eva module.
* use snake_case for the methods and variables.

0.6.0 (2024-08-18)
------------------

dev
"""
* Add documentations for the `distributions`, and `eva` modules.
* Add autodoc for all modules.
* Test docstrings as part of CI and pre-commit hooks.
* Test notebooks as part of CI.
* Simplify test for the distributions module

distributions
"""""""""""""
* move the `cdf` and `parameters` for all the methods to be optional parameters.
* rename `theoretical_estimate` method to `inverse_cdf`.
* All distributions can be instantiated with the parameters and/or data.
* rename the `probability_plot` method to `plot`.
* move the `confidence_interval` plot from the `probability_plot/plot` to the method `confidence_interval` and can be
called by activating the `plot_figure=True`.

descriptors
"""""""""""
* rename the `metrics` module to `descriptors`.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Main Features
-------------
- Statistical Distributions
- GEV
- GUMBL
- GUMBEL
- Normal
- Exponential
- Parameter estimation methods
Expand All @@ -40,6 +40,7 @@ Main Features
- Statistical descriptors
- Extreme value analysis

For the full documentation, please visit [statista documentation](https://statista.readthedocs.io/en/latest/?badge=latest)

Installing statista
===============
Expand All @@ -50,22 +51,22 @@ Installing `statista` from the `conda-forge` channel can be achieved by:
conda install -c conda-forge statista
```

It is possible to list all of the versions of `statista` available on your platform with:
It is possible to list all the versions of `statista` available on your platform with:

```
conda search statista --channel conda-forge
```

## Install from Github
to install the last development to time you can install the library from github
## Install from GitHub
to install the last development to time, you can install the library from GitHub
```
pip install git+https://github.com/MAfarrag/statista
```

## pip
to install the last release you can easly use pip
to install the last release, you can use pip
```
pip install statista==0.5.0
pip install statista==0.6.0
```

Quick start
Expand Down
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
Loading

0 comments on commit 9328e31

Please sign in to comment.