diff --git a/docs/pyerrors/input/pandas.html b/docs/pyerrors/input/pandas.html index d7fa9de5..97f10a90 100644 --- a/docs/pyerrors/input/pandas.html +++ b/docs/pyerrors/input/pandas.html @@ -88,37 +88,37 @@
1import warnings 2import gzip 3import sqlite3 - 4import pandas as pd - 5from ..obs import Obs - 6from ..correlators import Corr - 7from .json import create_json_string, import_json_string - 8import numpy as np - 9 + 4from contextlib import closing + 5import pandas as pd + 6from ..obs import Obs + 7from ..correlators import Corr + 8from .json import create_json_string, import_json_string + 9import numpy as np 10 - 11def to_sql(df, table_name, db, if_exists='fail', gz=True, **kwargs): - 12 """Write DataFrame including Obs or Corr valued columns to sqlite database. - 13 - 14 Parameters - 15 ---------- - 16 df : pandas.DataFrame - 17 Dataframe to be written to the database. - 18 table_name : str - 19 Name of the table in the database. - 20 db : str - 21 Path to the sqlite database. - 22 if exists : str - 23 How to behave if table already exists. Options 'fail', 'replace', 'append'. - 24 gz : bool - 25 If True the json strings are gzipped. - 26 - 27 Returns - 28 ------- - 29 None - 30 """ - 31 se_df = _serialize_df(df, gz=gz) - 32 con = sqlite3.connect(db) - 33 se_df.to_sql(table_name, con, if_exists=if_exists, index=False, **kwargs) - 34 con.close() + 11 + 12def to_sql(df, table_name, db, if_exists='fail', gz=True, **kwargs): + 13 """Write DataFrame including Obs or Corr valued columns to sqlite database. + 14 + 15 Parameters + 16 ---------- + 17 df : pandas.DataFrame + 18 Dataframe to be written to the database. + 19 table_name : str + 20 Name of the table in the database. + 21 db : str + 22 Path to the sqlite database. + 23 if exists : str + 24 How to behave if table already exists. Options 'fail', 'replace', 'append'. + 25 gz : bool + 26 If True the json strings are gzipped. + 27 + 28 Returns + 29 ------- + 30 None + 31 """ + 32 se_df = _serialize_df(df, gz=gz) + 33 with closing(sqlite3.connect(db)) as con: + 34 se_df.to_sql(table_name, con=con, if_exists=if_exists, index=False, **kwargs) 35 36 37def read_sql(sql, db, auto_gamma=False, **kwargs): @@ -139,155 +139,154 @@ 52 data : pandas.DataFrame 53 Dataframe with the content of the sqlite database. 54 """ - 55 con = sqlite3.connect(db) - 56 extract_df = pd.read_sql(sql, con, **kwargs) - 57 con.close() - 58 return _deserialize_df(extract_df, auto_gamma=auto_gamma) + 55 with closing(sqlite3.connect(db)) as con: + 56 extract_df = pd.read_sql(sql, con=con, **kwargs) + 57 return _deserialize_df(extract_df, auto_gamma=auto_gamma) + 58 59 - 60 - 61def dump_df(df, fname, gz=True): - 62 """Exports a pandas DataFrame containing Obs valued columns to a (gzipped) csv file. - 63 - 64 Before making use of pandas to_csv functionality Obs objects are serialized via the standardized - 65 json format of pyerrors. - 66 - 67 Parameters - 68 ---------- - 69 df : pandas.DataFrame - 70 Dataframe to be dumped to a file. - 71 fname : str - 72 Filename of the output file. - 73 gz : bool - 74 If True, the output is a gzipped csv file. If False, the output is a csv file. - 75 - 76 Returns - 77 ------- - 78 None - 79 """ - 80 for column in df: - 81 serialize = _need_to_serialize(df[column]) - 82 if not serialize: - 83 if all(isinstance(entry, (int, np.integer, float, np.floating)) for entry in df[column]): - 84 if any([np.isnan(entry) for entry in df[column]]): - 85 warnings.warn("nan value in column " + column + " will be replaced by None", UserWarning) - 86 - 87 out = _serialize_df(df, gz=False) - 88 - 89 if not fname.endswith('.csv'): - 90 fname += '.csv' - 91 - 92 if gz is True: - 93 if not fname.endswith('.gz'): - 94 fname += '.gz' - 95 out.to_csv(fname, index=False, compression='gzip') - 96 else: - 97 out.to_csv(fname, index=False) + 60def dump_df(df, fname, gz=True): + 61 """Exports a pandas DataFrame containing Obs valued columns to a (gzipped) csv file. + 62 + 63 Before making use of pandas to_csv functionality Obs objects are serialized via the standardized + 64 json format of pyerrors. + 65 + 66 Parameters + 67 ---------- + 68 df : pandas.DataFrame + 69 Dataframe to be dumped to a file. + 70 fname : str + 71 Filename of the output file. + 72 gz : bool + 73 If True, the output is a gzipped csv file. If False, the output is a csv file. + 74 + 75 Returns + 76 ------- + 77 None + 78 """ + 79 for column in df: + 80 serialize = _need_to_serialize(df[column]) + 81 if not serialize: + 82 if all(isinstance(entry, (int, np.integer, float, np.floating)) for entry in df[column]): + 83 if any([np.isnan(entry) for entry in df[column]]): + 84 warnings.warn("nan value in column " + column + " will be replaced by None", UserWarning) + 85 + 86 out = _serialize_df(df, gz=False) + 87 + 88 if not fname.endswith('.csv'): + 89 fname += '.csv' + 90 + 91 if gz is True: + 92 if not fname.endswith('.gz'): + 93 fname += '.gz' + 94 out.to_csv(fname, index=False, compression='gzip') + 95 else: + 96 out.to_csv(fname, index=False) + 97 98 - 99 -100def load_df(fname, auto_gamma=False, gz=True): -101 """Imports a pandas DataFrame from a csv.(gz) file in which Obs objects are serialized as json strings. -102 -103 Parameters -104 ---------- -105 fname : str -106 Filename of the input file. -107 auto_gamma : bool -108 If True applies the gamma_method to all imported Obs objects with the default parameters for -109 the error analysis. Default False. -110 gz : bool -111 If True, assumes that data is gzipped. If False, assumes JSON file. -112 -113 Returns -114 ------- -115 data : pandas.DataFrame -116 Dataframe with the content of the sqlite database. -117 """ -118 if not fname.endswith('.csv') and not fname.endswith('.gz'): -119 fname += '.csv' -120 -121 if gz is True: -122 if not fname.endswith('.gz'): -123 fname += '.gz' -124 with gzip.open(fname) as f: -125 re_import = pd.read_csv(f, keep_default_na=False) -126 else: -127 if fname.endswith('.gz'): -128 warnings.warn("Trying to read from %s without unzipping!" % fname, UserWarning) -129 re_import = pd.read_csv(fname, keep_default_na=False) -130 -131 return _deserialize_df(re_import, auto_gamma=auto_gamma) + 99def load_df(fname, auto_gamma=False, gz=True): +100 """Imports a pandas DataFrame from a csv.(gz) file in which Obs objects are serialized as json strings. +101 +102 Parameters +103 ---------- +104 fname : str +105 Filename of the input file. +106 auto_gamma : bool +107 If True applies the gamma_method to all imported Obs objects with the default parameters for +108 the error analysis. Default False. +109 gz : bool +110 If True, assumes that data is gzipped. If False, assumes JSON file. +111 +112 Returns +113 ------- +114 data : pandas.DataFrame +115 Dataframe with the content of the sqlite database. +116 """ +117 if not fname.endswith('.csv') and not fname.endswith('.gz'): +118 fname += '.csv' +119 +120 if gz is True: +121 if not fname.endswith('.gz'): +122 fname += '.gz' +123 with gzip.open(fname) as f: +124 re_import = pd.read_csv(f, keep_default_na=False) +125 else: +126 if fname.endswith('.gz'): +127 warnings.warn("Trying to read from %s without unzipping!" % fname, UserWarning) +128 re_import = pd.read_csv(fname, keep_default_na=False) +129 +130 return _deserialize_df(re_import, auto_gamma=auto_gamma) +131 132 -133 -134def _serialize_df(df, gz=False): -135 """Serializes all Obs or Corr valued columns into json strings according to the pyerrors json specification. -136 -137 Parameters -138 ---------- -139 df : pandas.DataFrame -140 DataFrame to be serilized. -141 gz: bool -142 gzip the json string representation. Default False. -143 """ -144 out = df.copy() -145 for column in out: -146 serialize = _need_to_serialize(out[column]) -147 -148 if serialize is True: -149 out[column] = out[column].transform(lambda x: create_json_string(x, indent=0) if x is not None else None) -150 if gz is True: -151 out[column] = out[column].transform(lambda x: gzip.compress((x if x is not None else '').encode('utf-8'))) -152 return out +133def _serialize_df(df, gz=False): +134 """Serializes all Obs or Corr valued columns into json strings according to the pyerrors json specification. +135 +136 Parameters +137 ---------- +138 df : pandas.DataFrame +139 DataFrame to be serilized. +140 gz: bool +141 gzip the json string representation. Default False. +142 """ +143 out = df.copy() +144 for column in out: +145 serialize = _need_to_serialize(out[column]) +146 +147 if serialize is True: +148 out[column] = out[column].transform(lambda x: create_json_string(x, indent=0) if x is not None else None) +149 if gz is True: +150 out[column] = out[column].transform(lambda x: gzip.compress((x if x is not None else '').encode('utf-8'))) +151 return out +152 153 -154 -155def _deserialize_df(df, auto_gamma=False): -156 """Deserializes all pyerrors json strings into Obs or Corr objects according to the pyerrors json specification. -157 -158 Parameters -159 ---------- -160 df : pandas.DataFrame -161 DataFrame to be deserilized. -162 auto_gamma : bool -163 If True applies the gamma_method to all imported Obs objects with the default parameters for -164 the error analysis. Default False. -165 -166 Notes: -167 ------ -168 In case any column of the DataFrame is gzipped it is gunzipped in the process. -169 """ -170 for column in df.select_dtypes(include="object"): -171 if isinstance(df[column][0], bytes): -172 if df[column][0].startswith(b"\x1f\x8b\x08\x00"): -173 df[column] = df[column].transform(lambda x: gzip.decompress(x).decode('utf-8')) -174 -175 if not all([e is None for e in df[column]]): -176 df[column] = df[column].replace({r'^$': None}, regex=True) -177 i = 0 -178 while df[column][i] is None: -179 i += 1 -180 if isinstance(df[column][i], str): -181 if '"program":' in df[column][i][:20]: -182 df[column] = df[column].transform(lambda x: import_json_string(x, verbose=False) if x is not None else None) -183 if auto_gamma is True: -184 if isinstance(df[column][i], list): -185 df[column].apply(lambda x: [o.gm() if o is not None else x for o in x]) -186 else: -187 df[column].apply(lambda x: x.gm() if x is not None else x) -188 return df +154def _deserialize_df(df, auto_gamma=False): +155 """Deserializes all pyerrors json strings into Obs or Corr objects according to the pyerrors json specification. +156 +157 Parameters +158 ---------- +159 df : pandas.DataFrame +160 DataFrame to be deserilized. +161 auto_gamma : bool +162 If True applies the gamma_method to all imported Obs objects with the default parameters for +163 the error analysis. Default False. +164 +165 Notes: +166 ------ +167 In case any column of the DataFrame is gzipped it is gunzipped in the process. +168 """ +169 for column in df.select_dtypes(include="object"): +170 if isinstance(df[column][0], bytes): +171 if df[column][0].startswith(b"\x1f\x8b\x08\x00"): +172 df[column] = df[column].transform(lambda x: gzip.decompress(x).decode('utf-8')) +173 +174 if not all([e is None for e in df[column]]): +175 df[column] = df[column].replace({r'^$': None}, regex=True) +176 i = 0 +177 while df[column][i] is None: +178 i += 1 +179 if isinstance(df[column][i], str): +180 if '"program":' in df[column][i][:20]: +181 df[column] = df[column].transform(lambda x: import_json_string(x, verbose=False) if x is not None else None) +182 if auto_gamma is True: +183 if isinstance(df[column][i], list): +184 df[column].apply(lambda x: [o.gm() if o is not None else x for o in x]) +185 else: +186 df[column].apply(lambda x: x.gm() if x is not None else x) +187 return df +188 189 -190 -191def _need_to_serialize(col): -192 serialize = False -193 i = 0 -194 while i < len(col) and col[i] is None: -195 i += 1 -196 if i == len(col): -197 return serialize -198 if isinstance(col[i], (Obs, Corr)): -199 serialize = True -200 elif isinstance(col[i], list): -201 if all(isinstance(o, Obs) for o in col[i]): -202 serialize = True -203 return serialize +190def _need_to_serialize(col): +191 serialize = False +192 i = 0 +193 while i < len(col) and col[i] is None: +194 i += 1 +195 if i == len(col): +196 return serialize +197 if isinstance(col[i], (Obs, Corr)): +198 serialize = True +199 elif isinstance(col[i], list): +200 if all(isinstance(o, Obs) for o in col[i]): +201 serialize = True +202 return serialize
12def to_sql(df, table_name, db, if_exists='fail', gz=True, **kwargs): -13 """Write DataFrame including Obs or Corr valued columns to sqlite database. -14 -15 Parameters -16 ---------- -17 df : pandas.DataFrame -18 Dataframe to be written to the database. -19 table_name : str -20 Name of the table in the database. -21 db : str -22 Path to the sqlite database. -23 if exists : str -24 How to behave if table already exists. Options 'fail', 'replace', 'append'. -25 gz : bool -26 If True the json strings are gzipped. -27 -28 Returns -29 ------- -30 None -31 """ -32 se_df = _serialize_df(df, gz=gz) -33 con = sqlite3.connect(db) -34 se_df.to_sql(table_name, con, if_exists=if_exists, index=False, **kwargs) -35 con.close() +@@ -385,10 +383,9 @@ If True the json strings are gzipped. 53 data : pandas.DataFrame 54 Dataframe with the content of the sqlite database. 55 """ -56 con = sqlite3.connect(db) -57 extract_df = pd.read_sql(sql, con, **kwargs) -58 con.close() -59 return _deserialize_df(extract_df, auto_gamma=auto_gamma) +56 with closing(sqlite3.connect(db)) as con: +57 extract_df = pd.read_sql(sql, con=con, **kwargs) +58 return _deserialize_df(extract_df, auto_gamma=auto_gamma)13def to_sql(df, table_name, db, if_exists='fail', gz=True, **kwargs): +14 """Write DataFrame including Obs or Corr valued columns to sqlite database. +15 +16 Parameters +17 ---------- +18 df : pandas.DataFrame +19 Dataframe to be written to the database. +20 table_name : str +21 Name of the table in the database. +22 db : str +23 Path to the sqlite database. +24 if exists : str +25 How to behave if table already exists. Options 'fail', 'replace', 'append'. +26 gz : bool +27 If True the json strings are gzipped. +28 +29 Returns +30 ------- +31 None +32 """ +33 se_df = _serialize_df(df, gz=gz) +34 with closing(sqlite3.connect(db)) as con: +35 se_df.to_sql(table_name, con=con, if_exists=if_exists, index=False, **kwargs)
62def dump_df(df, fname, gz=True): -63 """Exports a pandas DataFrame containing Obs valued columns to a (gzipped) csv file. -64 -65 Before making use of pandas to_csv functionality Obs objects are serialized via the standardized -66 json format of pyerrors. -67 -68 Parameters -69 ---------- -70 df : pandas.DataFrame -71 Dataframe to be dumped to a file. -72 fname : str -73 Filename of the output file. -74 gz : bool -75 If True, the output is a gzipped csv file. If False, the output is a csv file. -76 -77 Returns -78 ------- -79 None -80 """ -81 for column in df: -82 serialize = _need_to_serialize(df[column]) -83 if not serialize: -84 if all(isinstance(entry, (int, np.integer, float, np.floating)) for entry in df[column]): -85 if any([np.isnan(entry) for entry in df[column]]): -86 warnings.warn("nan value in column " + column + " will be replaced by None", UserWarning) -87 -88 out = _serialize_df(df, gz=False) -89 -90 if not fname.endswith('.csv'): -91 fname += '.csv' -92 -93 if gz is True: -94 if not fname.endswith('.gz'): -95 fname += '.gz' -96 out.to_csv(fname, index=False, compression='gzip') -97 else: -98 out.to_csv(fname, index=False) +@@ -503,38 +500,38 @@ If True, the output is a gzipped csv file. If False, the output is a csv file.61def dump_df(df, fname, gz=True): +62 """Exports a pandas DataFrame containing Obs valued columns to a (gzipped) csv file. +63 +64 Before making use of pandas to_csv functionality Obs objects are serialized via the standardized +65 json format of pyerrors. +66 +67 Parameters +68 ---------- +69 df : pandas.DataFrame +70 Dataframe to be dumped to a file. +71 fname : str +72 Filename of the output file. +73 gz : bool +74 If True, the output is a gzipped csv file. If False, the output is a csv file. +75 +76 Returns +77 ------- +78 None +79 """ +80 for column in df: +81 serialize = _need_to_serialize(df[column]) +82 if not serialize: +83 if all(isinstance(entry, (int, np.integer, float, np.floating)) for entry in df[column]): +84 if any([np.isnan(entry) for entry in df[column]]): +85 warnings.warn("nan value in column " + column + " will be replaced by None", UserWarning) +86 +87 out = _serialize_df(df, gz=False) +88 +89 if not fname.endswith('.csv'): +90 fname += '.csv' +91 +92 if gz is True: +93 if not fname.endswith('.gz'): +94 fname += '.gz' +95 out.to_csv(fname, index=False, compression='gzip') +96 else: +97 out.to_csv(fname, index=False)
101def load_df(fname, auto_gamma=False, gz=True): -102 """Imports a pandas DataFrame from a csv.(gz) file in which Obs objects are serialized as json strings. -103 -104 Parameters -105 ---------- -106 fname : str -107 Filename of the input file. -108 auto_gamma : bool -109 If True applies the gamma_method to all imported Obs objects with the default parameters for -110 the error analysis. Default False. -111 gz : bool -112 If True, assumes that data is gzipped. If False, assumes JSON file. -113 -114 Returns -115 ------- -116 data : pandas.DataFrame -117 Dataframe with the content of the sqlite database. -118 """ -119 if not fname.endswith('.csv') and not fname.endswith('.gz'): -120 fname += '.csv' -121 -122 if gz is True: -123 if not fname.endswith('.gz'): -124 fname += '.gz' -125 with gzip.open(fname) as f: -126 re_import = pd.read_csv(f, keep_default_na=False) -127 else: -128 if fname.endswith('.gz'): -129 warnings.warn("Trying to read from %s without unzipping!" % fname, UserWarning) -130 re_import = pd.read_csv(fname, keep_default_na=False) -131 -132 return _deserialize_df(re_import, auto_gamma=auto_gamma) +diff --git a/docs/pyerrors/special.html b/docs/pyerrors/special.html index 249553f7..a1ac4b9a 100644 --- a/docs/pyerrors/special.html +++ b/docs/pyerrors/special.html @@ -205,20 +205,20 @@100def load_df(fname, auto_gamma=False, gz=True): +101 """Imports a pandas DataFrame from a csv.(gz) file in which Obs objects are serialized as json strings. +102 +103 Parameters +104 ---------- +105 fname : str +106 Filename of the input file. +107 auto_gamma : bool +108 If True applies the gamma_method to all imported Obs objects with the default parameters for +109 the error analysis. Default False. +110 gz : bool +111 If True, assumes that data is gzipped. If False, assumes JSON file. +112 +113 Returns +114 ------- +115 data : pandas.DataFrame +116 Dataframe with the content of the sqlite database. +117 """ +118 if not fname.endswith('.csv') and not fname.endswith('.gz'): +119 fname += '.csv' +120 +121 if gz is True: +122 if not fname.endswith('.gz'): +123 fname += '.gz' +124 with gzip.open(fname) as f: +125 re_import = pd.read_csv(f, keep_default_na=False) +126 else: +127 if fname.endswith('.gz'): +128 warnings.warn("Trying to read from %s without unzipping!" % fname, UserWarning) +129 re_import = pd.read_csv(fname, keep_default_na=False) +130 +131 return _deserialize_df(re_import, auto_gamma=auto_gamma)
36 @wraps(f_raw) -37 def f_wrapped(*args, **kwargs): -38 boxed_args, trace, node_constructor = find_top_boxed_args(args) -39 if boxed_args: -40 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) -41 if f_wrapped in notrace_primitives[node_constructor]: -42 return f_wrapped(*argvals, **kwargs) -43 parents = tuple(box._node for _ , box in boxed_args) -44 argnums = tuple(argnum for argnum, _ in boxed_args) -45 ans = f_wrapped(*argvals, **kwargs) -46 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) -47 return new_box(ans, trace, node) -48 else: -49 return f_raw(*args, **kwargs) +@@ -321,20 +321,20 @@ Eq. 5.12.1. https://dlmf.nist.gov/5.12&42 @wraps(f_raw) +43 def f_wrapped(*args, **kwargs): +44 boxed_args, trace, node_constructor = find_top_boxed_args(args) +45 if boxed_args: +46 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) +47 if f_wrapped in notrace_primitives[node_constructor]: +48 return f_wrapped(*argvals, **kwargs) +49 parents = tuple(box._node for _, box in boxed_args) +50 argnums = tuple(argnum for argnum, _ in boxed_args) +51 ans = f_wrapped(*argvals, **kwargs) +52 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) +53 return new_box(ans, trace, node) +54 else: +55 return f_raw(*args, **kwargs)
36 @wraps(f_raw) -37 def f_wrapped(*args, **kwargs): -38 boxed_args, trace, node_constructor = find_top_boxed_args(args) -39 if boxed_args: -40 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) -41 if f_wrapped in notrace_primitives[node_constructor]: -42 return f_wrapped(*argvals, **kwargs) -43 parents = tuple(box._node for _ , box in boxed_args) -44 argnums = tuple(argnum for argnum, _ in boxed_args) -45 ans = f_wrapped(*argvals, **kwargs) -46 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) -47 return new_box(ans, trace, node) -48 else: -49 return f_raw(*args, **kwargs) +@@ -468,20 +468,20 @@ where \( F \) is the hypergeometric function42 @wraps(f_raw) +43 def f_wrapped(*args, **kwargs): +44 boxed_args, trace, node_constructor = find_top_boxed_args(args) +45 if boxed_args: +46 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) +47 if f_wrapped in notrace_primitives[node_constructor]: +48 return f_wrapped(*argvals, **kwargs) +49 parents = tuple(box._node for _, box in boxed_args) +50 argnums = tuple(argnum for argnum, _ in boxed_args) +51 ans = f_wrapped(*argvals, **kwargs) +52 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) +53 return new_box(ans, trace, node) +54 else: +55 return f_raw(*args, **kwargs)hyp2f1
:
36 @wraps(f_raw) -37 def f_wrapped(*args, **kwargs): -38 boxed_args, trace, node_constructor = find_top_boxed_args(args) -39 if boxed_args: -40 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) -41 if f_wrapped in notrace_primitives[node_constructor]: -42 return f_wrapped(*argvals, **kwargs) -43 parents = tuple(box._node for _ , box in boxed_args) -44 argnums = tuple(argnum for argnum, _ in boxed_args) -45 ans = f_wrapped(*argvals, **kwargs) -46 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) -47 return new_box(ans, trace, node) -48 else: -49 return f_raw(*args, **kwargs) +@@ -571,20 +571,20 @@ the logarithm of the actual value.42 @wraps(f_raw) +43 def f_wrapped(*args, **kwargs): +44 boxed_args, trace, node_constructor = find_top_boxed_args(args) +45 if boxed_args: +46 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) +47 if f_wrapped in notrace_primitives[node_constructor]: +48 return f_wrapped(*argvals, **kwargs) +49 parents = tuple(box._node for _, box in boxed_args) +50 argnums = tuple(argnum for argnum, _ in boxed_args) +51 ans = f_wrapped(*argvals, **kwargs) +52 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) +53 return new_box(ans, trace, node) +54 else: +55 return f_raw(*args, **kwargs)
36 @wraps(f_raw) -37 def f_wrapped(*args, **kwargs): -38 boxed_args, trace, node_constructor = find_top_boxed_args(args) -39 if boxed_args: -40 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) -41 if f_wrapped in notrace_primitives[node_constructor]: -42 return f_wrapped(*argvals, **kwargs) -43 parents = tuple(box._node for _ , box in boxed_args) -44 argnums = tuple(argnum for argnum, _ in boxed_args) -45 ans = f_wrapped(*argvals, **kwargs) -46 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) -47 return new_box(ans, trace, node) -48 else: -49 return f_raw(*args, **kwargs) +@@ -645,20 +645,20 @@ Real valued input42 @wraps(f_raw) +43 def f_wrapped(*args, **kwargs): +44 boxed_args, trace, node_constructor = find_top_boxed_args(args) +45 if boxed_args: +46 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) +47 if f_wrapped in notrace_primitives[node_constructor]: +48 return f_wrapped(*argvals, **kwargs) +49 parents = tuple(box._node for _, box in boxed_args) +50 argnums = tuple(argnum for argnum, _ in boxed_args) +51 ans = f_wrapped(*argvals, **kwargs) +52 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) +53 return new_box(ans, trace, node) +54 else: +55 return f_raw(*args, **kwargs)
36 @wraps(f_raw) -37 def f_wrapped(*args, **kwargs): -38 boxed_args, trace, node_constructor = find_top_boxed_args(args) -39 if boxed_args: -40 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) -41 if f_wrapped in notrace_primitives[node_constructor]: -42 return f_wrapped(*argvals, **kwargs) -43 parents = tuple(box._node for _ , box in boxed_args) -44 argnums = tuple(argnum for argnum, _ in boxed_args) -45 ans = f_wrapped(*argvals, **kwargs) -46 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) -47 return new_box(ans, trace, node) -48 else: -49 return f_raw(*args, **kwargs) +@@ -763,20 +763,20 @@ function should maintain full accuracy around the origin.42 @wraps(f_raw) +43 def f_wrapped(*args, **kwargs): +44 boxed_args, trace, node_constructor = find_top_boxed_args(args) +45 if boxed_args: +46 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) +47 if f_wrapped in notrace_primitives[node_constructor]: +48 return f_wrapped(*argvals, **kwargs) +49 parents = tuple(box._node for _, box in boxed_args) +50 argnums = tuple(argnum for argnum, _ in boxed_args) +51 ans = f_wrapped(*argvals, **kwargs) +52 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) +53 return new_box(ans, trace, node) +54 else: +55 return f_raw(*args, **kwargs)
36 @wraps(f_raw) -37 def f_wrapped(*args, **kwargs): -38 boxed_args, trace, node_constructor = find_top_boxed_args(args) -39 if boxed_args: -40 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) -41 if f_wrapped in notrace_primitives[node_constructor]: -42 return f_wrapped(*argvals, **kwargs) -43 parents = tuple(box._node for _ , box in boxed_args) -44 argnums = tuple(argnum for argnum, _ in boxed_args) -45 ans = f_wrapped(*argvals, **kwargs) -46 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) -47 return new_box(ans, trace, node) -48 else: -49 return f_raw(*args, **kwargs) +@@ -881,20 +881,20 @@ function should maintain full accuracy around the origin.42 @wraps(f_raw) +43 def f_wrapped(*args, **kwargs): +44 boxed_args, trace, node_constructor = find_top_boxed_args(args) +45 if boxed_args: +46 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) +47 if f_wrapped in notrace_primitives[node_constructor]: +48 return f_wrapped(*argvals, **kwargs) +49 parents = tuple(box._node for _, box in boxed_args) +50 argnums = tuple(argnum for argnum, _ in boxed_args) +51 ans = f_wrapped(*argvals, **kwargs) +52 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) +53 return new_box(ans, trace, node) +54 else: +55 return f_raw(*args, **kwargs)
36 @wraps(f_raw) -37 def f_wrapped(*args, **kwargs): -38 boxed_args, trace, node_constructor = find_top_boxed_args(args) -39 if boxed_args: -40 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) -41 if f_wrapped in notrace_primitives[node_constructor]: -42 return f_wrapped(*argvals, **kwargs) -43 parents = tuple(box._node for _ , box in boxed_args) -44 argnums = tuple(argnum for argnum, _ in boxed_args) -45 ans = f_wrapped(*argvals, **kwargs) -46 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) -47 return new_box(ans, trace, node) -48 else: -49 return f_raw(*args, **kwargs) +@@ -1033,20 +1033,20 @@ as42 @wraps(f_raw) +43 def f_wrapped(*args, **kwargs): +44 boxed_args, trace, node_constructor = find_top_boxed_args(args) +45 if boxed_args: +46 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) +47 if f_wrapped in notrace_primitives[node_constructor]: +48 return f_wrapped(*argvals, **kwargs) +49 parents = tuple(box._node for _, box in boxed_args) +50 argnums = tuple(argnum for argnum, _ in boxed_args) +51 ans = f_wrapped(*argvals, **kwargs) +52 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) +53 return new_box(ans, trace, node) +54 else: +55 return f_raw(*args, **kwargs)
36 @wraps(f_raw) -37 def f_wrapped(*args, **kwargs): -38 boxed_args, trace, node_constructor = find_top_boxed_args(args) -39 if boxed_args: -40 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) -41 if f_wrapped in notrace_primitives[node_constructor]: -42 return f_wrapped(*argvals, **kwargs) -43 parents = tuple(box._node for _ , box in boxed_args) -44 argnums = tuple(argnum for argnum, _ in boxed_args) -45 ans = f_wrapped(*argvals, **kwargs) -46 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) -47 return new_box(ans, trace, node) -48 else: -49 return f_raw(*args, **kwargs) +@@ -1150,20 +1150,20 @@ gammasgn(x) * gamma(x).42 @wraps(f_raw) +43 def f_wrapped(*args, **kwargs): +44 boxed_args, trace, node_constructor = find_top_boxed_args(args) +45 if boxed_args: +46 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) +47 if f_wrapped in notrace_primitives[node_constructor]: +48 return f_wrapped(*argvals, **kwargs) +49 parents = tuple(box._node for _, box in boxed_args) +50 argnums = tuple(argnum for argnum, _ in boxed_args) +51 ans = f_wrapped(*argvals, **kwargs) +52 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) +53 return new_box(ans, trace, node) +54 else: +55 return f_raw(*args, **kwargs)
36 @wraps(f_raw) -37 def f_wrapped(*args, **kwargs): -38 boxed_args, trace, node_constructor = find_top_boxed_args(args) -39 if boxed_args: -40 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) -41 if f_wrapped in notrace_primitives[node_constructor]: -42 return f_wrapped(*argvals, **kwargs) -43 parents = tuple(box._node for _ , box in boxed_args) -44 argnums = tuple(argnum for argnum, _ in boxed_args) -45 ans = f_wrapped(*argvals, **kwargs) -46 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) -47 return new_box(ans, trace, node) -48 else: -49 return f_raw(*args, **kwargs) +@@ -1259,20 +1259,20 @@ monotonically increases to 1.42 @wraps(f_raw) +43 def f_wrapped(*args, **kwargs): +44 boxed_args, trace, node_constructor = find_top_boxed_args(args) +45 if boxed_args: +46 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) +47 if f_wrapped in notrace_primitives[node_constructor]: +48 return f_wrapped(*argvals, **kwargs) +49 parents = tuple(box._node for _, box in boxed_args) +50 argnums = tuple(argnum for argnum, _ in boxed_args) +51 ans = f_wrapped(*argvals, **kwargs) +52 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) +53 return new_box(ans, trace, node) +54 else: +55 return f_raw(*args, **kwargs)
36 @wraps(f_raw) -37 def f_wrapped(*args, **kwargs): -38 boxed_args, trace, node_constructor = find_top_boxed_args(args) -39 if boxed_args: -40 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) -41 if f_wrapped in notrace_primitives[node_constructor]: -42 return f_wrapped(*argvals, **kwargs) -43 parents = tuple(box._node for _ , box in boxed_args) -44 argnums = tuple(argnum for argnum, _ in boxed_args) -45 ans = f_wrapped(*argvals, **kwargs) -46 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) -47 return new_box(ans, trace, node) -48 else: -49 return f_raw(*args, **kwargs) +@@ -1369,20 +1369,20 @@ starts at 1 and monotonically decreases to 0.42 @wraps(f_raw) +43 def f_wrapped(*args, **kwargs): +44 boxed_args, trace, node_constructor = find_top_boxed_args(args) +45 if boxed_args: +46 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) +47 if f_wrapped in notrace_primitives[node_constructor]: +48 return f_wrapped(*argvals, **kwargs) +49 parents = tuple(box._node for _, box in boxed_args) +50 argnums = tuple(argnum for argnum, _ in boxed_args) +51 ans = f_wrapped(*argvals, **kwargs) +52 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) +53 return new_box(ans, trace, node) +54 else: +55 return f_raw(*args, **kwargs)
36 @wraps(f_raw) -37 def f_wrapped(*args, **kwargs): -38 boxed_args, trace, node_constructor = find_top_boxed_args(args) -39 if boxed_args: -40 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) -41 if f_wrapped in notrace_primitives[node_constructor]: -42 return f_wrapped(*argvals, **kwargs) -43 parents = tuple(box._node for _ , box in boxed_args) -44 argnums = tuple(argnum for argnum, _ in boxed_args) -45 ans = f_wrapped(*argvals, **kwargs) -46 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) -47 return new_box(ans, trace, node) -48 else: -49 return f_raw(*args, **kwargs) +@@ -1485,20 +1485,20 @@ np.exp(gammaln(x)).42 @wraps(f_raw) +43 def f_wrapped(*args, **kwargs): +44 boxed_args, trace, node_constructor = find_top_boxed_args(args) +45 if boxed_args: +46 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) +47 if f_wrapped in notrace_primitives[node_constructor]: +48 return f_wrapped(*argvals, **kwargs) +49 parents = tuple(box._node for _, box in boxed_args) +50 argnums = tuple(argnum for argnum, _ in boxed_args) +51 ans = f_wrapped(*argvals, **kwargs) +52 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) +53 return new_box(ans, trace, node) +54 else: +55 return f_raw(*args, **kwargs)
36 @wraps(f_raw) -37 def f_wrapped(*args, **kwargs): -38 boxed_args, trace, node_constructor = find_top_boxed_args(args) -39 if boxed_args: -40 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) -41 if f_wrapped in notrace_primitives[node_constructor]: -42 return f_wrapped(*argvals, **kwargs) -43 parents = tuple(box._node for _ , box in boxed_args) -44 argnums = tuple(argnum for argnum, _ in boxed_args) -45 ans = f_wrapped(*argvals, **kwargs) -46 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) -47 return new_box(ans, trace, node) -48 else: -49 return f_raw(*args, **kwargs) +@@ -1590,20 +1590,20 @@ more details.42 @wraps(f_raw) +43 def f_wrapped(*args, **kwargs): +44 boxed_args, trace, node_constructor = find_top_boxed_args(args) +45 if boxed_args: +46 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) +47 if f_wrapped in notrace_primitives[node_constructor]: +48 return f_wrapped(*argvals, **kwargs) +49 parents = tuple(box._node for _, box in boxed_args) +50 argnums = tuple(argnum for argnum, _ in boxed_args) +51 ans = f_wrapped(*argvals, **kwargs) +52 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) +53 return new_box(ans, trace, node) +54 else: +55 return f_raw(*args, **kwargs)
36 @wraps(f_raw) -37 def f_wrapped(*args, **kwargs): -38 boxed_args, trace, node_constructor = find_top_boxed_args(args) -39 if boxed_args: -40 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) -41 if f_wrapped in notrace_primitives[node_constructor]: -42 return f_wrapped(*argvals, **kwargs) -43 parents = tuple(box._node for _ , box in boxed_args) -44 argnums = tuple(argnum for argnum, _ in boxed_args) -45 ans = f_wrapped(*argvals, **kwargs) -46 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) -47 return new_box(ans, trace, node) -48 else: -49 return f_raw(*args, **kwargs) +@@ -1683,20 +1683,20 @@ shown above:42 @wraps(f_raw) +43 def f_wrapped(*args, **kwargs): +44 boxed_args, trace, node_constructor = find_top_boxed_args(args) +45 if boxed_args: +46 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) +47 if f_wrapped in notrace_primitives[node_constructor]: +48 return f_wrapped(*argvals, **kwargs) +49 parents = tuple(box._node for _, box in boxed_args) +50 argnums = tuple(argnum for argnum, _ in boxed_args) +51 ans = f_wrapped(*argvals, **kwargs) +52 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) +53 return new_box(ans, trace, node) +54 else: +55 return f_raw(*args, **kwargs)
36 @wraps(f_raw) -37 def f_wrapped(*args, **kwargs): -38 boxed_args, trace, node_constructor = find_top_boxed_args(args) -39 if boxed_args: -40 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) -41 if f_wrapped in notrace_primitives[node_constructor]: -42 return f_wrapped(*argvals, **kwargs) -43 parents = tuple(box._node for _ , box in boxed_args) -44 argnums = tuple(argnum for argnum, _ in boxed_args) -45 ans = f_wrapped(*argvals, **kwargs) -46 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) -47 return new_box(ans, trace, node) -48 else: -49 return f_raw(*args, **kwargs) +@@ -1717,20 +1717,20 @@ shown above:42 @wraps(f_raw) +43 def f_wrapped(*args, **kwargs): +44 boxed_args, trace, node_constructor = find_top_boxed_args(args) +45 if boxed_args: +46 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) +47 if f_wrapped in notrace_primitives[node_constructor]: +48 return f_wrapped(*argvals, **kwargs) +49 parents = tuple(box._node for _, box in boxed_args) +50 argnums = tuple(argnum for argnum, _ in boxed_args) +51 ans = f_wrapped(*argvals, **kwargs) +52 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) +53 return new_box(ans, trace, node) +54 else: +55 return f_raw(*args, **kwargs)
36 @wraps(f_raw) -37 def f_wrapped(*args, **kwargs): -38 boxed_args, trace, node_constructor = find_top_boxed_args(args) -39 if boxed_args: -40 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) -41 if f_wrapped in notrace_primitives[node_constructor]: -42 return f_wrapped(*argvals, **kwargs) -43 parents = tuple(box._node for _ , box in boxed_args) -44 argnums = tuple(argnum for argnum, _ in boxed_args) -45 ans = f_wrapped(*argvals, **kwargs) -46 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) -47 return new_box(ans, trace, node) -48 else: -49 return f_raw(*args, **kwargs) +@@ -1838,20 +1838,20 @@ It should not be confused with the spherical Bessel functions (see42 @wraps(f_raw) +43 def f_wrapped(*args, **kwargs): +44 boxed_args, trace, node_constructor = find_top_boxed_args(args) +45 if boxed_args: +46 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) +47 if f_wrapped in notrace_primitives[node_constructor]: +48 return f_wrapped(*argvals, **kwargs) +49 parents = tuple(box._node for _, box in boxed_args) +50 argnums = tuple(argnum for argnum, _ in boxed_args) +51 ans = f_wrapped(*argvals, **kwargs) +52 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) +53 return new_box(ans, trace, node) +54 else: +55 return f_raw(*args, **kwargs)
36 @wraps(f_raw) -37 def f_wrapped(*args, **kwargs): -38 boxed_args, trace, node_constructor = find_top_boxed_args(args) -39 if boxed_args: -40 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) -41 if f_wrapped in notrace_primitives[node_constructor]: -42 return f_wrapped(*argvals, **kwargs) -43 parents = tuple(box._node for _ , box in boxed_args) -44 argnums = tuple(argnum for argnum, _ in boxed_args) -45 ans = f_wrapped(*argvals, **kwargs) -46 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) -47 return new_box(ans, trace, node) -48 else: -49 return f_raw(*args, **kwargs) +@@ -1956,20 +1956,20 @@ two rational functions of degree 6/6 and 7/7.42 @wraps(f_raw) +43 def f_wrapped(*args, **kwargs): +44 boxed_args, trace, node_constructor = find_top_boxed_args(args) +45 if boxed_args: +46 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) +47 if f_wrapped in notrace_primitives[node_constructor]: +48 return f_wrapped(*argvals, **kwargs) +49 parents = tuple(box._node for _, box in boxed_args) +50 argnums = tuple(argnum for argnum, _ in boxed_args) +51 ans = f_wrapped(*argvals, **kwargs) +52 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) +53 return new_box(ans, trace, node) +54 else: +55 return f_raw(*args, **kwargs)
36 @wraps(f_raw) -37 def f_wrapped(*args, **kwargs): -38 boxed_args, trace, node_constructor = find_top_boxed_args(args) -39 if boxed_args: -40 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) -41 if f_wrapped in notrace_primitives[node_constructor]: -42 return f_wrapped(*argvals, **kwargs) -43 parents = tuple(box._node for _ , box in boxed_args) -44 argnums = tuple(argnum for argnum, _ in boxed_args) -45 ans = f_wrapped(*argvals, **kwargs) -46 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) -47 return new_box(ans, trace, node) -48 else: -49 return f_raw(*args, **kwargs) +@@ -2070,20 +2070,20 @@ It should not be confused with the spherical Bessel functions (see42 @wraps(f_raw) +43 def f_wrapped(*args, **kwargs): +44 boxed_args, trace, node_constructor = find_top_boxed_args(args) +45 if boxed_args: +46 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) +47 if f_wrapped in notrace_primitives[node_constructor]: +48 return f_wrapped(*argvals, **kwargs) +49 parents = tuple(box._node for _, box in boxed_args) +50 argnums = tuple(argnum for argnum, _ in boxed_args) +51 ans = f_wrapped(*argvals, **kwargs) +52 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) +53 return new_box(ans, trace, node) +54 else: +55 return f_raw(*args, **kwargs)
36 @wraps(f_raw) -37 def f_wrapped(*args, **kwargs): -38 boxed_args, trace, node_constructor = find_top_boxed_args(args) -39 if boxed_args: -40 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) -41 if f_wrapped in notrace_primitives[node_constructor]: -42 return f_wrapped(*argvals, **kwargs) -43 parents = tuple(box._node for _ , box in boxed_args) -44 argnums = tuple(argnum for argnum, _ in boxed_args) -45 ans = f_wrapped(*argvals, **kwargs) -46 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) -47 return new_box(ans, trace, node) -48 else: -49 return f_raw(*args, **kwargs) +@@ -2184,20 +2184,20 @@ rational functions of degree 5/5.42 @wraps(f_raw) +43 def f_wrapped(*args, **kwargs): +44 boxed_args, trace, node_constructor = find_top_boxed_args(args) +45 if boxed_args: +46 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) +47 if f_wrapped in notrace_primitives[node_constructor]: +48 return f_wrapped(*argvals, **kwargs) +49 parents = tuple(box._node for _, box in boxed_args) +50 argnums = tuple(argnum for argnum, _ in boxed_args) +51 ans = f_wrapped(*argvals, **kwargs) +52 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) +53 return new_box(ans, trace, node) +54 else: +55 return f_raw(*args, **kwargs)
36 @wraps(f_raw) -37 def f_wrapped(*args, **kwargs): -38 boxed_args, trace, node_constructor = find_top_boxed_args(args) -39 if boxed_args: -40 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) -41 if f_wrapped in notrace_primitives[node_constructor]: -42 return f_wrapped(*argvals, **kwargs) -43 parents = tuple(box._node for _ , box in boxed_args) -44 argnums = tuple(argnum for argnum, _ in boxed_args) -45 ans = f_wrapped(*argvals, **kwargs) -46 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) -47 return new_box(ans, trace, node) -48 else: -49 return f_raw(*args, **kwargs) +@@ -2351,20 +2351,20 @@ of a Complex Argument and Nonnegative Order",42 @wraps(f_raw) +43 def f_wrapped(*args, **kwargs): +44 boxed_args, trace, node_constructor = find_top_boxed_args(args) +45 if boxed_args: +46 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) +47 if f_wrapped in notrace_primitives[node_constructor]: +48 return f_wrapped(*argvals, **kwargs) +49 parents = tuple(box._node for _, box in boxed_args) +50 argnums = tuple(argnum for argnum, _ in boxed_args) +51 ans = f_wrapped(*argvals, **kwargs) +52 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) +53 return new_box(ans, trace, node) +54 else: +55 return f_raw(*args, **kwargs)
36 @wraps(f_raw) -37 def f_wrapped(*args, **kwargs): -38 boxed_args, trace, node_constructor = find_top_boxed_args(args) -39 if boxed_args: -40 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) -41 if f_wrapped in notrace_primitives[node_constructor]: -42 return f_wrapped(*argvals, **kwargs) -43 parents = tuple(box._node for _ , box in boxed_args) -44 argnums = tuple(argnum for argnum, _ in boxed_args) -45 ans = f_wrapped(*argvals, **kwargs) -46 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) -47 return new_box(ans, trace, node) -48 else: -49 return f_raw(*args, **kwargs) +@@ -2504,20 +2504,20 @@ To calculate the orders 0 and 1 for an 1D array:42 @wraps(f_raw) +43 def f_wrapped(*args, **kwargs): +44 boxed_args, trace, node_constructor = find_top_boxed_args(args) +45 if boxed_args: +46 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) +47 if f_wrapped in notrace_primitives[node_constructor]: +48 return f_wrapped(*argvals, **kwargs) +49 parents = tuple(box._node for _, box in boxed_args) +50 argnums = tuple(argnum for argnum, _ in boxed_args) +51 ans = f_wrapped(*argvals, **kwargs) +52 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) +53 return new_box(ans, trace, node) +54 else: +55 return f_raw(*args, **kwargs)
36 @wraps(f_raw) -37 def f_wrapped(*args, **kwargs): -38 boxed_args, trace, node_constructor = find_top_boxed_args(args) -39 if boxed_args: -40 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) -41 if f_wrapped in notrace_primitives[node_constructor]: -42 return f_wrapped(*argvals, **kwargs) -43 parents = tuple(box._node for _ , box in boxed_args) -44 argnums = tuple(argnum for argnum, _ in boxed_args) -45 ans = f_wrapped(*argvals, **kwargs) -46 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) -47 return new_box(ans, trace, node) -48 else: -49 return f_raw(*args, **kwargs) +@@ -2620,20 +2620,20 @@ Chebyshev polynomial expansions are employed in each interval.42 @wraps(f_raw) +43 def f_wrapped(*args, **kwargs): +44 boxed_args, trace, node_constructor = find_top_boxed_args(args) +45 if boxed_args: +46 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) +47 if f_wrapped in notrace_primitives[node_constructor]: +48 return f_wrapped(*argvals, **kwargs) +49 parents = tuple(box._node for _, box in boxed_args) +50 argnums = tuple(argnum for argnum, _ in boxed_args) +51 ans = f_wrapped(*argvals, **kwargs) +52 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) +53 return new_box(ans, trace, node) +54 else: +55 return f_raw(*args, **kwargs)
36 @wraps(f_raw) -37 def f_wrapped(*args, **kwargs): -38 boxed_args, trace, node_constructor = find_top_boxed_args(args) -39 if boxed_args: -40 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) -41 if f_wrapped in notrace_primitives[node_constructor]: -42 return f_wrapped(*argvals, **kwargs) -43 parents = tuple(box._node for _ , box in boxed_args) -44 argnums = tuple(argnum for argnum, _ in boxed_args) -45 ans = f_wrapped(*argvals, **kwargs) -46 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) -47 return new_box(ans, trace, node) -48 else: -49 return f_raw(*args, **kwargs) +@@ -2737,20 +2737,20 @@ Chebyshev polynomial expansions are employed in each interval.42 @wraps(f_raw) +43 def f_wrapped(*args, **kwargs): +44 boxed_args, trace, node_constructor = find_top_boxed_args(args) +45 if boxed_args: +46 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) +47 if f_wrapped in notrace_primitives[node_constructor]: +48 return f_wrapped(*argvals, **kwargs) +49 parents = tuple(box._node for _, box in boxed_args) +50 argnums = tuple(argnum for argnum, _ in boxed_args) +51 ans = f_wrapped(*argvals, **kwargs) +52 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) +53 return new_box(ans, trace, node) +54 else: +55 return f_raw(*args, **kwargs)
36 @wraps(f_raw) -37 def f_wrapped(*args, **kwargs): -38 boxed_args, trace, node_constructor = find_top_boxed_args(args) -39 if boxed_args: -40 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) -41 if f_wrapped in notrace_primitives[node_constructor]: -42 return f_wrapped(*argvals, **kwargs) -43 parents = tuple(box._node for _ , box in boxed_args) -44 argnums = tuple(argnum for argnum, _ in boxed_args) -45 ans = f_wrapped(*argvals, **kwargs) -46 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) -47 return new_box(ans, trace, node) -48 else: -49 return f_raw(*args, **kwargs) +@@ -2913,20 +2913,20 @@ of a Complex Argument and Nonnegative Order",42 @wraps(f_raw) +43 def f_wrapped(*args, **kwargs): +44 boxed_args, trace, node_constructor = find_top_boxed_args(args) +45 if boxed_args: +46 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) +47 if f_wrapped in notrace_primitives[node_constructor]: +48 return f_wrapped(*argvals, **kwargs) +49 parents = tuple(box._node for _, box in boxed_args) +50 argnums = tuple(argnum for argnum, _ in boxed_args) +51 ans = f_wrapped(*argvals, **kwargs) +52 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) +53 return new_box(ans, trace, node) +54 else: +55 return f_raw(*args, **kwargs)
36 @wraps(f_raw) -37 def f_wrapped(*args, **kwargs): -38 boxed_args, trace, node_constructor = find_top_boxed_args(args) -39 if boxed_args: -40 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) -41 if f_wrapped in notrace_primitives[node_constructor]: -42 return f_wrapped(*argvals, **kwargs) -43 parents = tuple(box._node for _ , box in boxed_args) -44 argnums = tuple(argnum for argnum, _ in boxed_args) -45 ans = f_wrapped(*argvals, **kwargs) -46 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) -47 return new_box(ans, trace, node) -48 else: -49 return f_raw(*args, **kwargs) +@@ -3080,20 +3080,20 @@ of a Complex Argument and Nonnegative Order",42 @wraps(f_raw) +43 def f_wrapped(*args, **kwargs): +44 boxed_args, trace, node_constructor = find_top_boxed_args(args) +45 if boxed_args: +46 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) +47 if f_wrapped in notrace_primitives[node_constructor]: +48 return f_wrapped(*argvals, **kwargs) +49 parents = tuple(box._node for _, box in boxed_args) +50 argnums = tuple(argnum for argnum, _ in boxed_args) +51 ans = f_wrapped(*argvals, **kwargs) +52 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) +53 return new_box(ans, trace, node) +54 else: +55 return f_raw(*args, **kwargs)
36 @wraps(f_raw) -37 def f_wrapped(*args, **kwargs): -38 boxed_args, trace, node_constructor = find_top_boxed_args(args) -39 if boxed_args: -40 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) -41 if f_wrapped in notrace_primitives[node_constructor]: -42 return f_wrapped(*argvals, **kwargs) -43 parents = tuple(box._node for _ , box in boxed_args) -44 argnums = tuple(argnum for argnum, _ in boxed_args) -45 ans = f_wrapped(*argvals, **kwargs) -46 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) -47 return new_box(ans, trace, node) -48 else: -49 return f_raw(*args, **kwargs) +@@ -3167,20 +3167,20 @@ The values of the error function at the given points42 @wraps(f_raw) +43 def f_wrapped(*args, **kwargs): +44 boxed_args, trace, node_constructor = find_top_boxed_args(args) +45 if boxed_args: +46 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) +47 if f_wrapped in notrace_primitives[node_constructor]: +48 return f_wrapped(*argvals, **kwargs) +49 parents = tuple(box._node for _, box in boxed_args) +50 argnums = tuple(argnum for argnum, _ in boxed_args) +51 ans = f_wrapped(*argvals, **kwargs) +52 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) +53 return new_box(ans, trace, node) +54 else: +55 return f_raw(*args, **kwargs)x
.
36 @wraps(f_raw) -37 def f_wrapped(*args, **kwargs): -38 boxed_args, trace, node_constructor = find_top_boxed_args(args) -39 if boxed_args: -40 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) -41 if f_wrapped in notrace_primitives[node_constructor]: -42 return f_wrapped(*argvals, **kwargs) -43 parents = tuple(box._node for _ , box in boxed_args) -44 argnums = tuple(argnum for argnum, _ in boxed_args) -45 ans = f_wrapped(*argvals, **kwargs) -46 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) -47 return new_box(ans, trace, node) -48 else: -49 return f_raw(*args, **kwargs) +@@ -3246,20 +3246,20 @@ Optional output array for the function results42 @wraps(f_raw) +43 def f_wrapped(*args, **kwargs): +44 boxed_args, trace, node_constructor = find_top_boxed_args(args) +45 if boxed_args: +46 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) +47 if f_wrapped in notrace_primitives[node_constructor]: +48 return f_wrapped(*argvals, **kwargs) +49 parents = tuple(box._node for _, box in boxed_args) +50 argnums = tuple(argnum for argnum, _ in boxed_args) +51 ans = f_wrapped(*argvals, **kwargs) +52 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) +53 return new_box(ans, trace, node) +54 else: +55 return f_raw(*args, **kwargs)
36 @wraps(f_raw) -37 def f_wrapped(*args, **kwargs): -38 boxed_args, trace, node_constructor = find_top_boxed_args(args) -39 if boxed_args: -40 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) -41 if f_wrapped in notrace_primitives[node_constructor]: -42 return f_wrapped(*argvals, **kwargs) -43 parents = tuple(box._node for _ , box in boxed_args) -44 argnums = tuple(argnum for argnum, _ in boxed_args) -45 ans = f_wrapped(*argvals, **kwargs) -46 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) -47 return new_box(ans, trace, node) -48 else: -49 return f_raw(*args, **kwargs) +@@ -3374,20 +3374,20 @@ Boost Math C++ library 1<42 @wraps(f_raw) +43 def f_wrapped(*args, **kwargs): +44 boxed_args, trace, node_constructor = find_top_boxed_args(args) +45 if boxed_args: +46 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) +47 if f_wrapped in notrace_primitives[node_constructor]: +48 return f_wrapped(*argvals, **kwargs) +49 parents = tuple(box._node for _, box in boxed_args) +50 argnums = tuple(argnum for argnum, _ in boxed_args) +51 ans = f_wrapped(*argvals, **kwargs) +52 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) +53 return new_box(ans, trace, node) +54 else: +55 return f_raw(*args, **kwargs)
36 @wraps(f_raw) -37 def f_wrapped(*args, **kwargs): -38 boxed_args, trace, node_constructor = find_top_boxed_args(args) -39 if boxed_args: -40 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) -41 if f_wrapped in notrace_primitives[node_constructor]: -42 return f_wrapped(*argvals, **kwargs) -43 parents = tuple(box._node for _ , box in boxed_args) -44 argnums = tuple(argnum for argnum, _ in boxed_args) -45 ans = f_wrapped(*argvals, **kwargs) -46 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) -47 return new_box(ans, trace, node) -48 else: -49 return f_raw(*args, **kwargs) +@@ -3480,20 +3480,20 @@ The inverse of erfc of y, element-wise42 @wraps(f_raw) +43 def f_wrapped(*args, **kwargs): +44 boxed_args, trace, node_constructor = find_top_boxed_args(args) +45 if boxed_args: +46 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) +47 if f_wrapped in notrace_primitives[node_constructor]: +48 return f_wrapped(*argvals, **kwargs) +49 parents = tuple(box._node for _, box in boxed_args) +50 argnums = tuple(argnum for argnum, _ in boxed_args) +51 ans = f_wrapped(*argvals, **kwargs) +52 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) +53 return new_box(ans, trace, node) +54 else: +55 return f_raw(*args, **kwargs)
36 @wraps(f_raw) -37 def f_wrapped(*args, **kwargs): -38 boxed_args, trace, node_constructor = find_top_boxed_args(args) -39 if boxed_args: -40 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) -41 if f_wrapped in notrace_primitives[node_constructor]: -42 return f_wrapped(*argvals, **kwargs) -43 parents = tuple(box._node for _ , box in boxed_args) -44 argnums = tuple(argnum for argnum, _ in boxed_args) -45 ans = f_wrapped(*argvals, **kwargs) -46 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) -47 return new_box(ans, trace, node) -48 else: -49 return f_raw(*args, **kwargs) +@@ -3587,20 +3587,20 @@ see ufuncs42 @wraps(f_raw) +43 def f_wrapped(*args, **kwargs): +44 boxed_args, trace, node_constructor = find_top_boxed_args(args) +45 if boxed_args: +46 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) +47 if f_wrapped in notrace_primitives[node_constructor]: +48 return f_wrapped(*argvals, **kwargs) +49 parents = tuple(box._node for _, box in boxed_args) +50 argnums = tuple(argnum for argnum, _ in boxed_args) +51 ans = f_wrapped(*argvals, **kwargs) +52 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) +53 return new_box(ans, trace, node) +54 else: +55 return f_raw(*args, **kwargs)
36 @wraps(f_raw) -37 def f_wrapped(*args, **kwargs): -38 boxed_args, trace, node_constructor = find_top_boxed_args(args) -39 if boxed_args: -40 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) -41 if f_wrapped in notrace_primitives[node_constructor]: -42 return f_wrapped(*argvals, **kwargs) -43 parents = tuple(box._node for _ , box in boxed_args) -44 argnums = tuple(argnum for argnum, _ in boxed_args) -45 ans = f_wrapped(*argvals, **kwargs) -46 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) -47 return new_box(ans, trace, node) -48 else: -49 return f_raw(*args, **kwargs) +@@ -3694,20 +3694,20 @@ see ufuncs42 @wraps(f_raw) +43 def f_wrapped(*args, **kwargs): +44 boxed_args, trace, node_constructor = find_top_boxed_args(args) +45 if boxed_args: +46 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) +47 if f_wrapped in notrace_primitives[node_constructor]: +48 return f_wrapped(*argvals, **kwargs) +49 parents = tuple(box._node for _, box in boxed_args) +50 argnums = tuple(argnum for argnum, _ in boxed_args) +51 ans = f_wrapped(*argvals, **kwargs) +52 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) +53 return new_box(ans, trace, node) +54 else: +55 return f_raw(*args, **kwargs)
36 @wraps(f_raw) -37 def f_wrapped(*args, **kwargs): -38 boxed_args, trace, node_constructor = find_top_boxed_args(args) -39 if boxed_args: -40 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) -41 if f_wrapped in notrace_primitives[node_constructor]: -42 return f_wrapped(*argvals, **kwargs) -43 parents = tuple(box._node for _ , box in boxed_args) -44 argnums = tuple(argnum for argnum, _ in boxed_args) -45 ans = f_wrapped(*argvals, **kwargs) -46 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) -47 return new_box(ans, trace, node) -48 else: -49 return f_raw(*args, **kwargs) +42 @wraps(f_raw) +43 def f_wrapped(*args, **kwargs): +44 boxed_args, trace, node_constructor = find_top_boxed_args(args) +45 if boxed_args: +46 argvals = subvals(args, [(argnum, box._value) for argnum, box in boxed_args]) +47 if f_wrapped in notrace_primitives[node_constructor]: +48 return f_wrapped(*argvals, **kwargs) +49 parents = tuple(box._node for _, box in boxed_args) +50 argnums = tuple(argnum for argnum, _ in boxed_args) +51 ans = f_wrapped(*argvals, **kwargs) +52 node = node_constructor(ans, f_wrapped, argvals, kwargs, argnums, parents) +53 return new_box(ans, trace, node) +54 else: +55 return f_raw(*args, **kwargs)