├── CRPS ├── __init__.py └── CRPS.py ├── setup.cfg ├── acrps.jpg ├── crps.jpg ├── fcrps.jpg ├── setup.py ├── README.md ├── config.py └── LICENSE /CRPS/__init__.py: -------------------------------------------------------------------------------- 1 | from .CRPS import CRPS 2 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [metadata] 2 | description-file = README.md 3 | -------------------------------------------------------------------------------- /acrps.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gouthamnaveen/CRPS/HEAD/acrps.jpg -------------------------------------------------------------------------------- /crps.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gouthamnaveen/CRPS/HEAD/crps.jpg -------------------------------------------------------------------------------- /fcrps.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gouthamnaveen/CRPS/HEAD/fcrps.jpg -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import pathlib 2 | from setuptools import setup, find_packages 3 | 4 | HERE = pathlib.Path(__file__).parent 5 | 6 | VERSION = '2.0.2' 7 | PACKAGE_NAME = 'CRPS' 8 | AUTHOR = 'Naveen Goutham' 9 | AUTHOR_EMAIL = 'naveen.goutham@outlook.com' 10 | URL = 'https://github.com/garovent/CRPS' 11 | 12 | LICENSE = 'Apache License 2.0' 13 | DESCRIPTION = 'A package to compute the Continuous Ranked Probability Score (CRPS), the Fair-CRPS, and the Adjusted-CRPS. Read the documentation at https://github.com/garovent/CRPS' 14 | LONG_DESCRIPTION = (HERE / "README.md").read_text() 15 | LONG_DESC_TYPE = "text/markdown" 16 | 17 | INSTALL_REQUIRES = [ 18 | 'numpy'] 19 | 20 | setup(name=PACKAGE_NAME, 21 | version=VERSION, 22 | description=DESCRIPTION, 23 | long_description=LONG_DESCRIPTION, 24 | long_description_content_type=LONG_DESC_TYPE, 25 | author=AUTHOR, 26 | license=LICENSE, 27 | author_email=AUTHOR_EMAIL, 28 | url=URL, 29 | install_requires=INSTALL_REQUIRES, 30 | keywords=['crps','continuous ranked probability score','fair crps','adjusted crps','proper score','probability score','ensemble forecast','python'], 31 | packages=find_packages() 32 | ) 33 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Documentation 2 | 3 | A package to compute the continuous ranked probability score (crps) (Matheson and Winkler, 1976; Hersbach, 2000), the fair-crps (fcrps) (Ferro et al., 2008), and the adjusted-crps (acrps) (Ferro et al., 2008) given an ensemble prediction and an observation. 4 | 5 | The CRPS is a negatively oriented score that is used to compare the empirical distribution of an ensemble prediction to a scalar observation. 6 | 7 | _References_: 8 | 9 | [1] Matheson, J. E. & Winkler, R. L. Scoring Rules for Continuous Probability Distributions. Management Science 22, 1087–1096 (1976). 10 | 11 | [2] Hersbach, H. Decomposition of the Continuous Ranked Probability Score for Ensemble Prediction Systems. Wea. Forecasting 15, 559–570 (2000). 12 | 13 | [3] Ferro, C. A. T., Richardson, D. S. & Weigel, A. P. On the effect of ensemble size on the discrete and continuous ranked probability scores. Meteorological Applications 15, 19–24 (2008). 14 | 15 | ## _Installation:_ 16 | 17 | ```sh 18 | pip install CRPS 19 | ``` 20 | 21 | ## _Parameters:_ 22 | 23 | **ensemble_members**: numpy.ndarray 24 | 25 | The predicted ensemble members. They will be sorted in ascending order automatically. 26 | 27 | Ex: np.array([2.1,3.5,4.7,1.2,1.3,5.2,5.3,4.2,3.1,1.7]) 28 | 29 | **observation**: float 30 | 31 | The observed scalar. 32 | 33 | Ex: 5.4 34 | 35 | **adjusted_ensemble_size**: int, optional 36 | 37 | The size the ensemble needs to be adjusted to before computing the Adjusted Continuous Ranked Probability Score. The default is 200. 38 | 39 | _Note_: The crps becomes equal to acrps when adjusted_ensemble_size equals the length of the ensemble_members. 40 | 41 | ## _Method(s):_ 42 | 43 | **compute()**: 44 | 45 | Computes the continuous ranked probability score (crps), the fair-crps (fcrps), and the adjusted-crps (acrps). 46 | 47 | _Returns_: 48 | 49 | crps,fcrps,acrps 50 | 51 | ## _Attributes:_ 52 | 53 | **crps**: Continuous Ranked Probability Score 54 | 55 | It is the integral of the squared difference between the CDF of the forecast ensemble and the observation. 56 | 57 | ![crps](crps.jpg) 58 | 59 | **fcrps**: Fair-Continuous Ranked Probability Score 60 | 61 | It is the crps computed assuming an infinite ensemble size. 62 | 63 | ![fcrps](fcrps.jpg) 64 | 65 | where m is the current ensemble size (i.e., len(ensemble_members)) 66 | 67 | **acrps**: Adjusted-Continuous Ranked Probability Score 68 | 69 | It is the crps computed assuming an ensemble size of M. 70 | 71 | ![acrps](acrps.jpg) 72 | 73 | where M is the adjusted_ensemble_size 74 | 75 | ## _Demonstration:_ 76 | 77 | ```sh 78 | import numpy as np 79 | import CRPS.CRPS as pscore 80 | ``` 81 | 82 | Example - 1: 83 | ```sh 84 | In [1]: pscore(np.arange(1,5),3.5).compute() 85 | Out[1]: (0.625, 0.4166666666666667, 0.42083333333333334) 86 | ``` 87 | 88 | Example - 2: 89 | ```sh 90 | In [2]: crps,fcrps,acrps = pscore(np.arange(1,11),8.3,50).compute() 91 | In [3]: crps 92 | Out[3]: 1.6300000000000003 93 | In [4]: fcrps 94 | Out[4]: 1.446666666666667 95 | In [5]: acrps 96 | Out[5]: 1.4833333333333336 97 | ``` 98 | 99 | -------------------------------------------------------------------------------- /CRPS/CRPS.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | Created on Mon Sep 6 09:19:41 2021 5 | 6 | @author: Naveen GOUTHAM 7 | """ 8 | import numpy as np 9 | 10 | class CRPS: 11 | ''' 12 | A class to compute the continuous ranked probability score (crps) (Matheson and Winkler, 1976; Hersbach, 2000), the fair-crps (fcrps) (Ferro et al., 2008), and the adjusted-crps (acrps) (Ferro et al., 2008) given an ensemble prediction and an observation. 13 | 14 | The CRPS is a negatively oriented score that is used to compare the empirical distribution of an ensemble prediction to a scalar observation. 15 | 16 | References: 17 | [1] Matheson, J. E. & Winkler, R. L. Scoring Rules for Continuous Probability Distributions. Management Science 22, 1087–1096 (1976). 18 | [2] Hersbach, H. Decomposition of the Continuous Ranked Probability Score for Ensemble Prediction Systems. Wea. Forecasting 15, 559–570 (2000). 19 | [3] Ferro, C. A. T., Richardson, D. S. & Weigel, A. P. On the effect of ensemble size on the discrete and continuous ranked probability scores. Meteorological Applications 15, 19–24 (2008). 20 | 21 | ---------- 22 | 23 | Parameters: 24 | ensemble_members: numpy.ndarray 25 | The predicted ensemble members. They will be sorted automatically. 26 | Ex: np.array([2.1,3.5,4.7,1.2,1.3,5.2,5.3,4.2,3.1,1.7]) 27 | 28 | observation: float 29 | The observed value. 30 | Ex: 5.4 31 | 32 | adjusted_ensemble_size: int, optional 33 | The size the ensemble needs to be adjusted to before computing the Adjusted Continuous Ranked Probability Score. 34 | The default is 200. 35 | Note: The crps becomes equal to acrps when adjusted_ensemble_size equals the length of the ensemble_members. 36 | 37 | ---------- 38 | 39 | Method(s): 40 | 41 | compute(): 42 | Computes the continuous ranked probability score (crps), the fair-crps (fcrps), and the adjusted-crps (acrps). 43 | 44 | ---------- 45 | 46 | Attributes: 47 | crps: Continuous Ranked Probability Score 48 | It is the integral of the squared difference between the CDF of the forecast ensemble and the observation. 49 | 50 | .. math:: 51 | \mathrm{crps = \int_{-\infty}^{\infty} [F(y) - F_{o}(y)]^2 dy} 52 | 53 | fcrps: Fair-Continuous Ranked Probability Score 54 | It is the crps computed assuming an infinite ensemble size. 55 | 56 | .. math:: 57 | \mathrm{fcrps = crps - \int_{-\infty}^{\infty} [F(y) (1 - F(y))/(m-1)] dy}, 58 | 59 | where m is the current ensemble size (here: length of ensemble_members) 60 | 61 | acrps: Adjusted-Continuous Ranked Probability Score 62 | It is the crps computed assuming an ensemble size of M. 63 | 64 | .. math:: 65 | \mathrm{acrps = crps - \int_{-\infty}^{\infty} [(1 - m/M) F(y) (1 - F(y))/(m-1)] dy}, 66 | 67 | where M is the adjusted_ensemble_size 68 | 69 | ---------- 70 | 71 | Demonstration: 72 | 73 | import numpy as np 74 | import CRPS.CRPS as pscore 75 | 76 | Example - 1: 77 | In [1]: pscore(np.arange(1,5),3.5).compute() 78 | Out[1]: (0.625, 0.4166666666666667, 0.42083333333333334) 79 | 80 | Example - 2: 81 | In [2]: crps,fcrps,acrps = pscore(np.arange(1,11),8.3,50).compute() 82 | In [3]: crps 83 | Out[3]: 1.6300000000000003 84 | In [4]: fcrps 85 | Out[4]: 1.446666666666667 86 | In [5]: acrps 87 | Out[5]: 1.4833333333333336 88 | 89 | ''' 90 | def __init__(self,ensemble_members,observation,adjusted_ensemble_size=200): 91 | ''' 92 | Parameters: 93 | ensemble_members: numpy.ndarray 94 | The predicted ensemble members. 95 | Ex: np.array([2.1,3.5,4.7,1.2,1.3,5.2,5.3,4.2,3.1,1.7]) 96 | observation: float 97 | The observed value. 98 | Ex: 5.4 99 | adjusted_ensemble_size: int, optional 100 | The size the ensemble needs to be adjusted to before computing the Adjusted Continuous Ranked Probability Score. 101 | The default is 200. 102 | Note: The crps becomes equal to acrps when adjusted_ensemble_size equals the length of the ensemble_members. 103 | 104 | Returns 105 | ------- 106 | None 107 | 108 | ''' 109 | self.fc = np.sort(ensemble_members) 110 | self.ob = observation 111 | self.__m = len(self.fc) 112 | self.M = int(adjusted_ensemble_size) 113 | self.__cdf_fc = None 114 | self.__cdf_ob = None 115 | self.__delta_fc = None 116 | self.crps = None 117 | self.fcrps = None 118 | self.acrps = None 119 | 120 | def __str__(self): 121 | "Kindly refer to the __doc__ method for documentation. i.e. print(CRPS.__doc__)." 122 | 123 | def compute(self): 124 | ''' 125 | Returns 126 | ------- 127 | crps, fair-crps, adjusted-crps 128 | 129 | ''' 130 | if (self.ob is not np.nan) and (not np.isnan(self.fc).any()): 131 | if self.ob < self.fc[0]: 132 | self.__cdf_fc = np.linspace(0,(self.__m - 1)/self.__m,self.__m) 133 | self.__cdf_ob = np.ones(self.__m) 134 | all_mem = np.array([self.ob] + list(self.fc), dtype = object) 135 | self.__delta_fc = np.array([all_mem[n+1] - all_mem[n] for n in range(len(all_mem)-1)], dtype=object) 136 | 137 | elif self.ob > self.fc[-1]: 138 | self.__cdf_fc = np.linspace(1/self.__m,1,self.__m) 139 | self.__cdf_ob = np.zeros(self.__m) 140 | all_mem = np.array(list(self.fc) + [self.ob], dtype = object) 141 | self.__delta_fc = np.array([all_mem[n+1] - all_mem[n] for n in range(len(all_mem)-1)], dtype=object) 142 | 143 | elif self.ob in self.fc: 144 | self.__cdf_fc = np.linspace(1/self.__m,1,self.__m) 145 | self.__cdf_ob = (self.fc >= self.ob) 146 | all_mem = self.fc 147 | self.__delta_fc = np.array([all_mem[n+1] - all_mem[n] for n in range(len(all_mem)-1)] + list(np.zeros(1)), dtype=object) 148 | 149 | else: 150 | cdf_fc = [] 151 | cdf_ob = [] 152 | delta_fc = [] 153 | for f in range(len(self.fc)-1): 154 | if (self.fc[f] < self.ob) and (self.fc[f+1] < self.ob): 155 | cdf_fc.append((f+1)*1/self.__m) 156 | cdf_ob.append(0) 157 | delta_fc.append(self.fc[f+1] - self.fc[f]) 158 | elif (self.fc[f] < self.ob) and (self.fc[f+1] > self.ob): 159 | cdf_fc.append((f+1)*1/self.__m) 160 | cdf_fc.append((f+1)*1/self.__m) 161 | cdf_ob.append(0) 162 | cdf_ob.append(1) 163 | delta_fc.append(self.ob - self.fc[f]) 164 | delta_fc.append(self.fc[f+1] - self.ob) 165 | else: 166 | cdf_fc.append((f+1)*1/self.__m) 167 | cdf_ob.append(1) 168 | delta_fc.append(self.fc[f+1] - self.fc[f]) 169 | self.__cdf_fc = np.array(cdf_fc) 170 | self.__cdf_ob = np.array(cdf_ob) 171 | self.__delta_fc = np.array(delta_fc) 172 | 173 | self.crps = np.sum(np.array((self.__cdf_fc - self.__cdf_ob) ** 2)*self.__delta_fc) 174 | if self.__m == 1: 175 | self.fcrps = self.acrps = 'Not defined' 176 | else: 177 | self.fcrps = self.crps - np.sum(np.array(((self.__cdf_fc * (1 - self.__cdf_fc))/(self.__m-1))*self.__delta_fc)) 178 | self.acrps = self.crps - np.sum(np.array((((1 - (self.__m/self.M)) * self.__cdf_fc * (1 - self.__cdf_fc))/(self.__m-1))*self.__delta_fc)) 179 | return self.crps, self.fcrps, self.acrps 180 | else: 181 | return np.nan, np.nan, np.nan 182 | 183 | -------------------------------------------------------------------------------- /config.py: -------------------------------------------------------------------------------- 1 | # test documentation build configuration file, created by 2 | # sphinx-quickstart on Sun Jun 26 00:00:43 2016. 3 | # 4 | # This file is executed through importlib.import_module with 5 | # the current directory set to its containing dir. 6 | # 7 | # Note that not all possible configuration values are present in this 8 | # autogenerated file. 9 | # 10 | # All configuration values have a default; values that are commented out 11 | # serve to show the default. 12 | 13 | # If extensions (or modules to document with autodoc) are in another directory, 14 | # add these directories to sys.path here. If the directory is relative to the 15 | # documentation root, use os.path.abspath to make it absolute, like shown here. 16 | # 17 | # import os 18 | # import sys 19 | # sys.path.insert(0, os.path.abspath('.')) 20 | 21 | # -- General configuration ------------------------------------------------ 22 | 23 | # If your documentation needs a minimal Sphinx version, state it here. 24 | # 25 | # needs_sphinx = '1.0' 26 | 27 | # Add any Sphinx extension module names here, as strings. They can be 28 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom 29 | # ones. 30 | extensions = [] 31 | 32 | # Add any paths that contain templates here, relative to this directory. 33 | templates_path = ['_templates'] 34 | 35 | # The suffix(es) of source filenames. 36 | # You can specify multiple suffix as a list of string: 37 | # 38 | # source_suffix = ['.rst', '.md'] 39 | source_suffix = '.rst' 40 | 41 | # The encoding of source files. 42 | # 43 | # source_encoding = 'utf-8-sig' 44 | 45 | # The master toctree document. 46 | root_doc = 'index' 47 | 48 | # General information about the project. 49 | project = 'CRPS' 50 | copyright = '2022, Naveen Goutham' 51 | author = 'Naveen Goutham' 52 | 53 | # The version info for the project you're documenting, acts as replacement for 54 | # |version| and |release|, also used in various other places throughout the 55 | # built documents. 56 | # 57 | # The short X.Y version. 58 | version = 2.0.2 59 | # The full version, including alpha/beta/rc tags. 60 | release = '2022' 61 | 62 | # The language for content autogenerated by Sphinx. Refer to documentation 63 | # for a list of supported languages. 64 | # 65 | # This is also used if you do content translation via gettext catalogs. 66 | # Usually you set "language" from the command line for these cases. 67 | language = None 68 | 69 | # There are two options for replacing |today|: either, you set today to some 70 | # non-false value, then it is used: 71 | # 72 | # today = '' 73 | # 74 | # Else, today_fmt is used as the format for a strftime call. 75 | # 76 | # today_fmt = '%B %d, %Y' 77 | 78 | # List of patterns, relative to source directory, that match files and 79 | # directories to ignore when looking for source files. 80 | # These patterns also affect html_static_path and html_extra_path 81 | exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] 82 | 83 | # The reST default role (used for this markup: `text`) to use for all 84 | # documents. 85 | # 86 | # default_role = None 87 | 88 | # If true, '()' will be appended to :func: etc. cross-reference text. 89 | # 90 | # add_function_parentheses = True 91 | 92 | # If true, the current module name will be prepended to all description 93 | # unit titles (such as .. function::). 94 | # 95 | # add_module_names = True 96 | 97 | # If true, sectionauthor and moduleauthor directives will be shown in the 98 | # output. They are ignored by default. 99 | # 100 | # show_authors = False 101 | 102 | # The name of the Pygments (syntax highlighting) style to use. 103 | pygments_style = 'sphinx' 104 | 105 | # A list of ignored prefixes for module index sorting. 106 | # modindex_common_prefix = [] 107 | 108 | # If true, keep warnings as "system message" paragraphs in the built documents. 109 | # keep_warnings = False 110 | 111 | # If true, `todo` and `todoList` produce output, else they produce nothing. 112 | todo_include_todos = False 113 | 114 | 115 | # -- Options for HTML output ---------------------------------------------- 116 | 117 | # The theme to use for HTML and HTML Help pages. See the documentation for 118 | # a list of builtin themes. 119 | # 120 | html_theme = 'alabaster' 121 | 122 | # Theme options are theme-specific and customize the look and feel of a theme 123 | # further. For a list of options available for each theme, see the 124 | # documentation. 125 | # 126 | # html_theme_options = {} 127 | 128 | # Add any paths that contain custom themes here, relative to this directory. 129 | # html_theme_path = [] 130 | 131 | # The name for this set of Sphinx documents. 132 | # " v documentation" by default. 133 | # 134 | # html_title = u'test vtest' 135 | 136 | # A shorter title for the navigation bar. Default is the same as html_title. 137 | # 138 | # html_short_title = None 139 | 140 | # The name of an image file (relative to this directory) to place at the top 141 | # of the sidebar. 142 | # 143 | # html_logo = None 144 | 145 | # The name of an image file (relative to this directory) to use as a favicon of 146 | # the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 147 | # pixels large. 148 | # 149 | # html_favicon = None 150 | 151 | # Add any paths that contain custom static files (such as style sheets) here, 152 | # relative to this directory. They are copied after the builtin static files, 153 | # so a file named "default.css" will overwrite the builtin "default.css". 154 | html_static_path = ['_static'] 155 | 156 | # Add any extra paths that contain custom files (such as robots.txt or 157 | # .htaccess) here, relative to this directory. These files are copied 158 | # directly to the root of the documentation. 159 | # 160 | # html_extra_path = [] 161 | 162 | # If not None, a 'Last updated on:' timestamp is inserted at every page 163 | # bottom, using the given strftime format. 164 | # The empty string is equivalent to '%b %d, %Y'. 165 | # 166 | # html_last_updated_fmt = None 167 | 168 | # Custom sidebar templates, maps document names to template names. 169 | # 170 | # html_sidebars = {} 171 | 172 | # Additional templates that should be rendered to pages, maps page names to 173 | # template names. 174 | # 175 | # html_additional_pages = {} 176 | 177 | # If false, no module index is generated. 178 | # 179 | # html_domain_indices = True 180 | 181 | # If false, no index is generated. 182 | # 183 | # html_use_index = True 184 | 185 | # If true, the index is split into individual pages for each letter. 186 | # 187 | # html_split_index = False 188 | 189 | # If true, links to the reST sources are added to the pages. 190 | # 191 | # html_show_sourcelink = True 192 | 193 | # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. 194 | # 195 | # html_show_sphinx = True 196 | 197 | # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. 198 | # 199 | # html_show_copyright = True 200 | 201 | # If true, an OpenSearch description file will be output, and all pages will 202 | # contain a tag referring to it. The value of this option must be the 203 | # base URL from which the finished HTML is served. 204 | # 205 | # html_use_opensearch = '' 206 | 207 | # This is the file name suffix for HTML files (e.g. ".xhtml"). 208 | # html_file_suffix = None 209 | 210 | # Language to be used for generating the HTML full-text search index. 211 | # Sphinx supports the following languages: 212 | # 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' 213 | # 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr', 'zh' 214 | # 215 | # html_search_language = 'en' 216 | 217 | # A dictionary with options for the search language support, empty by default. 218 | # 'ja' uses this config value. 219 | # 'zh' user can custom change `jieba` dictionary path. 220 | # 221 | # html_search_options = {'type': 'default'} 222 | 223 | # The name of a javascript file (relative to the configuration directory) that 224 | # implements a search results scorer. If empty, the default will be used. 225 | # 226 | # html_search_scorer = 'scorer.js' 227 | 228 | # Output file base name for HTML help builder. 229 | htmlhelp_basename = 'testdoc' 230 | 231 | # -- Options for LaTeX output --------------------------------------------- 232 | 233 | latex_elements = { 234 | # The paper size ('letterpaper' or 'a4paper'). 235 | # 236 | # 'papersize': 'letterpaper', 237 | 238 | # The font size ('10pt', '11pt' or '12pt'). 239 | # 240 | # 'pointsize': '10pt', 241 | 242 | # Additional stuff for the LaTeX preamble. 243 | # 244 | # 'preamble': '', 245 | 246 | # Latex figure (float) alignment 247 | # 248 | # 'figure_align': 'htbp', 249 | } 250 | 251 | # Grouping the document tree into LaTeX files. List of tuples 252 | # (source start file, target name, title, 253 | # author, documentclass [howto, manual, or own class]). 254 | latex_documents = [ 255 | (root_doc, 'test.tex', u'test Documentation', 256 | u'test', 'manual'), 257 | ] 258 | 259 | # The name of an image file (relative to this directory) to place at the top of 260 | # the title page. 261 | # 262 | # latex_logo = None 263 | 264 | # If true, show page references after internal links. 265 | # 266 | # latex_show_pagerefs = False 267 | 268 | # If true, show URL addresses after external links. 269 | # 270 | # latex_show_urls = False 271 | 272 | # Documents to append as an appendix to all manuals. 273 | # 274 | # latex_appendices = [] 275 | 276 | # If false, no module index is generated. 277 | # 278 | # latex_domain_indices = True 279 | 280 | 281 | # -- Options for manual page output --------------------------------------- 282 | 283 | # One entry per manual page. List of tuples 284 | # (source start file, name, description, authors, manual section). 285 | man_pages = [ 286 | (root_doc, 'test', u'test Documentation', 287 | [author], 1) 288 | ] 289 | 290 | # If true, show URL addresses after external links. 291 | # 292 | # man_show_urls = False 293 | 294 | 295 | # -- Options for Texinfo output ------------------------------------------- 296 | 297 | # Grouping the document tree into Texinfo files. List of tuples 298 | # (source start file, target name, title, author, 299 | # dir menu entry, description, category) 300 | texinfo_documents = [ 301 | (root_doc, 'test', u'test Documentation', 302 | author, 'test', 'One line description of project.', 303 | 'Miscellaneous'), 304 | ] 305 | 306 | # Documents to append as an appendix to all manuals. 307 | # 308 | # texinfo_appendices = [] 309 | 310 | # If false, no module index is generated. 311 | # 312 | # texinfo_domain_indices = True 313 | 314 | # How to display URL addresses: 'footnote', 'no', or 'inline'. 315 | # 316 | # texinfo_show_urls = 'footnote' 317 | 318 | # If true, do not generate a @detailmenu in the "Top" node's menu. 319 | # 320 | # texinfo_no_detailmenu = False 321 | 322 | # If false, do not generate in manual @ref nodes. 323 | # 324 | # texinfo_cross_references = False 325 | 326 | # -- A random example ----------------------------------------------------- 327 | 328 | import sys, os 329 | sys.path.insert(0, os.path.abspath('.')) 330 | exclude_patterns = ['zzz'] 331 | 332 | numfig = True 333 | #language = 'ja' 334 | 335 | extensions.append('sphinx.ext.todo') 336 | extensions.append('sphinx.ext.autodoc') 337 | #extensions.append('sphinx.ext.autosummary') 338 | extensions.append('sphinx.ext.intersphinx') 339 | extensions.append('sphinx.ext.mathjax') 340 | extensions.append('sphinx.ext.viewcode') 341 | extensions.append('sphinx.ext.graphviz') 342 | 343 | 344 | autosummary_generate = True 345 | html_theme = 'default' 346 | #source_suffix = ['.rst', '.txt'] 347 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [2022] [Naveen Goutham] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------