Skip to content

Commit

Permalink
run pre-commit in all files
Browse files Browse the repository at this point in the history
  • Loading branch information
MAfarrag committed Sep 18, 2022
1 parent 6c41de3 commit 8984728
Show file tree
Hide file tree
Showing 16 changed files with 331 additions and 335 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[flake8]
ignore = E203, E266, E501, W503
ignore = E203, E266, E501, W503, E741
max-line-length = 88
max-complexity = 18
select = B,C,E,F,W,T4
5 changes: 3 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ repos:
- id: flake8
name: "[py - check] flake8"
language_version: python3.9
exclude: ^(examples/|tests/)

- repo: https://github.com/psf/black
rev: 19.3b0
rev: 22.8.0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-isort
Expand All @@ -68,7 +69,7 @@ repos:
- id: isort
name: "[py - format] isort"
- repo: https://github.com/ambv/black
rev: 20.8b1
rev: 22.8.0
hooks:
- id: black
name: "[py - format] black"
Expand Down
17 changes: 8 additions & 9 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,18 @@
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import os
import sys

# import sphinx_rtd_theme

# General information about the project.
project = u"pyramids"
project = "pyramids"
author = "Mostafa Farrag"

# copyright = u"2013-2019, "


import os
import sys

# import sphinx_rtd_theme

html_theme = "sphinxdoc"
# html_theme = "agogo"
html_theme_path = ["."]
Expand Down Expand Up @@ -207,7 +206,7 @@
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
("index", "pyramids.tex", u"pyramids Documentation", u"Mostafa Farrag", "report")
("index", "pyramids.tex", "pyramids Documentation", "Mostafa Farrag", "report")
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -250,8 +249,8 @@
(
"index",
"pyramids",
u"pyramids Documentation",
u"Mostafa Farrag",
"pyramids Documentation",
"Mostafa Farrag",
"pyramids",
"One line description of project.",
"Miscellaneous",
Expand Down
23 changes: 17 additions & 6 deletions examples/Extreme value statistics.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""
Created on Wed Sep 9 23:31:11 2020
"""Created on Wed Sep 9 23:31:11 2020.
@author: mofarrag
"""
Expand All @@ -8,7 +7,7 @@
os.chdir(r"C:\MyComputer\01Algorithms\Statistics\statista")
import matplotlib

matplotlib.use('TkAgg')
matplotlib.use("TkAgg")
# import scipy.optimize as so
# import matplotlib.pyplot as plt
# import numpy as np
Expand Down Expand Up @@ -112,16 +111,28 @@

func = ConfidenceInterval.GEVfunc
upper, lower = Gevdist.confidenceInterval(
shape, loc, scale, F=cdf_Weibul, alpha=0.1, statfunction=func, n_samples=len(time_series1)
shape,
loc,
scale,
F=cdf_Weibul,
alpha=0.1,
statfunction=func,
n_samples=len(time_series1),
)
#%%
"""
calculate the confidence interval using the boot strap method directly
"""
CI = ConfidenceInterval.BootStrap(
time_series1, statfunction=func, gevfit=Param_dist, n_samples=len(time_series1), F=cdf_Weibul
time_series1,
statfunction=func,
gevfit=Param_dist,
n_samples=len(time_series1),
F=cdf_Weibul,
)
LB = CI["LB"]
UB = CI["UB"]
#%%
fig, ax = Gevdist.probapilityPlot(shape, loc, scale, cdf_Weibul, func=func, n_samples=len(time_series1))
fig, ax = Gevdist.probapilityPlot(
shape, loc, scale, cdf_Weibul, func=func, n_samples=len(time_series1)
)
5 changes: 2 additions & 3 deletions examples/SensitivityAnalysis.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""
Created on Sun Jun 21 01:55:25 2020
"""Created on Sun Jun 21 01:55:25 2020.
@author: mofarrag
"""
Expand All @@ -10,7 +9,7 @@
# os.chdir(Path)
import pandas as pd

matplotlib.use('TkAgg')
matplotlib.use("TkAgg")

# functions
import Hapi.rrm.hbv_bergestrom92 as HBVLumped
Expand Down
3 changes: 1 addition & 2 deletions examples/interpolation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""
Created on Sat Apr 3 16:02:54 2021
"""Created on Sat Apr 3 16:02:54 2021.
@author: mofarrag
"""
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ loguru >=0.6.0
matplotlib >=3.5.3
pandas >=1.4.4
pip >=22.2.2
# python >=3.9,<3.12
scikit-learn >=1.1.2
scipy >=1.9.1
14 changes: 8 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
with open("README.md", "r") as readme_file:
readme = readme_file.read()

with open('HISTORY.rst') as history_file:
with open("HISTORY.rst") as history_file:
history = history_file.read()

requirements = [line.strip() for line in open("requirements.txt").readlines()]
requirements = requirements[1:]

test_requirements = ['pytest>=3', ]
test_requirements = [
"pytest>=3",
]

setup(
name="statista",
Expand All @@ -19,20 +21,20 @@
author_email="[email protected]",
url="https://github.com/MAfarrag/statista",
keywords=["statistics", "distributions"],
long_description=readme + '\n\n' + history,
long_description=readme + "\n\n" + history,
long_description_content_type="text/markdown",
license="GNU General Public License v3",
zip_safe=False,
packages=find_packages(include=['statista', 'statista.*']),
packages=find_packages(include=["statista", "statista.*"]),
test_suite="tests",
tests_require=test_requirements,
install_requires=requirements,
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Natural Language :: English",
'Programming Language :: Python :: 3',
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
Expand Down
13 changes: 7 additions & 6 deletions statista/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

# documentation format
__author__ = "Mostafa Farrag"
__email__ = '[email protected]'
__email__ = "[email protected]"
__docformat__ = "restructuredtext"

# Let users know if they're missing any of our hard dependencies
Expand All @@ -25,15 +25,16 @@
__import__(dependency)
except ImportError as e:
missing_dependencies.append(dependency)
print(e)

if missing_dependencies:
raise ImportError("Missing required dependencies {0}".format(missing_dependencies))

import statista.distributions
import statista.metrics
import statista.parameters
import statista.sensitivity
import statista.tools
# import statista.distributions
# import statista.metrics
# import statista.parameters
# import statista.sensitivity
# import statista.tools

__doc__ = """
statista - statistics package
Expand Down
Loading

0 comments on commit 8984728

Please sign in to comment.