Skip to content

Commit e38fd6e

Browse files
authored
Merge pull request #27 from Serapieum-of-alex/more-distributions
More distributions
2 parents 36d4b5d + 29e5436 commit e38fd6e

27 files changed

+3246
-526
lines changed

.pre-commit-config.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ repos:
4343
# hooks:
4444
# - id: isort
4545
# name: "[py - format] isort"
46-
- repo: https://github.com/PyCQA/docformatter
47-
rev: v1.4
48-
hooks:
49-
- id: docformatter
50-
name: "[py - format] docformatter"
51-
args: [ -i, --wrap-summaries, "0" ]
46+
# - repo: https://github.com/PyCQA/docformatter
47+
# rev: v1.4
48+
# hooks:
49+
# - id: docformatter
50+
# name: "[py - format] docformatter"
51+
# args: [ -i, --wrap-summaries, "0" ]
5252

5353
- repo: https://github.com/PyCQA/pydocstyle
5454
rev: 6.1.1
@@ -57,12 +57,12 @@ repos:
5757
name: "[py - check] pydocstyle"
5858
files: ^Hapi/
5959

60-
- repo: https://gitlab.com/pycqa/flake8
61-
rev: 4.0.1
60+
- repo: https://github.com/PyCQA/flake8
61+
rev: 6.0.0
6262
hooks:
6363
- id: flake8
6464
name: "[py - check] flake8"
65-
language_version: python3.9
65+
# language_version: python3.9
6666
exclude: ^(examples/|tests/)
6767

6868
#- repo: https://github.com/psf/black
@@ -74,7 +74,7 @@ repos:
7474
hooks:
7575
- id: black
7676
name: "[py - format] black"
77-
language_version: python3.9
77+
# language_version: python3.9
7878
- repo: https://github.com/lovesegfault/beautysh
7979
rev: v6.2.1
8080
hooks:
@@ -108,7 +108,7 @@ repos:
108108
hooks:
109109
- id: pytest-check
110110
name: pytest-check
111-
entry: pytest -vvv --cov=Hapi
111+
entry: pytest -vvv --cov=statista
112112
language: system
113113
pass_filenames: false
114114
always_run: true

HISTORY.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,13 @@ History
2424

2525
* add eva (Extreme value analysis) module
2626
* fix bug in obtaining distribution parameters using optimization method
27+
28+
29+
0.3.0 (2023-02-19)
30+
------------------
31+
32+
* add documentations for both GEV and gumbel distributions.
33+
* add lmoment parameter estimation method for all distributions.
34+
* add exponential and normal distributions
35+
* modify the pdf, cdf, and probability plot plots
36+
* create separate plot and confidence_interval modules.

README.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,19 @@ statista
2626

2727
Main Features
2828
-------------
29-
- Statistical Distributions (GEV/GUMBL)
30-
- Parameter estimation Lmoments/ML/MOM
29+
- Statistical Distributions
30+
- GEV
31+
- GUMBL
32+
- Normal
33+
- Exponential
34+
- Parameter estimation methods
35+
- Lmoments
36+
- ML
37+
- MOM
3138
- One-at-time (O-A-T) Sensitivity analysis.
3239
- Sobol visualization
33-
- Statistical Metrics
34-
35-
Future work
36-
-------------
37-
- More distributions
40+
- Statistical descriptors
41+
- Extreme value analysis
3842

3943

4044
Installing statista
@@ -61,7 +65,7 @@ pip install git+https://github.com/MAfarrag/statista
6165
## pip
6266
to install the last release you can easly use pip
6367
```
64-
pip install statista==0.2.0
68+
pip install statista==0.3.0
6569
```
6670

6771
Quick start

docs/conf.py

Lines changed: 39 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@
88
#
99
# All configuration values have a default; values that are commented out
1010
# serve to show the default.
11+
1112
import os
1213
import sys
1314

1415
# import sphinx_rtd_theme
1516

1617
# General information about the project.
17-
project = "pyramids"
18+
project = "statista"
1819
author = "Mostafa Farrag"
1920

2021
# copyright = u"2013-2019, "
2122

22-
2323
html_theme = "sphinxdoc"
2424
# html_theme = "agogo"
2525
html_theme_path = ["."]
@@ -28,7 +28,7 @@
2828
# If extensions (or modules to document with autodoc) are in another directory,
2929
# add these directories to sys.path here. If the directory is relative to the
3030
# documentation root, use os.path.abspath to make it absolute, like shown here.
31-
sys.path.insert(0, os.path.abspath("../pyramids"))
31+
sys.path.insert(0, os.path.abspath("../statista"))
3232
sys.path.insert(0, os.path.abspath(".."))
3333
sys.path.insert(0, os.path.abspath("../examples"))
3434

@@ -37,7 +37,7 @@
3737
# os.path.abspath to make it absolute, like shown here.
3838
sys.path.append(os.path.abspath("sphinxext"))
3939

40-
# import pyramids
40+
# import statista
4141

4242

4343
# -- General configuration -----------------------------------------------------
@@ -48,13 +48,19 @@
4848
# Add any Sphinx extension module names here, as strings. They can be extensions
4949
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
5050
extensions = [
51-
"matplotlib.sphinxext.plot_directive",
52-
"sphinx.ext.todo",
53-
"sphinx.ext.mathjax",
5451
"sphinx.ext.autodoc",
55-
"sphinx.ext.graphviz",
56-
"sphinx.ext.doctest",
57-
"sphinx.ext.autosectionlabel",
52+
"sphinx.ext.coverage",
53+
"sphinx.ext.viewcode",
54+
"sphinx.ext.imgmath",
55+
"easydev.copybutton",
56+
# "matplotlib.sphinxext.plot_directive",
57+
# "sphinx.ext.todo",
58+
# "sphinx.ext.mathjax",
59+
# "sphinx.ext.graphviz",
60+
# "sphinx.ext.doctest",
61+
# "sphinx.ext.autosectionlabel",
62+
"numpydoc",
63+
"nbsphinx",
5864
]
5965

6066
autosectionlabel_prefix_document = True
@@ -117,7 +123,9 @@
117123

118124
# The theme to use for HTML and HTML Help pages. See the documentation for
119125
# a list of builtin themes.
120-
html_theme = "sphinx_rtd_theme"
126+
# html_theme = "sphinx_rtd_theme"
127+
html_theme = "pydata_sphinx_theme"
128+
121129

122130
# Theme options are theme-specific and customize the look and feel of a theme
123131
# further. For a list of options available for each theme, see the
@@ -137,7 +145,7 @@
137145
# The name of an image file (relative to this directory) to place at the top
138146
# of the sidebar.
139147
"""
140-
html_logo = "images/pyramids.png"
148+
html_logo = "images/statista.png"
141149
"""
142150
# The name of an image file (within the static path) to use as favicon of the
143151
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
@@ -164,7 +172,13 @@
164172
# html_use_smartypants = True
165173

166174
# Custom sidebar templates, maps document names to template names.
167-
# html_sidebars = {}
175+
html_sidebars = {
176+
"**": [
177+
"globaltoc.html",
178+
"relations.html", # needs 'show_related': True theme option to display
179+
"searchbox.html",
180+
]
181+
}
168182

169183
# Additional templates that should be rendered to pages, maps page names to
170184
# template names.
@@ -197,16 +211,20 @@
197211
html_file_suffix = ".html"
198212

199213
# Output file base name for HTML help builder.
200-
htmlhelp_basename = "pyramidsdoc"
214+
htmlhelp_basename = "statistadoc"
201215

202216

203217
# -- Options for LaTeX output --------------------------------------------------
204-
205-
206218
# Grouping the document tree into LaTeX files. List of tuples
207219
# (source start file, target name, title, author, documentclass [howto/manual]).
208220
latex_documents = [
209-
("index", "pyramids.tex", "pyramids Documentation", "Mostafa Farrag", "report")
221+
(
222+
"index",
223+
"statista.tex",
224+
"statista Documentation",
225+
"Mostafa Farrag",
226+
"report",
227+
)
210228
]
211229

212230
# The name of an image file (relative to this directory) to place at the top of
@@ -234,7 +252,7 @@
234252

235253
# One entry per manual page. List of tuples
236254
# (source start file, name, description, authors, manual section).
237-
man_pages = [("index", "pyramids", "pyramids Documentation", [author], 1)]
255+
man_pages = [("index", "statista", "statista Documentation", [author], 1)]
238256

239257
# If true, show URL addresses after external links.
240258
# man_show_urls = False
@@ -248,10 +266,9 @@
248266
texinfo_documents = [
249267
(
250268
"index",
251-
"pyramids",
252-
"pyramids Documentation",
269+
"statista",
270+
"statista Documentation",
253271
"Mostafa Farrag",
254-
"pyramids",
255272
"One line description of project.",
256273
"Miscellaneous",
257274
)
@@ -277,5 +294,5 @@
277294
# "netCDF4_utils",
278295
# "netcdftime",
279296
# "pyproj",
280-
# "pyramids.version",
297+
# "statista.version",
281298
]

docs/distributions.rst

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#############
2+
Distributions
3+
#############
4+
5+
********************************************
6+
Generalized extreme value distribution (GEV)
7+
********************************************
8+
9+
- The generalised extreme value (or generalized extreme value) distribution characterises the behaviour of ‘block
10+
maxima’
11+
12+
probability density function (pdf)
13+
==================================
14+
15+
.. math::
16+
f(x) = \frac{1}{\sigma}\ast{Q(x)}^{\xi+1}\ast e^{-Q(x)}
17+
18+
19+
.. math::
20+
Q(x) =
21+
\begin{cases}
22+
{(1+\xi(\frac{x-\mu}{\delta}))}^\frac{-1}{\xi} & \quad \text{if } \xi \text{ \neq 0}\\
23+
e^{-(\frac{x-\mu}{\delta})} & \quad \text{if } \xi \text{ = 0}
24+
\end{cases}
25+
26+
- where
27+
- :math: `\sigma` is the scale parameter
28+
- :math: `\mu` is the location parameter
29+
- :math: `\delta` is the scale parameter
30+
31+
32+
Cumulative distribution function (cdf)
33+
======================================
34+
35+
.. math::
36+
F(x)=e^{-Q(x)}
37+
38+
*******************
39+
Gumbel Distribution
40+
*******************
41+
42+
- The Gumbel distribution is a special case of the `Generalized extreme value distribution (GEV)`_ when the shape
43+
parameter :math: `\sigma` equals zero.
44+
45+
probability density function (pdf)
46+
==================================
47+
48+
.. math::
49+
f(x) = \frac{1}{\sigma} \ast { {e}^{-(\frac{x-\mu}{\delta}) - {e}^{- (\frac{x-\mu}{\delta})} }}
50+
51+
52+
Cumulative distribution function (cdf)
53+
======================================
54+
55+
.. math::
56+
F(x) = {e}^{- {e}^{- (\frac{x-\mu}{\delta})} }

docs/environment.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
channels:
22
- conda-forge
33
dependencies:
4-
- python >=3.9.0
5-
- pip >=21.3.1
6-
- matplotlib >=3.4.2,<3.6.0
7-
# - pandas >=1.3.2,<1.4.3
8-
# - pip:
9-
# - geoplot >=0.5.1
10-
# - loguru >=0.5.3
4+
- python >=3.9,<3.11
5+
- pip >=22.3.1
6+
- pandas
7+
- numpy==1.20.*
8+
- numpydoc==1.1.0
9+
- typing-extensions==3.10.*
10+
- pip:
11+
- pydata-sphinx-theme
12+
- nbsphinx
13+
- easydev
38.5 KB
Loading
77.8 KB
Loading
63.2 KB
Loading

docs/index.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@ Current release info
66
:target: https://pypi.org/project/statista/0.1.2/
77

88

9-
.. image:: https://img.shields.io/conda/v/conda-forge/hapi?label=conda-forge
9+
.. image:: https://img.shields.io/conda/v/conda-forge/statista?label=conda-forge
1010
:target: https://pypi.org/project/statista/0.1.2/
1111

1212

1313
.. image:: https://img.shields.io/pypi/pyversions/statista
1414
:target: https://pypi.org/project/statista/0.1.2/
1515

1616

17-
.. image:: https://img.shields.io/github/forks/mafarrag/hapi?style=social :alt: GitHub forks
17+
.. image:: https://img.shields.io/github/forks/mafarrag/statista?style=social :alt: GitHub forks
1818

1919

20-
.. image:: https://anaconda.org/conda-forge/hapi/badges/downloads.svg
21-
:target: https://anaconda.org/conda-forge/hapi
20+
.. image:: https://anaconda.org/conda-forge/statista/badges/downloads.svg
21+
:target: https://anaconda.org/conda-forge/statista
2222

2323

24-
.. image:: https://img.shields.io/conda/vn/conda-forge/hapi :alt: Conda (channel only)
24+
.. image:: https://img.shields.io/conda/vn/conda-forge/statista :alt: Conda (channel only)
2525
:target: https://pypi.org/project/statista/0.1.2/
2626

2727

@@ -37,8 +37,8 @@ Current release info
3737
:alt: PyPI
3838

3939

40-
.. image:: https://anaconda.org/conda-forge/hapi/badges/platforms.svg
41-
:target: https://anaconda.org/conda-forge/hapi
40+
.. image:: https://anaconda.org/conda-forge/statista/badges/platforms.svg
41+
:target: https://anaconda.org/conda-forge/statista
4242

4343

4444
.. image:: https://static.pepy.tech/personalized-badge/statista?period=total&units=international_system&left_color=grey&right_color=blue&left_text=Downloads
@@ -81,6 +81,6 @@ Main Features
8181
:hidden:
8282
:maxdepth: 1
8383

84-
Installation <00Installation.rst>
85-
Tutorial <03tutorial.rst>
86-
GIS <05GIS.rst>
84+
Installation <installation.rst>
85+
Distributions <distributions.rst>
86+
Sensitivity analysis <sensitivity_analysis.rst>

0 commit comments

Comments
 (0)