From ae53e678d885cf5483a775d8828c726aa33b5871 Mon Sep 17 00:00:00 2001 From: JarvisRAs Date: Tue, 21 Apr 2026 13:09:59 -0600 Subject: [PATCH 01/36] Implemented First Level Parallelization --- yroots/ChebyshevSubdivisionSolver.py | 65 ++++++++++++++++++++++++---- yroots/Combined_Solver.py | 4 +- 2 files changed, 59 insertions(+), 10 deletions(-) diff --git a/yroots/ChebyshevSubdivisionSolver.py b/yroots/ChebyshevSubdivisionSolver.py index 231be866..875876d6 100644 --- a/yroots/ChebyshevSubdivisionSolver.py +++ b/yroots/ChebyshevSubdivisionSolver.py @@ -9,6 +9,9 @@ import copy import warnings +# Edit number 1 +from multiprocessing import Pool + class SolverOptions(): """Settings for running interval checks, transformations, and subdivision in solvePolyRecursive. @@ -39,6 +42,11 @@ def __init__(self): self.maxZoomCount = 25 self.level = 0 + # Edit number 2 + # Parameters for parallelization + self.max_cpu = 1 + self.allowParallel = True + def copy(self): return copy.copy(self) #Return shallow copy, everything should be a basic type @@ -1174,6 +1182,25 @@ def isExteriorInterval(originalInterval, trackedInterval): """Determines if the current interval is exterior to its original interval.""" return np.any(trackedInterval.getIntervalForCombining() == originalInterval.getIntervalForCombining()) +# Edit number 3 +# Runs the top level of subdivision in parallel +# Turns off parallel for next level of subdivision +def _run_children(allMs, allErrors, allIntervals, solverOptions): + if not allIntervals: + return [] + + tasks = [] + childSolverOptions = solverOptions.copy() + childSolverOptions.allowParallel = False + + for newMs, newErrs, newInt in zip(allMs, allErrors, allIntervals): + tasks.append((newMs, newInt, newErrs, childSolverOptions)) + + nproc = max(1, min(len(allIntervals), solverOptions.max_cpu)) + + with Pool(processes=nproc) as pool: + return pool.starmap(solvePolyRecursive, tasks) + def solvePolyRecursive(Ms, trackedInterval, errors, solverOptions): """Recursively shrinks and subdivides the given interval to find the locations of all roots. @@ -1266,10 +1293,20 @@ def solvePolyRecursive(Ms, trackedInterval, errors, solverOptions): elif trackedInterval.finalStep: trackedInterval.canThrowOutFinalStep = True allMs, allErrors, allIntervals = getSubdivisionIntervals(Ms, errors, trackedInterval, solverOptions.exact, solverOptions.level) + + # Edit number 5 resultsAll = [] - for newMs, newErrs, newInt in zip(allMs, allErrors, allIntervals): - newInterior, newExterior = solvePolyRecursive(newMs, newInt, newErrs, solverOptions) - resultsAll += newInterior + newExterior + if solverOptions.allowParallel and solverOptions.max_cpu > 1: + child_results = _run_children(allMs, allErrors, allIntervals, solverOptions) + for newInterior, newExterior in child_results: + resultInterior += newInterior + resultExterior += newExterior + else: + for newMs, newErrs, newInt in zip(allMs, allErrors, allIntervals): + newInterior, newExterior = solvePolyRecursive(newMs, newInt, newErrs, solverOptions) + resultInterior += newInterior + resultExterior += newExterior + if len(resultsAll) == 0: #Can't throw out final step! This might not actually be a root though! trackedInterval.possibleExtraRoot = True @@ -1311,10 +1348,21 @@ def solvePolyRecursive(Ms, trackedInterval, errors, solverOptions): #Get the new intervals and polynomials allMs, allErrors, allIntervals = getSubdivisionIntervals(Ms, errors, trackedInterval, solverOptions.exact, solverOptions.level) #Run each interval - for newMs, newErrs, newInt in zip(allMs, allErrors, allIntervals): - newInterior, newExterior = solvePolyRecursive(newMs, newInt, newErrs, solverOptions) - resultInterior += newInterior - resultExterior += newExterior + + # Edit number 4 + if solverOptions.allowParallel and solverOptions.max_cpu > 1: + child_results = _run_children(allMs, allErrors, allIntervals, solverOptions) + for newInterior, newExterior in child_results: + resultInterior += newInterior + resultExterior += newExterior + else: + for newMs, newErrs, newInt in zip(allMs, allErrors, allIntervals): + newInterior, newExterior = solvePolyRecursive(newMs, newInt, newErrs, solverOptions) + resultInterior += newInterior + resultExterior += newExterior + + + #Rerun the touching intervals idx1 = 0 idx2 = 1 @@ -1384,7 +1432,7 @@ def solvePolyRecursive(Ms, trackedInterval, errors, solverOptions): resultInterior.append(tempInterval) return resultInterior, newResultExterior -def solveChebyshevSubdivision(Ms, errors, verbose = False, returnBoundingBoxes = False, exact = False, constant_check = True, low_dim_quadratic_check = True, all_dim_quadratic_check = False): +def solveChebyshevSubdivision(Ms, errors, verbose = False, returnBoundingBoxes = False, exact = False, constant_check = True, low_dim_quadratic_check = True, all_dim_quadratic_check = False, max_cpu=1): """Initiates shrinking and subdivision recursion and returns the roots and bounding boxes. Parameters @@ -1428,6 +1476,7 @@ def solveChebyshevSubdivision(Ms, errors, verbose = False, returnBoundingBoxes = solverOptions.low_dim_quadratic_check = low_dim_quadratic_check solverOptions.all_dim_quadratic_check = all_dim_quadratic_check solverOptions.useFinalStep = True + solverOptions.max_cpu=max_cpu if verbose: print("Finding roots...", end=' ') diff --git a/yroots/Combined_Solver.py b/yroots/Combined_Solver.py index 15ffba53..20026e00 100644 --- a/yroots/Combined_Solver.py +++ b/yroots/Combined_Solver.py @@ -7,7 +7,7 @@ from yroots.polynomial import MultiCheb,MultiPower from time import time -def solve(funcs,a=-1,b=1, verbose = False, returnBoundingBoxes = False, exact=False, minBoundingIntervalSize=1e-5): +def solve(funcs,a=-1,b=1, verbose = False, returnBoundingBoxes = False, exact=False, minBoundingIntervalSize=1e-5, max_cpu=1): """Finds and returns the roots of a system of functions on the search interval [a,b]. Generates an approximation for each function using Chebyshev polynomials on the interval given, @@ -141,7 +141,7 @@ def solve(funcs,a=-1,b=1, verbose = False, returnBoundingBoxes = False, exact=Fa #Solve the Chebyshev polynomial system yroots, boundingBoxes = ChebyshevSubdivisionSolver.solveChebyshevSubdivision(polys,errs,verbose,True,exact, - constant_check=True, low_dim_quadratic_check=True, all_dim_quadratic_check=False) + constant_check=True, low_dim_quadratic_check=True, all_dim_quadratic_check=False, max_cpu=max_cpu) #If the bounding box is the entire interval, subdivide it! usingSubdivision = np.all(b-a > minBoundingIntervalSize) From d2a3d784964ed7e102de2142d3993f696667ff83 Mon Sep 17 00:00:00 2001 From: JarvisRAs Date: Fri, 24 Apr 2026 20:26:38 -0600 Subject: [PATCH 02/36] Fixed line in solvePolyRecursive --- README.md | 2 +- yroots/ChebyshevSubdivisionSolver.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 184d8c4f..291256f9 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ YRoots is a Python package designed for numerical rootfinding of multivariate systems of equations. -For a tutorial on YRoots syntax, set-up and examples on how to use it with different function systems, see [YRoots Tutorial](https://github.com/tylerjarvis/RootFinding/blob/main/YRootsTutorial.ipynb) and for a more detailed demonstration of the code's capabilities on solving more challenging problems, see [YRoots Demo](https://github.com/tylerjarvis/RootFinding/blob/main/YRootsDemo.ipynb). +For a tutorial on YRoots syntax, set-up, and examples on how to use it with different function systems, see [Combined Notebook](https://github.com/tylerjarvis/RootFinding/blob/main/CombinedNotebook.ipynb). Documentation is posted at https://tylerjarvis.github.io/RootFinding/ diff --git a/yroots/ChebyshevSubdivisionSolver.py b/yroots/ChebyshevSubdivisionSolver.py index 875876d6..58d533f6 100644 --- a/yroots/ChebyshevSubdivisionSolver.py +++ b/yroots/ChebyshevSubdivisionSolver.py @@ -1307,6 +1307,8 @@ def solvePolyRecursive(Ms, trackedInterval, errors, solverOptions): resultInterior += newInterior resultExterior += newExterior + resultsAll += newInterior + newExterior + if len(resultsAll) == 0: #Can't throw out final step! This might not actually be a root though! trackedInterval.possibleExtraRoot = True From f73e20ed7cd2d28f6bbf95bb13911c8dbc049e91 Mon Sep 17 00:00:00 2001 From: JarvisRAs Date: Fri, 24 Apr 2026 20:30:47 -0600 Subject: [PATCH 03/36] Fixed line that updates 'resultsAll' --- yroots/ChebyshevSubdivisionSolver.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yroots/ChebyshevSubdivisionSolver.py b/yroots/ChebyshevSubdivisionSolver.py index 58d533f6..f684d6ac 100644 --- a/yroots/ChebyshevSubdivisionSolver.py +++ b/yroots/ChebyshevSubdivisionSolver.py @@ -1301,13 +1301,13 @@ def solvePolyRecursive(Ms, trackedInterval, errors, solverOptions): for newInterior, newExterior in child_results: resultInterior += newInterior resultExterior += newExterior + resultsAll += newInterior + newExterior else: for newMs, newErrs, newInt in zip(allMs, allErrors, allIntervals): newInterior, newExterior = solvePolyRecursive(newMs, newInt, newErrs, solverOptions) resultInterior += newInterior resultExterior += newExterior - - resultsAll += newInterior + newExterior + resultsAll += newInterior + newExterior if len(resultsAll) == 0: #Can't throw out final step! This might not actually be a root though! From c648e8d0127c370a567a9f0e66c27a4edea59df7 Mon Sep 17 00:00:00 2001 From: JarvisRAs Date: Fri, 24 Apr 2026 21:03:41 -0600 Subject: [PATCH 04/36] Updated solve docstring and added unit_test --- tests/test_Combined_Solver.py | 26 ++++++++++++++++++++++++++ yroots/Combined_Solver.py | 2 ++ 2 files changed, 28 insertions(+) diff --git a/tests/test_Combined_Solver.py b/tests/test_Combined_Solver.py index feb8d0d8..3a3cd04b 100644 --- a/tests/test_Combined_Solver.py +++ b/tests/test_Combined_Solver.py @@ -292,3 +292,29 @@ def test_outside_neg1_pos1(): assert np.max(np.abs(f(roots[:,0], roots[:,1]))) < tol2 assert np.max(np.abs(g(roots[:,0], roots[:,1]))) < tol2 + +def test_parallelization(): + coeff = np.zeros((3, 3, 3)) + coeff[1, 0, 0], coeff[0, 1, 2], coeff[2, 1, 0] = -1, 2, 4 + f = yr.MultiCheb(coeff) + + coeff = np.zeros((3, 3, 3)) + coeff[0, 2,0], coeff[1,2, 0], coeff[1, 1, 1] = 5, 3, 2 + g = yr.MultiCheb(coeff) + + coeff = np.zeros((3, 3, 3)) + coeff[0, 0, 1], coeff[1,0, 0], coeff[2, 1, 0] = 2, -1, 3 + h = yr.MultiCheb(coeff) + + roots = yr.solve([f, g, h],[-1, -1, -1],[1, 1, 1]) + roots2 = yr.solve([f, g, h],[-1, -1, -1],[1, 1, 1], max_cpu=5) + + assert len(roots) > 0 + assert len(roots) == len(roots2) + assert np.max(np.abs(f(roots))) < tol2 + assert np.max(np.abs(g(roots))) < tol2 + assert np.max(np.abs(h(roots))) < tol2 + + assert np.isclose(np.max(np.abs(f(roots))), np.max(np.abs(f(roots2)))) + assert np.isclose(np.max(np.abs(g(roots))), np.max(np.abs(g(roots2)))) + assert np.isclose(np.max(np.abs(h(roots))), np.max(np.abs(h(roots2)))) \ No newline at end of file diff --git a/yroots/Combined_Solver.py b/yroots/Combined_Solver.py index 20026e00..fbc4f61e 100644 --- a/yroots/Combined_Solver.py +++ b/yroots/Combined_Solver.py @@ -77,6 +77,8 @@ def solve(funcs,a=-1,b=1, verbose = False, returnBoundingBoxes = False, exact=Fa times. Should give more accurate roots when smaller. This number is absolute when the boudning interval in question is in [-1,1], and relative otherwise. So if an interval has an endpoint of magnitude > 1, then minBoundingIntervalSize is multipled by that value for that dimension. + max_cpu : int + Defaults to 1. Max number of allowed cpus when solving subdivided regions. Returns ------- From c70e1944520e1df65d8b1562837f8e3e60ea3a77 Mon Sep 17 00:00:00 2001 From: JarvisRAs Date: Mon, 27 Apr 2026 14:58:07 -0600 Subject: [PATCH 05/36] Parallel Attempt 2 --- yroots/ChebyshevSubdivisionSolver.py | 761 +++++++++++++++++++++------ 1 file changed, 593 insertions(+), 168 deletions(-) diff --git a/yroots/ChebyshevSubdivisionSolver.py b/yroots/ChebyshevSubdivisionSolver.py index f684d6ac..f864ac1f 100644 --- a/yroots/ChebyshevSubdivisionSolver.py +++ b/yroots/ChebyshevSubdivisionSolver.py @@ -10,8 +10,43 @@ import warnings # Edit number 1 +from dataclasses import dataclass +from concurrent.futures import ProcessPoolExecutor, wait, FIRST_COMPLETED from multiprocessing import Pool +# Edit Edit +@dataclass +class SolveTask: + Ms: object + trackedInterval: object + errors: object + parent_id: int | None = None +@dataclass +class SubdivisionState: + """ + Stores the information needed to finish a parent interval + after all of its children have completed. + """ + originalMs: object + originalInterval: object + trackedInterval: object + errors: object + solverOptions: object + isFinalStep: bool +@dataclass +class TaskResult: + """ + If childTasks is empty, this task is finished. + + If childTasks is nonempty, this task subdivided and needs the + driver to solve children before finishing the parent. + """ + interior: list + exterior: list + childTasks: list + subdivisionState: SubdivisionState | None = None +# End Edit + class SolverOptions(): """Settings for running interval checks, transformations, and subdivision in solvePolyRecursive. @@ -1182,257 +1217,647 @@ def isExteriorInterval(originalInterval, trackedInterval): """Determines if the current interval is exterior to its original interval.""" return np.any(trackedInterval.getIntervalForCombining() == originalInterval.getIntervalForCombining()) -# Edit number 3 -# Runs the top level of subdivision in parallel -# Turns off parallel for next level of subdivision -def _run_children(allMs, allErrors, allIntervals, solverOptions): - if not allIntervals: - return [] +# Edit Edit +def make_child_tasks(allMs, allErrors, allIntervals, parent_id=None): + return [ + SolveTask(newMs, newInt, newErrs, parent_id=parent_id) + for newMs, newErrs, newInt in zip(allMs, allErrors, allIntervals) + ] - tasks = [] - childSolverOptions = solverOptions.copy() - childSolverOptions.allowParallel = False +def solvePolySequential(Ms, trackedInterval, errors, solverOptions): + """ + Fully sequential solve. - for newMs, newErrs, newInt in zip(allMs, allErrors, allIntervals): - tasks.append((newMs, newInt, newErrs, childSolverOptions)) + Use this inside workers when you do not want nested parallelism. + """ + localOptions = solverOptions.copy() + localOptions.allowParallel = False + return solvePolyRecursive( + Ms, + trackedInterval, + errors, + localOptions, + returnChildren=False + ) + +def _solve_one_level_worker(task, solverOptions): + """ + Worker for one unit of multilevel work. - nproc = max(1, min(len(allIntervals), solverOptions.max_cpu)) + It solves one interval until either: + 1. it finishes, or + 2. it reaches subdivision and returns child tasks. + """ + localOptions = solverOptions.copy() + localOptions.allowParallel = False + + return solvePolyRecursive( + task.Ms, + task.trackedInterval, + task.errors, + localOptions, + returnChildren=True + ) + +def finish_subdivision_state(state, childInterior, childExterior): + """ + Finish a parent interval after its children have completed. - with Pool(processes=nproc) as pool: - return pool.starmap(solvePolyRecursive, tasks) + This contains the logic that used to happen immediately after the + recursive child calls returned. + """ + originalMs = state.originalMs + originalInterval = state.originalInterval + trackedInterval = state.trackedInterval + errors = state.errors + solverOptions = state.solverOptions -def solvePolyRecursive(Ms, trackedInterval, errors, solverOptions): - """Recursively shrinks and subdivides the given interval to find the locations of all roots. + resultInterior = list(childInterior) + resultExterior = list(childExterior) - Parameters - ---------- - Ms : list of numpy arrays - The chebyshev approximations of the functions - trackedInterval : TrackedInterval - The information about the interval we are solving on. - errors : numpy array - An upper bound for the error of the Chebyshev approximation of the function on the interval - solverOptions : SolverOptions - Desired settings for running interval checks, transformations, and subdivision. + if state.isFinalStep: + resultsAll = resultInterior + resultExterior - Returns - ------- - boundingBoxesInterior : list of numpy arrays (optional) - Each element of the list is an interval in which there may be a root. The interval is on the interior of the current - interval - boundingBoxesExterior : list of numpy arrays (optional) - Each element of the list is an interval in which there may be a root. The interval is on the exterior of the current - interval + if len(resultsAll) == 0: + trackedInterval.possibleExtraRoot = True + + if isExteriorInterval(originalInterval, trackedInterval): + return [], [trackedInterval] + else: + return [trackedInterval], [] + + # Combine all roots that converged to the same point. + allFoundRoots = set() + tempResults = [] + + for result in resultsAll: + point = tuple(result.interval[:, 0]) + if point in allFoundRoots: + continue + allFoundRoots.add(point) + tempResults.append(result) + + for result in tempResults: + if len(result.possibleDuplicateRoots) > 0: + trackedInterval.possibleDuplicateRoots += result.possibleDuplicateRoots + else: + trackedInterval.possibleDuplicateRoots.append(result.getFinalPoint()) + + if isExteriorInterval(originalInterval, trackedInterval): + return [], [trackedInterval] + else: + return [trackedInterval], [] + + idx1 = 0 + idx2 = 1 + + for tempInterval in resultExterior: + tempInterval.reRun = False + + while idx1 < len(resultExterior): + while idx2 < len(resultExterior): + if resultExterior[idx1].overlapsWith(resultExterior[idx2]): + combinedInterval = originalInterval.copy() + + if combinedInterval.finalStep: + combinedInterval.interval = combinedInterval.preFinalInterval.copy() + combinedInterval.transforms = combinedInterval.preFinalTransforms.copy() + + newAs = np.min( + [ + resultExterior[idx1].getIntervalForCombining()[:, 0], + resultExterior[idx2].getIntervalForCombining()[:, 0] + ], + axis=0 + ) + + newBs = np.max( + [ + resultExterior[idx1].getIntervalForCombining()[:, 1], + resultExterior[idx2].getIntervalForCombining()[:, 1] + ], + axis=0 + ) + + final1 = resultExterior[idx1].getFinalInterval() + final2 = resultExterior[idx2].getFinalInterval() + + newAsFinal = np.min([final1[:, 0], final2[:, 0]], axis=0) + newBsFinal = np.max([final1[:, 1], final2[:, 1]], axis=0) + + oldAs = originalInterval.interval[:, 0] + oldBs = originalInterval.interval[:, 1] + oldAsFinal, oldBsFinal = originalInterval.getFinalInterval().T + + equalMask = oldBsFinal == oldAsFinal + oldBsFinal[equalMask] = oldBsFinal[equalMask] + 1 + + currSubinterval = ( + ( + 2 * np.array([newAsFinal, newBsFinal]) + - oldAsFinal + - oldBsFinal + ) + / (oldBsFinal - oldAsFinal) + ).T + + currSubinterval[equalMask, 0] = -1 + currSubinterval[equalMask, 1] = 1 + + currSubinterval[:, 0][oldAs == newAs] = -1 + currSubinterval[:, 1][oldBs == newBs] = 1 + + combinedInterval.addTransform(currSubinterval) + combinedInterval.interval = np.array([newAs, newBs]).T + combinedInterval.reRun = True + + del resultExterior[idx2] + del resultExterior[idx1] + + resultExterior.append(combinedInterval) + idx2 = idx1 + 1 + else: + idx2 += 1 + + idx1 += 1 + idx2 = idx1 + 1 + + # Rerun touching intervals. + newResultExterior = [] + + for tempInterval in resultExterior: + if tempInterval.reRun: + if np.all(tempInterval.interval == originalInterval.interval): + newResultExterior.append(tempInterval) + else: + tempMs, tempErrors = transformChebToInterval( + originalMs, + *tempInterval.getLastTransform(), + errors, + solverOptions.exact + ) + + tempResultsInterior, tempResultsExterior = solvePolySequential( + tempMs, + tempInterval, + tempErrors, + solverOptions + ) + + resultInterior += tempResultsInterior + newResultExterior += tempResultsExterior + + elif isExteriorInterval(originalInterval, tempInterval): + newResultExterior.append(tempInterval) + + else: + resultInterior.append(tempInterval) + + return resultInterior, newResultExterior + + +def solvePolyParallelMultilevel(Ms, trackedInterval, errors, solverOptions): + """ + Multilevel parallel driver. + + This is the only place where a process pool is created. """ - #TODO: Check if trackedInterval.interval has width 0 in some dimension, in which case we should get rid of that dimension. - #If the interval is a point, return it + max_workers = max(1, solverOptions.max_cpu) + + workerOptions = solverOptions.copy() + workerOptions.allowParallel = False + + next_parent_id = 0 + + pendingTasks = [ + SolveTask(Ms, trackedInterval, errors, parent_id=None) + ] + + futures = set() + + # parent_id -> bookkeeping + waitingParents = {} + + finalInterior = [] + finalExterior = [] + + def submit_task(executor, task): + return executor.submit(_solve_one_level_worker, task, workerOptions), task.parent_id + + def complete_result(result, parent_id): + """ + Handle a completed TaskResult. + + If parent_id is None, add directly to final result. + Otherwise, accumulate into the waiting parent. + """ + nonlocal next_parent_id + + # Case 1: the task finished normally. + if len(result.childTasks) == 0: + if parent_id is None: + finalInterior.extend(result.interior) + finalExterior.extend(result.exterior) + else: + parent = waitingParents[parent_id] + parent["interior"].extend(result.interior) + parent["exterior"].extend(result.exterior) + parent["remaining"] -= 1 + + return + + # Case 2: the task subdivided. + this_parent_id = next_parent_id + next_parent_id += 1 + + waitingParents[this_parent_id] = { + "state": result.subdivisionState, + "parent_id": parent_id, + "remaining": len(result.childTasks), + "interior": list(result.interior), + "exterior": list(result.exterior), + } + + for child in result.childTasks: + child.parent_id = this_parent_id + pendingTasks.append(child) + + def finish_ready_parents(): + """ + Some parent may become ready after its final child finishes. + + Finishing a parent produces normal interior/exterior results, + which then need to be passed upward to that parent's parent. + """ + changed = True + + while changed: + changed = False + + ready_ids = [ + parent_id + for parent_id, parent in waitingParents.items() + if parent["remaining"] == 0 + ] + + for parent_id in ready_ids: + parent = waitingParents.pop(parent_id) + + interior, exterior = finish_subdivision_state( + parent["state"], + parent["interior"], + parent["exterior"] + ) + + parent_result = TaskResult( + interior=interior, + exterior=exterior, + childTasks=[], + subdivisionState=None + ) + + complete_result(parent_result, parent["parent_id"]) + changed = True + + with ProcessPoolExecutor(max_workers=max_workers) as executor: + future_to_parent = {} + + # Fill pool initially. + while pendingTasks and len(futures) < max_workers: + task = pendingTasks.pop() + fut, parent_id = submit_task(executor, task) + futures.add(fut) + future_to_parent[fut] = parent_id + + while futures: + done, futures = wait(futures, return_when=FIRST_COMPLETED) + + for fut in done: + parent_id = future_to_parent.pop(fut) + result = fut.result() + + complete_result(result, parent_id) + finish_ready_parents() + + # Refill available worker slots. + while pendingTasks and len(futures) < max_workers: + task = pendingTasks.pop() + fut, parent_id = submit_task(executor, task) + futures.add(fut) + future_to_parent[fut] = parent_id + + # After all futures finish, make sure all parent continuations are finished. + finish_ready_parents() + + return finalInterior, finalExterior + + +def solvePolyRecursive(Ms, trackedInterval, errors, solverOptions, returnChildren=False): + """ + Recursively shrinks and subdivides the given interval to find the locations of all roots. + + When returnChildren=False: + behaves like the original sequential recursive function. + + When returnChildren=True: + solves until it reaches a subdivision point, then returns a TaskResult + containing child tasks instead of recursively solving those children. + """ + if trackedInterval.isPoint(): + if returnChildren: + return TaskResult([], [trackedInterval], []) return [], [trackedInterval] - #If we ever change the options in this function, we will need to do a copy here. - #Should be cheap, but as we never change them for now just avoid the copy solverOptions = solverOptions.copy() solverOptions.level += 1 - #Constant term check, runs at the beginning of the solve and before each subdivision - #If the absolute value of the constant term for any of the chebyshev polynomials is greater than the sum of the - #absoulte values of any of the other terms, it will return that there are no zeros on that interval + # Constant term check. if solverOptions.constant_check: consts = np.array([M.ravel()[0] for M in Ms]) - err = np.array([np.sum(np.abs(M))-abs(c)+e for M,e,c in zip(Ms,errors,consts)]) + err = np.array([ + np.sum(np.abs(M)) - abs(c) + e + for M, e, c in zip(Ms, errors, consts) + ]) + if np.any(np.abs(consts) > err): + if returnChildren: + return TaskResult([], [], []) return [], [] - #Runs quadratic check after constant check, only for dimensions 2 and 3 by default - #More expensive than constant term check, but testing show it saves time in lower dimensions - if (solverOptions.low_dim_quadratic_check and Ms[0].ndim <= 3) or solverOptions.all_dim_quadratic_check: + # Quadratic check. + if ( + solverOptions.low_dim_quadratic_check and Ms[0].ndim <= 3 + ) or solverOptions.all_dim_quadratic_check: for i in range(len(Ms)): if quadratic_check(Ms[i], errors[i]): + if returnChildren: + return TaskResult([], [], []) return [], [] - #Trim + # Trim. Ms = Ms.copy() originalMs = Ms.copy() trackedInterval = trackedInterval.copy() errors = errors.copy() + tolerable_error = max(errors) * 1e-3 trimMs(Ms, errors) - #Solve dim = Ms[0].ndim changed = True zoomCount = 0 + originalInterval = trackedInterval.copy() originalIntervalSize = trackedInterval.size() - #Zoom in while we can + lastSizes = trackedInterval.dimSize() + start_time = time() + while changed and zoomCount <= solverOptions.maxZoomCount: - #Zoom in until we stop changing or we hit machine epsilon - Ms, errors, trackedInterval, changed, should_stop = zoomInOnIntervalIter(Ms, errors, trackedInterval, solverOptions.exact) - if trackedInterval.empty: #Throw out the interval + Ms, errors, trackedInterval, changed, should_stop = zoomInOnIntervalIter( + Ms, + errors, + trackedInterval, + solverOptions.exact + ) + + if trackedInterval.empty: + if returnChildren: + return TaskResult([], [], []) return [], [] - #Only count in towards the max is we don't cut the interval in half + newSizes = trackedInterval.dimSize() - if np.all(newSizes >= lastSizes / 2): #Check all dims and use >= to account for a dimension being 0. + + if np.all(newSizes >= lastSizes / 2): zoomCount += 1 + lastSizes = newSizes + finish_time = time() + if should_stop: - #Start the final step if the is in the options and we aren't already in it. if trackedInterval.finalStep or not solverOptions.useFinalStep: if solverOptions.verbose: - print("*",end="") + print("*", end="") + if isExteriorInterval(originalInterval, trackedInterval): + if returnChildren: + return TaskResult([], [trackedInterval], []) return [], [trackedInterval] else: + if returnChildren: + return TaskResult([trackedInterval], [], []) return [trackedInterval], [] + else: trackedInterval.startFinalStep() - return solvePolyRecursive(Ms, trackedInterval, errors, solverOptions) + + if returnChildren: + # Continue solving this same interval in the global scheduler. + child = SolveTask(Ms, trackedInterval, errors) + state = SubdivisionState( + originalMs=originalMs, + originalInterval=originalInterval, + trackedInterval=trackedInterval, + errors=errors, + solverOptions=solverOptions, + isFinalStep=False + ) + + return TaskResult( + interior=[], + exterior=[], + childTasks=[child], + subdivisionState=state + ) + + return solvePolyRecursive( + Ms, + trackedInterval, + errors, + solverOptions, + returnChildren=False + ) + elif trackedInterval.finalStep: trackedInterval.canThrowOutFinalStep = True - allMs, allErrors, allIntervals = getSubdivisionIntervals(Ms, errors, trackedInterval, solverOptions.exact, solverOptions.level) - # Edit number 5 + resultInterior, resultExterior = [], [] + + allMs, allErrors, allIntervals = getSubdivisionIntervals( + Ms, + errors, + trackedInterval, + solverOptions.exact, + solverOptions.level + ) + + childTasks = make_child_tasks(allMs, allErrors, allIntervals) + + if returnChildren: + state = SubdivisionState( + originalMs=originalMs, + originalInterval=originalInterval, + trackedInterval=trackedInterval, + errors=errors, + solverOptions=solverOptions, + isFinalStep=True + ) + + return TaskResult( + interior=resultInterior, + exterior=resultExterior, + childTasks=childTasks, + subdivisionState=state + ) + + # Sequential fallback. resultsAll = [] - if solverOptions.allowParallel and solverOptions.max_cpu > 1: - child_results = _run_children(allMs, allErrors, allIntervals, solverOptions) - for newInterior, newExterior in child_results: - resultInterior += newInterior - resultExterior += newExterior - resultsAll += newInterior + newExterior - else: - for newMs, newErrs, newInt in zip(allMs, allErrors, allIntervals): - newInterior, newExterior = solvePolyRecursive(newMs, newInt, newErrs, solverOptions) - resultInterior += newInterior - resultExterior += newExterior - resultsAll += newInterior + newExterior + + for child in childTasks: + newInterior, newExterior = solvePolyRecursive( + child.Ms, + child.trackedInterval, + child.errors, + solverOptions, + returnChildren=False + ) + + resultInterior += newInterior + resultExterior += newExterior + + resultsAll += newInterior + resultsAll += newExterior if len(resultsAll) == 0: - #Can't throw out final step! This might not actually be a root though! trackedInterval.possibleExtraRoot = True + if isExteriorInterval(originalInterval, trackedInterval): return [], [trackedInterval] else: return [trackedInterval], [] + else: - #Combine all roots that converged to the same point. allFoundRoots = set() tempResults = [] + for result in resultsAll: - point = tuple(result.interval[:,0]) + point = tuple(result.interval[:, 0]) + if point in allFoundRoots: continue + allFoundRoots.add(point) tempResults.append(result) + for result in tempResults: if len(result.possibleDuplicateRoots) > 0: trackedInterval.possibleDuplicateRoots += result.possibleDuplicateRoots else: trackedInterval.possibleDuplicateRoots.append(result.getFinalPoint()) + if isExteriorInterval(originalInterval, trackedInterval): return [], [trackedInterval] else: return [trackedInterval], [] - #TODO: Don't subdivide in the final step in dimensions that are already points! + else: - #Otherwise, Subdivide + # Normal subdivision. if solverOptions.level == 15: - warnings.warn(f"High subdivision depth!\nSubdivision on the search interval has now reached" + - " at least depth 15. Runtime may be prolonged.") + warnings.warn( + "High subdivision depth!\n" + "Subdivision on the search interval has now reached " + "at least depth 15. Runtime may be prolonged." + ) + elif solverOptions.level == 25: - warnings.warn(f"Extreme subdivision depth!\nSubdivision on the search interval has now reached" + - " at least depth 25, which is unusual. The solver may not finish running." + - "Ensure the input functions meet the requirements of being continuous, smooth," + - "and having only finitely many simple roots on the search interval.") + warnings.warn( + "Extreme subdivision depth!\n" + "Subdivision on the search interval has now reached " + "at least depth 25, which is unusual. The solver may not finish running. " + "Ensure the input functions meet the requirements of being continuous, " + "smooth, and having only finitely many simple roots on the search interval." + ) + resultInterior, resultExterior = [], [] - #Get the new intervals and polynomials - allMs, allErrors, allIntervals = getSubdivisionIntervals(Ms, errors, trackedInterval, solverOptions.exact, solverOptions.level) - #Run each interval - - # Edit number 4 - if solverOptions.allowParallel and solverOptions.max_cpu > 1: - child_results = _run_children(allMs, allErrors, allIntervals, solverOptions) - for newInterior, newExterior in child_results: - resultInterior += newInterior - resultExterior += newExterior - else: - for newMs, newErrs, newInt in zip(allMs, allErrors, allIntervals): - newInterior, newExterior = solvePolyRecursive(newMs, newInt, newErrs, solverOptions) - resultInterior += newInterior - resultExterior += newExterior - - - - #Rerun the touching intervals - idx1 = 0 - idx2 = 1 - #Combine any touching intervals and throw them at the end. Flip a bool saying rerun them - #If changing this code, test it by defaulting the nextTransformationsInterals to 0, so roots lie on the boundary more. - #TODO: Make the combining intervals it's own function!!! - for tempInterval in resultExterior: - tempInterval.reRun = False - while idx1 < len(resultExterior): - while idx2 < len(resultExterior): - if resultExterior[idx1].overlapsWith(resultExterior[idx2]): - #Combine, throw at the back. Set reRun to true. - combinedInterval = originalInterval.copy() - if combinedInterval.finalStep: - combinedInterval.interval = combinedInterval.preFinalInterval.copy() - combinedInterval.transforms = combinedInterval.preFinalTransforms.copy() - newAs = np.min([resultExterior[idx1].getIntervalForCombining()[:,0], resultExterior[idx2].getIntervalForCombining()[:,0]], axis=0) - newBs = np.max([resultExterior[idx1].getIntervalForCombining()[:,1], resultExterior[idx2].getIntervalForCombining()[:,1]], axis=0) - final1 = resultExterior[idx1].getFinalInterval() - final2 = resultExterior[idx2].getFinalInterval() - newAsFinal = np.min([final1[:,0], final2[:,0]], axis=0) - newBsFinal = np.max([final1[:,1], final2[:,1]], axis=0) - oldAs = originalInterval.interval[:,0] - oldBs = originalInterval.interval[:,1] - oldAsFinal, oldBsFinal = originalInterval.getFinalInterval().T - #Find the final A and B values exactly. Then do the currSubinterval calculation exactly. - #Look at what was done on the example that's failing and see why. - equalMask = oldBsFinal == oldAsFinal - oldBsFinal[equalMask] = oldBsFinal[equalMask] + 1 #Avoid a divide by zero on the next line - currSubinterval = ((2*np.array([newAsFinal, newBsFinal]) - oldAsFinal - oldBsFinal)/(oldBsFinal - oldAsFinal)).T - #If the interval is exactly -1 or 1, make sure that shows up as exact. - currSubinterval[equalMask,0] = -1 - currSubinterval[equalMask,1] = 1 - currSubinterval[:,0][oldAs == newAs] = -1 - currSubinterval[:,1][oldBs == newBs] = 1 - #Update the current subinterval. Use the best transform we can get here, but use the exact combined - #interval for tracking - combinedInterval.addTransform(currSubinterval) - combinedInterval.interval = np.array([newAs, newBs]).T - combinedInterval.reRun = True - del resultExterior[idx2] - del resultExterior[idx1] - resultExterior.append(combinedInterval) - idx2 = idx1 + 1 - else: - idx2 += 1 - idx1 += 1 - idx2 = idx1 + 1 - #Rerun, check if still on exterior - newResultExterior = [] - for tempInterval in resultExterior: - if tempInterval.reRun: - if np.all(tempInterval.interval == originalInterval.interval): - newResultExterior.append(tempInterval) - else: - #Project the MS onto the interval, then recall the function. - #TODO: Instead of using the originalMs, use Ms, and then don't use the original interval, use the one - #we started subdivision with. - tempMs, tempErrors = transformChebToInterval(originalMs, *tempInterval.getLastTransform(), errors, solverOptions.exact) - tempResultsInterior, tempResultsExterior = solvePolyRecursive(tempMs, tempInterval, tempErrors, solverOptions) - #We can assume that nothing in these has to be recombined - resultInterior += tempResultsInterior - newResultExterior += tempResultsExterior - elif isExteriorInterval(originalInterval, tempInterval): - newResultExterior.append(tempInterval) - else: - resultInterior.append(tempInterval) - return resultInterior, newResultExterior + + allMs, allErrors, allIntervals = getSubdivisionIntervals( + Ms, + errors, + trackedInterval, + solverOptions.exact, + solverOptions.level + ) + + childTasks = make_child_tasks(allMs, allErrors, allIntervals) + + if returnChildren: + state = SubdivisionState( + originalMs=originalMs, + originalInterval=originalInterval, + trackedInterval=trackedInterval, + errors=errors, + solverOptions=solverOptions, + isFinalStep=False + ) + + return TaskResult( + interior=resultInterior, + exterior=resultExterior, + childTasks=childTasks, + subdivisionState=state + ) + + # Sequential fallback. + for child in childTasks: + newInterior, newExterior = solvePolyRecursive( + child.Ms, + child.trackedInterval, + child.errors, + solverOptions, + returnChildren=False + ) + + resultInterior += newInterior + resultExterior += newExterior + + return finish_subdivision_state( + SubdivisionState( + originalMs=originalMs, + originalInterval=originalInterval, + trackedInterval=trackedInterval, + errors=errors, + solverOptions=solverOptions, + isFinalStep=False + ), + resultInterior, + resultExterior + ) + + +def solvePoly(Ms, trackedInterval, errors, solverOptions): + """ + Recommended public entry point. + + Call this instead of calling solvePolyRecursive directly. + """ + if solverOptions.allowParallel and solverOptions.max_cpu > 1: + return solvePolyParallelMultilevel( + Ms, + trackedInterval, + errors, + solverOptions + ) + + return solvePolyRecursive( + Ms, + trackedInterval, + errors, + solverOptions, + returnChildren=False + ) def solveChebyshevSubdivision(Ms, errors, verbose = False, returnBoundingBoxes = False, exact = False, constant_check = True, low_dim_quadratic_check = True, all_dim_quadratic_check = False, max_cpu=1): """Initiates shrinking and subdivision recursion and returns the roots and bounding boxes. @@ -1482,7 +1907,7 @@ def solveChebyshevSubdivision(Ms, errors, verbose = False, returnBoundingBoxes = if verbose: print("Finding roots...", end=' ') - b1, b2 = solvePolyRecursive(Ms, originalInterval, errors, solverOptions) + b1, b2 = solvePoly(Ms, originalInterval, errors, solverOptions) boundingIntervals = b1 + b2 roots = [] From e12b3d69f5c80c72e257868039d7d04469c3b664 Mon Sep 17 00:00:00 2001 From: JarvisRAs Date: Fri, 22 May 2026 15:42:28 -0600 Subject: [PATCH 06/36] Move old test codes and add test code for parallelization --- .github/workflows/Unit_Tests.yml | 23 +- .../devastating_example_test_scripts.py | 0 tests/{ => _old_code}/gen_random_tests.py | 0 tests/{ => _old_code}/intervals.pdf | Bin tests/{ => _old_code}/maxdeg_testing.py | 0 tests/{ => _old_code}/qrt_test_scripts.py | 0 tests/{ => _old_code}/random_tests.py | 0 tests/test_parallelization.py | 449 ++++ yroots/ChebyshevSubdivisionSolver.py | 11 +- yroots/ChebyshevSubdivisionSolverClaude.py | 1911 +++++++++++++++++ yroots/Combined_Solver.py | 13 +- 11 files changed, 2390 insertions(+), 17 deletions(-) rename tests/{ => _old_code}/devastating_example_test_scripts.py (100%) rename tests/{ => _old_code}/gen_random_tests.py (100%) rename tests/{ => _old_code}/intervals.pdf (100%) rename tests/{ => _old_code}/maxdeg_testing.py (100%) rename tests/{ => _old_code}/qrt_test_scripts.py (100%) rename tests/{ => _old_code}/random_tests.py (100%) create mode 100644 tests/test_parallelization.py create mode 100644 yroots/ChebyshevSubdivisionSolverClaude.py diff --git a/.github/workflows/Unit_Tests.yml b/.github/workflows/Unit_Tests.yml index 3d57fb53..ba15384b 100644 --- a/.github/workflows/Unit_Tests.yml +++ b/.github/workflows/Unit_Tests.yml @@ -1,6 +1,3 @@ -# This workflow will install Python dependencies, run tests and lint with a single version of Python -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python - name: Unit_Tests on: @@ -14,20 +11,30 @@ permissions: jobs: build: - runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up Python 3.11 - uses: actions/setup-python@v3 + + - name: Set up Python 3.14t + uses: actions/setup-python@v6 with: - python-version: "3.11" + python-version: "3.14t" + + - name: Check CPU count + run: nproc + + - name: Check Python version + run: | + python --version + python -c "import sysconfig; print('Py_GIL_DISABLED =', sysconfig.get_config_var('Py_GIL_DISABLED'))" + - name: Install dependencies run: | python -m pip install --upgrade pip pip install pytest if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Test with pytest run: | - pytest tests --ignore=tests/_old_unit_tests + pytest tests --ignore=tests/_old_unit_tests \ No newline at end of file diff --git a/tests/devastating_example_test_scripts.py b/tests/_old_code/devastating_example_test_scripts.py similarity index 100% rename from tests/devastating_example_test_scripts.py rename to tests/_old_code/devastating_example_test_scripts.py diff --git a/tests/gen_random_tests.py b/tests/_old_code/gen_random_tests.py similarity index 100% rename from tests/gen_random_tests.py rename to tests/_old_code/gen_random_tests.py diff --git a/tests/intervals.pdf b/tests/_old_code/intervals.pdf similarity index 100% rename from tests/intervals.pdf rename to tests/_old_code/intervals.pdf diff --git a/tests/maxdeg_testing.py b/tests/_old_code/maxdeg_testing.py similarity index 100% rename from tests/maxdeg_testing.py rename to tests/_old_code/maxdeg_testing.py diff --git a/tests/qrt_test_scripts.py b/tests/_old_code/qrt_test_scripts.py similarity index 100% rename from tests/qrt_test_scripts.py rename to tests/_old_code/qrt_test_scripts.py diff --git a/tests/random_tests.py b/tests/_old_code/random_tests.py similarity index 100% rename from tests/random_tests.py rename to tests/_old_code/random_tests.py diff --git a/tests/test_parallelization.py b/tests/test_parallelization.py new file mode 100644 index 00000000..7b8255f0 --- /dev/null +++ b/tests/test_parallelization.py @@ -0,0 +1,449 @@ +""" +Unit tests for the yroots algorithm. + +For each test case the suite verifies: + 1. Serial yroots – roots match the polished (ground-truth) roots + 2. Parallel yroots – roots match the polished (ground-truth) roots + 3. Serial vs parallel – both runs agree with each other + +Comparison helpers (ported from the original test suite) +--------------------------------------------------------- + norm_pass_or_fail – sorted-norm difference on x and y columns + residuals – |f(roots)| at each root + residuals_pass_or_fail – max residual within tolerance +""" + +import os +import numpy as np +import pytest +from yroots import solve +import time + +# --------------------------------------------------------------------------- +# Configuration +# --------------------------------------------------------------------------- + +EPS = 2.220446049250313e-16 +DEFAULT_TOL = 10000 * EPS # ~2.22e-12 + +MAX_CPU = 4 +PARALLEL_DEPTH = 2 + +POLISHED_DIR = os.path.join(os.path.dirname(__file__), "../Polished_results") + + +# --------------------------------------------------------------------------- +# Helpers (ported from original test suite) +# --------------------------------------------------------------------------- + +def load_polished(test_num): + """Load polished roots from ../Polished_results/polished_{test_num}.npy""" + path = os.path.join(POLISHED_DIR, f"polished_{test_num}.npy") + roots = np.load(path) + if roots.ndim == 1: + roots = roots.reshape(1, -1) + return roots + + +def norm_pass_or_fail(yroots, roots, tol=DEFAULT_TOL): + """ + Sort both root arrays and compare column-wise norms. + Returns (passed, x_norm, y_norm). + """ + roots_sorted = np.sort(roots, axis=0) + yroots_sorted = np.sort(yroots, axis=0) + diff = roots_sorted - yroots_sorted + x_norm = np.linalg.norm(diff[:, 0]) + y_norm = np.linalg.norm(diff[:, 1]) + return x_norm < tol and y_norm < tol, x_norm, y_norm + + +def residuals(func, roots): + """Absolute residuals of func at each root.""" + return np.abs(func(roots[:, 0], roots[:, 1])) + + +def residuals_pass_or_fail(funcs, roots, tol=DEFAULT_TOL): + """True if max residual of every func is within tol.""" + for func in funcs: + if np.max(residuals(func, roots)) > tol: + return False + return True + + +def run_serial(tc): + return solve([tc["f"], tc["g"]], tc["a_min"], tc["a_max"], exact=True) + + +def run_parallel(tc): + return solve([tc["f"], tc["g"]], tc["a_min"], tc["a_max"], exact=True, max_cpu=MAX_CPU, parallel_depth=PARALLEL_DEPTH) + + +# --------------------------------------------------------------------------- +# Test-case definitions +# --------------------------------------------------------------------------- + +TEST_CASES = [ + dict( + id = "1.1", + desc = "Test 1.1 – degree-5 system, 4 roots", + f = lambda x, y: 144*(x**4 + y**4) - 225*(x**2 + y**2) + 350*x**2*y**2 + 81, + g = lambda x, y: y - x**6, + a_min = [-1, -1], + a_max = [ 1, 1], + tol = DEFAULT_TOL, + ), + # dict( + # id = "1.2", + # desc = "Test 1.2 – degree-10 system, 13 roots", + # f = lambda x, y: ( + # (y**2 - x**3) * + # ((y - 0.7)**2 - (x - 0.3)**3) * + # ((y + 0.2)**2 - (x + 0.8)**3) * + # ((y + 0.2)**2 - (x - 0.8)**3) + # ), + # g = lambda x, y: ( + # ((y + .4)**3 - (x - .4)**2) * + # ((y + .3)**3 - (x - .3)**2) * + # ((y - .5)**3 - (x + .6)**2) * + # ((y + 0.3)**3 - (2*x - 0.8)**3) + # ), + # a_min = [-1, -1], + # a_max = [ 1, 1], + # tol = 2.220446049250313e-10, + # ), + dict( + id = "1.3", + desc = "Test 1.3 – cusp system, 5 roots", + f = lambda x, y: y**2 - x**3, + g = lambda x, y: (y + .1)**3 - (x - .1)**2, + a_min = [-1, -1], + a_max = [ 1, 1], + tol = DEFAULT_TOL, + ), + dict( + id = "1.4", + desc = "Test 1.4 – linear system, 1 root", + f = lambda x, y: x - y + .5, + g = lambda x, y: x + y, + a_min = [-1, -1], + a_max = [ 1, 1], + tol = DEFAULT_TOL, + ), + dict( + id = "1.5", + desc = "Test 1.5 – linear system, 1 root", + f = lambda x, y: y + x/2 + 1/10, + g = lambda x, y: y - 2.1*x + 2, + a_min = [-1, -1], + a_max = [ 1, 1], + tol = DEFAULT_TOL, + ), + dict( + id = "2.1", + desc = "Test 2.1 – cos/parabola system, 6 roots", + f = lambda x, y: np.cos(10*x*y), + g = lambda x, y: x + y**2, + a_min = [-1, -1], + a_max = [ 1, 1], + tol = DEFAULT_TOL, + ), + dict( + id = "2.2", + desc = "Test 2.2 – near-tangent circle, 2 roots", + f = lambda x, y: x, + g = lambda x, y: (x - 0.9999)**2 + y**2 - 1, + a_min = [-1, -1], + a_max = [ 1, 1], + tol = DEFAULT_TOL, + ), + dict( + id = "2.3", + desc = "Test 2.3 – sin/cos trig system, 5 roots", + f = lambda x, y: np.sin(4*(x + y/10 + np.pi/10)), + g = lambda x, y: np.cos(2*(x - 2*y + np.pi/7)), + a_min = [-1, -1], + a_max = [ 1, 1], + tol = DEFAULT_TOL, + ), + dict( + id = "2.4", + desc = "Test 2.4 – exp/sin system, 93 roots", + f = lambda x, y: np.exp(x - 2*x**2 - y**2) * np.sin(10*(x + y + x*y**2)), + g = lambda x, y: np.exp(-x + 2*y**2 + x*y**2) * np.sin(10*(x - y - 2*x*y**2)), + a_min = [-1, -1], + a_max = [ 1, 1], + tol = DEFAULT_TOL, + ), + dict( + id = "2.5", + desc = "Test 2.5 – trig system, 103 roots", + f = lambda x, y: 2*y*np.cos(y**2)*np.cos(2*x) - np.cos(y), + g = lambda x, y: 2*np.sin(y**2)*np.sin(2*x) - np.sin(x), + a_min = [-4, -4], + a_max = [ 4, 4], + tol = 2.220446049250313e-12, + ), + dict( + id = "3.1", + desc = "Test 3.1 – ellipse/circle system, 4 roots", + f = lambda x, y: (x - .3)**2 + 2*(y + 0.3)**2 - 1, + g = lambda x, y: ( + ((x - .49)**2 + (y + .5)**2 - 1) * + ((x + 0.5)**2 + (y + 0.5)**2 - 1) * + ((x - 1)**2 + (y - 0.5)**2 - 1) + ), + a_min = [-1, -1], + a_max = [ 1, 1], + tol = 2.220446049250313e-11, + ), + dict( + id = "3.2", + desc = "Test 3.2 – product of ellipses, 45 roots", + f = lambda x, y: ( + ((x - 0.1)**2 + 2*(y - 0.1)**2 - 1) * + ((x + 0.3)**2 + 2*(y - 0.2)**2 - 1) * + ((x - 0.3)**2 + 2*(y + 0.15)**2 - 1) * + ((x - 0.13)**2 + 2*(y + 0.15)**2 - 1) + ), + g = lambda x, y: ( + (2*(x + 0.1)**2 + (y + 0.1)**2 - 1) * + (2*(x + 0.1)**2 + (y - 0.1)**2 - 1) * + (2*(x - 0.3)**2 + (y - 0.15)**2 - 1) * + ((x - 0.21)**2 + 2*(y - 0.15)**2 - 1) + ), + a_min = [-1, -1], + a_max = [ 1, 1], + tol = 2.220446049250313e-11, + ), + dict( + id = "4.1", + desc = "Test 4.1 – sin system, 5 roots", + f = lambda x, y: np.sin(3*(x + y)), + g = lambda x, y: np.sin(3*(x - y)), + a_min = [-1, -1], + a_max = [ 1, 1], + tol = DEFAULT_TOL, + ), + # dict( + # id = "4.2", + # desc = "Test 4.2 – high-degree polynomial system, 2 roots", + # f = lambda x, y: ( + # 90000*y**10 - 1440000*y**9 + + # (360000*x**4 + 720000*x**3 + 504400*x**2 + 144400*x + 9971200)*y**8 + + # (-4680000*x**4 - 9360000*x**3 - 6412800*x**2 - 1732800*x - 39554400)*y**7 + + # (540000*x**8 + 2160000*x**7 + 3817600*x**6 + 3892800*x**5 + 27577600*x**4 + + # 51187200*x**3 + 34257600*x**2 + 8952800*x + 100084400)*y**6 + + # (-5400000*x**8 - 21600000*x**7 - 37598400*x**6 - 37195200*x**5 - 95198400*x**4 - + # 153604800*x**3 - 100484000*x**2 - 26280800*x - 169378400)*y**5 + + # (360000*x**12 + 2160000*x**11 + 6266400*x**10 + 11532000*x**9 + 34831200*x**8 + + # 93892800*x**7 + 148644800*x**6 + 141984000*x**5 + 206976800*x**4 + 275671200*x**3 + + # 176534800*x**2 + 48374000*x + 194042000)*y**4 + + # (-2520000*x**12 - 15120000*x**11 - 42998400*x**10 - 76392000*x**9 - 128887200*x**8 - + # 223516800*x**7 - 300675200*x**6 - 274243200*x**5 - 284547200*x**4 - 303168000*x**3 - + # 190283200*x**2 - 57471200*x - 147677600)*y**3 + + # (90000*x**16 + 720000*x**15 + 3097600*x**14 + 9083200*x**13 + 23934400*x**12 + + # 58284800*x**11 + 117148800*x**10 + 182149600*x**9 + 241101600*x**8 + 295968000*x**7 + + # 320782400*x**6 + 276224000*x**5 + 236601600*x**4 + 200510400*x**3 + 123359200*x**2 + + # 43175600*x + 70248800)*y**2 + + # (-360000*x**16 - 2880000*x**15 - 11812800*x**14 - 32289600*x**13 - 66043200*x**12 - + # 107534400*x**11 - 148807200*x**10 - 184672800*x**9 - 205771200*x**8 - 196425600*x**7 - + # 166587200*x**6 - 135043200*x**5 - 107568800*x**4 - 73394400*x**3 - 44061600*x**2 - + # 18772000*x - 17896000)*y + + # (144400*x**18 + 1299600*x**17 + 5269600*x**16 + 12699200*x**15 + 21632000*x**14 + + # 32289600*x**13 + 48149600*x**12 + 63997600*x**11 + 67834400*x**10 + 61884000*x**9 + + # 55708800*x**8 + 45478400*x**7 + 32775200*x**6 + 26766400*x**5 + 21309200*x**4 + + # 11185200*x**3 + 6242400*x**2 + 3465600*x + 1708800) + # ), + # g = lambda x, y: 1e-4 * ( + # y**7 - 3*y**6 + + # (2*x**2 - x + 2)*y**5 + + # (x**3 - 6*x**2 + x + 2)*y**4 + + # (x**4 - 2*x**3 + 2*x**2 + x - 3)*y**3 + + # (2*x**5 - 3*x**4 + x**3 + 10*x**2 - x + 1)*y**2 + + # (-x**5 + 3*x**4 + 4*x**3 - 12*x**2)*y + + # (x**7 - 3*x**5 - x**4 - 4*x**3 + 4*x**2) + # ), + # a_min = [-1, -1], + # a_max = [ 1, 1], + # tol = DEFAULT_TOL, + # ), + dict( + id = "5.1", + desc = "Test 5.1 – trig system, 10 roots", + f = lambda x, y: 2*x*y*np.cos(y**2)*np.cos(2*x) - np.cos(x*y), + g = lambda x, y: 2*np.sin(x*y**2)*np.sin(3*x*y) - np.sin(x*y), + a_min = [-2, -2], + a_max = [ 2, 2], + tol = DEFAULT_TOL, + ), + # dict( + # id = "6.1", + # desc = "Test 6.1 – line/circle system, 5 roots", + # f = lambda x, y: (y - 2*x) * (y + 0.5*x), + # g = lambda x, y: x * (x**2 + y**2 - 1), + # a_min = [-1, -1], + # a_max = [ 1, 1], + # tol = 2.220446049250313e-8, + # ), +] + +_ids = [tc["id"] for tc in TEST_CASES] + + +# --------------------------------------------------------------------------- +# Fixture +# --------------------------------------------------------------------------- + +@pytest.fixture(params=TEST_CASES, ids=_ids) +def test_case(request): + tc = request.param + polished = load_polished(tc["id"]) + return {**tc, "polished": polished} + + +# --------------------------------------------------------------------------- +# Tests +# --------------------------------------------------------------------------- + +class TestSerialRoots: + """Serial solve() must match polished ground-truth roots.""" + + def test_root_count(self, test_case): + tc = test_case + print(tc["polished"]) + try: + roots = run_serial(tc) + print(roots) + + except RecursionError: + pytest.fail(f"{tc['desc']}: serial solve() hit maximum recursion depth.") + roots = np.atleast_2d(roots) + assert len(roots) == len(tc["polished"]), ( + f"{tc['desc']}: expected {len(tc['polished'])} roots, " + f"got {len(roots)} (serial)." + ) + + def test_norm(self, test_case): + tc = test_case + try: + roots = run_serial(tc) + except RecursionError: + pytest.fail(f"{tc['desc']}: serial solve() hit maximum recursion depth.") + roots = np.atleast_2d(roots) + passed, x_norm, y_norm = norm_pass_or_fail(roots, tc["polished"], tol=tc["tol"]) + assert passed, ( + f"{tc['desc']} (serial): norm test failed. " + f"x_norm={x_norm:.2e}, y_norm={y_norm:.2e} (tol={tc['tol']:.2e})." + ) + + def test_residuals(self, test_case): + tc = test_case + try: + roots = run_serial(tc) + except RecursionError: + pytest.fail(f"{tc['desc']}: serial solve() hit maximum recursion depth.") + roots = np.atleast_2d(roots) + assert residuals_pass_or_fail([tc["f"], tc["g"]], roots, tol=tc["tol"]), ( + f"{tc['desc']} (serial): residual test failed. " + f"Max f residual={np.max(residuals(tc['f'], roots)):.2e}, " + f"Max g residual={np.max(residuals(tc['g'], roots)):.2e}." + ) + + +class TestParallelRoots: + """Parallel solve() must match polished ground-truth roots.""" + + def test_root_count(self, test_case): + tc = test_case + try: + roots = run_parallel(tc) + except RecursionError: + pytest.fail(f"{tc['desc']}: parallel solve() hit maximum recursion depth.") + roots = np.atleast_2d(roots) + assert len(roots) == len(tc["polished"]), ( + f"{tc['desc']}: expected {len(tc['polished'])} roots, " + f"got {len(roots)} (parallel)." + ) + + def test_norm(self, test_case): + tc = test_case + try: + roots = run_parallel(tc) + except RecursionError: + pytest.fail(f"{tc['desc']}: parallel solve() hit maximum recursion depth.") + roots = np.atleast_2d(roots) + passed, x_norm, y_norm = norm_pass_or_fail(roots, tc["polished"], tol=tc["tol"]) + assert passed, ( + f"{tc['desc']} (parallel): norm test failed. " + f"x_norm={x_norm:.2e}, y_norm={y_norm:.2e} (tol={tc['tol']:.2e})." + ) + + def test_residuals(self, test_case): + tc = test_case + try: + roots = run_parallel(tc) + except RecursionError: + pytest.fail(f"{tc['desc']}: parallel solve() hit maximum recursion depth.") + roots = np.atleast_2d(roots) + assert residuals_pass_or_fail([tc["f"], tc["g"]], roots, tol=tc["tol"]), ( + f"{tc['desc']} (parallel): residual test failed. " + f"Max f residual={np.max(residuals(tc['f'], roots)):.2e}, " + f"Max g residual={np.max(residuals(tc['g'], roots)):.2e}." + ) + + +class TestSerialVsParallel: + """Serial and parallel runs must agree with each other.""" + + def test_root_count_agreement(self, test_case): + tc = test_case + try: + serial = np.atleast_2d(run_serial(tc)) + except RecursionError: + pytest.fail(f"{tc['desc']}: serial solve() hit maximum recursion depth.") + try: + parallel = np.atleast_2d(run_parallel(tc)) + except RecursionError: + pytest.fail(f"{tc['desc']}: parallel solve() hit maximum recursion depth.") + assert len(serial) == len(parallel), ( + f"{tc['desc']}: serial found {len(serial)} roots, " + f"parallel found {len(parallel)}." + ) + + def test_norm_agreement(self, test_case): + tc = test_case + try: + serial = np.atleast_2d(run_serial(tc)) + except RecursionError: + pytest.fail(f"{tc['desc']}: serial solve() hit maximum recursion depth.") + try: + parallel = np.atleast_2d(run_parallel(tc)) + except RecursionError: + pytest.fail(f"{tc['desc']}: parallel solve() hit maximum recursion depth.") + passed, x_norm, y_norm = norm_pass_or_fail(serial, parallel, tol=tc["tol"]) + assert passed, ( + f"{tc['desc']}: serial and parallel roots diverge. " + f"x_norm={x_norm:.2e}, y_norm={y_norm:.2e} (tol={tc['tol']:.2e})." + ) + + def test_speedup(self, test_case, capsys): + tc = test_case + + t0 = time.perf_counter() + serial = np.atleast_2d(run_serial(tc)) + t_serial = time.perf_counter() - t0 + + t0 = time.perf_counter() + parallel = np.atleast_2d(run_parallel(tc)) + t_parallel = time.perf_counter() - t0 + + speedup = t_serial / t_parallel if t_parallel > 0 else float("inf") + + with capsys.disabled(): + print( + f"\n{tc['desc']}: " + f"serial={t_serial:.3f}s parallel={t_parallel:.3f}s " + f"speedup={speedup:.2f}x " + f"(roots: {len(serial)} vs {len(parallel)})" + ) \ No newline at end of file diff --git a/yroots/ChebyshevSubdivisionSolver.py b/yroots/ChebyshevSubdivisionSolver.py index f864ac1f..d72ef6a3 100644 --- a/yroots/ChebyshevSubdivisionSolver.py +++ b/yroots/ChebyshevSubdivisionSolver.py @@ -81,6 +81,7 @@ def __init__(self): # Parameters for parallelization self.max_cpu = 1 self.allowParallel = True + self.parallel_depth = 1 def copy(self): return copy.copy(self) #Return shallow copy, everything should be a basic type @@ -558,7 +559,7 @@ def getFinalPoint(self): def size(self): """Gets the volume of the current interval.""" - return np.product(self.interval[:,1] - self.interval[:,0]) + return np.prod(self.interval[:,1] - self.interval[:,0]) def dimSize(self): """Gets the lengths along each dimension of the current interval.""" @@ -769,7 +770,7 @@ def BoundingIntervalLinearSystem(Ms, errors, finalStep, macheps = 2**-52): forceShouldStop = finalStep and not wellConditioned # Calculate the "changed" variable - newRatio = np.product(b - a) / 2**dim + newRatio = np.prod(b - a) / 2**dim if throwOut: changed = True elif i == 0: @@ -1843,7 +1844,7 @@ def solvePoly(Ms, trackedInterval, errors, solverOptions): Call this instead of calling solvePolyRecursive directly. """ - if solverOptions.allowParallel and solverOptions.max_cpu > 1: + if solverOptions.parallel_depth > 0 and solverOptions.max_cpu > 1: return solvePolyParallelMultilevel( Ms, trackedInterval, @@ -1859,7 +1860,8 @@ def solvePoly(Ms, trackedInterval, errors, solverOptions): returnChildren=False ) -def solveChebyshevSubdivision(Ms, errors, verbose = False, returnBoundingBoxes = False, exact = False, constant_check = True, low_dim_quadratic_check = True, all_dim_quadratic_check = False, max_cpu=1): +def solveChebyshevSubdivision(Ms, errors, verbose=False, returnBoundingBoxes=False, exact=False, constant_check=True, + low_dim_quadratic_check=True, all_dim_quadratic_check=False, max_cpu=1, parallel_depth=1): """Initiates shrinking and subdivision recursion and returns the roots and bounding boxes. Parameters @@ -1904,6 +1906,7 @@ def solveChebyshevSubdivision(Ms, errors, verbose = False, returnBoundingBoxes = solverOptions.all_dim_quadratic_check = all_dim_quadratic_check solverOptions.useFinalStep = True solverOptions.max_cpu=max_cpu + solverOptions.parallel_depth=parallel_depth if verbose: print("Finding roots...", end=' ') diff --git a/yroots/ChebyshevSubdivisionSolverClaude.py b/yroots/ChebyshevSubdivisionSolverClaude.py new file mode 100644 index 00000000..fde0d8de --- /dev/null +++ b/yroots/ChebyshevSubdivisionSolverClaude.py @@ -0,0 +1,1911 @@ +import numpy as np +from numba import njit, float64 +from numba.types import UniTuple +from itertools import product +from scipy.spatial import HalfspaceIntersection, QhullError +from scipy.optimize import linprog +from yroots.QuadraticCheck import quadratic_check +from time import time +import copy +import warnings + +# Edit number 1 +from dataclasses import dataclass +from concurrent.futures import ThreadPoolExecutor, wait, FIRST_COMPLETED +from multiprocessing import Pool + +# Edit Edit +@dataclass +class SolveTask: + Ms: object + trackedInterval: object + errors: object + parent_id: int | None = None + level: int = 0 +@dataclass +class SubdivisionState: + """ + Stores the information needed to finish a parent interval + after all of its children have completed. + """ + originalMs: object + originalInterval: object + trackedInterval: object + errors: object + solverOptions: object + isFinalStep: bool +@dataclass +class TaskResult: + """ + If childTasks is empty, this task is finished. + + If childTasks is nonempty, this task subdivided and needs the + driver to solve children before finishing the parent. + """ + interior: list + exterior: list + childTasks: list + subdivisionState: SubdivisionState | None = None +# End Edit + +class SolverOptions(): + """Settings for running interval checks, transformations, and subdivision in solvePolyRecursive. + + Parameters + ---------- + verbose : bool + Defaults to False. Whether or not to output progress of solving to the terminal. + exact : bool + Defaults to False. Whether the transformation in TransformChebInPlaceND should minimize error. + constant_check : bool + Defaults to True. Whether or not to run constant term check after each subdivision. + low_dim_quadratic_check : bool + Defaults to True. Whether or not to run quadratic check in dim 2, 3. + all_dim_quadratic_check : bool + Defaults to False. Whether or not to run quadratic check in dim >= 4. + maxZoomCount : int + Maximum number of zooms allowed before subdividing (prevents infinite infintesimal shrinking) + level : int + Depth of subdivision for the given interval. + """ + def __init__(self): + #Init all the Options to default value + self.verbose = False + self.exact = False + self.constant_check = True + self.low_dim_quadratic_check = True + self.all_dim_quadratic_check = False + self.maxZoomCount = 25 + self.level = 0 + + # Edit number 2 + # Parameters for parallelization + self.max_cpu = 1 + self.allowParallel = True + # Subdivision depth below which child tasks are pushed to the process + # pool. Tasks at or beyond this depth solve their children serially in + # the worker, avoiding the scheduling overhead of tiny tasks. + self.parallel_depth = np.inf + + def copy(self): + return copy.copy(self) #Return shallow copy, everything should be a basic type + +@njit +def TransformChebInPlace1D(coeffs, alpha, beta): + """Applies the transformation alpha*x + beta to one dimension of a Chebyshev approximation. + + Recursively finds each column of the transformation matrix C from the previous two columns + and then performs entrywise matrix multiplication for each entry of the column, thus enabling + the transformation to occur while only retaining three columns of C in memory at a time. + + Parameters + ---------- + coeffs : numpy array + The coefficient array + alpha : double + The scaler of the transformation + beta : double + The shifting of the transformation + + Returns + ------- + transformedCoeffs : numpy array + The new coefficient array following the transformation + """ + transformedCoeffs = np.zeros_like(coeffs) + + #Initialize three arrays to represent subsequent columns of the transformation matrix. + arr1 = np.zeros(len(coeffs)) + arr2 = np.zeros(len(coeffs)) + arr3 = np.zeros(len(coeffs)) + + #The first column of the transformation matrix C. Since T_0(alpha*x + beta) = T_0(x) = 1 has 1 in the top entry and 0's elsewhere. + arr1[0] = 1. + transformedCoeffs[0] = coeffs[0] # arr1[0] * coeffs[0] (matrix multiplication step) + #The second column of C. Note that T_1(alpha*x + beta) = alpha*T_1(x) + beta*T_0(x). + arr2[0] = beta + arr2[1] = alpha + transformedCoeffs[0] += beta * coeffs[1] # arr2[0] * coeffs[1] (matrix muliplication) + transformedCoeffs[1] += alpha * coeffs[1] # arr2[1] * coeffs[1] (matrix multiplication) + + maxRow = 2 + for col in range(2, len(coeffs)): # For each column, calculate each entry and do matrix mult + thisCoeff = coeffs[col] # the row of coeffs corresponding to the column col of C (for matrix mult) + # The first entry + arr3[0] = -arr1[0] + alpha*arr2[1] + 2*beta*arr2[0] + transformedCoeffs[0] += thisCoeff * arr3[0] + + # The second entry + if maxRow > 2: + arr3[1] = -arr1[1] + alpha*(2*arr2[0] + arr2[2]) + 2*beta*arr2[1] + transformedCoeffs[1] += thisCoeff * arr3[1] + + # All middle entries + for i in range(2, maxRow - 1): + arr3[i] = -arr1[i] + alpha*(arr2[i-1] + arr2[i+1]) + 2*beta*arr2[i] + transformedCoeffs[i] += thisCoeff * arr3[i] + + # The second to last entry + i = maxRow - 1 + arr3[i] = -arr1[i] + (2 if i == 1 else 1)*alpha*(arr2[i-1]) + 2*beta*arr2[i] + transformedCoeffs[i] += thisCoeff * arr3[i] + + #The last entry + finalVal = alpha*arr2[i] + # This final entry is typically very small. If it is essentially machine epsilon, + # zero it out to save calculations. + if abs(finalVal) > 1e-16: #TODO: Justify this val! + arr3[maxRow] = finalVal + transformedCoeffs[maxRow] += thisCoeff * finalVal + maxRow += 1 # Next column will have one more entry than the current column. + + # Save the values of arr2 and arr3 to arr1 and arr2 to get ready for calculating the next column. + arr = arr1 + arr1 = arr2 + arr2 = arr3 + arr3 = arr + # + return transformedCoeffs[:maxRow] + +@njit +def TransformChebInPlace1DErrorFree(coeffs, alpha, beta): + """Applies the transformation alpha*x + beta to the Chebyshev polynomial coeffs with minimal error. + + This function is identical to TransformChebInPlace1D except that this function is more careful to + minimize error by calling on functions to more precisely perform the multiplication and addition. + + Parameters + ---------- + coeffs : numpy array + The coefficient array + alpha : double + The scaler of the transformation + beta : double + The shifting of the transformation + + Returns + ------- + coeffs : numpy array + The new coefficient array following the transformation + """ + if alpha == 0.5 and abs(beta) == 0.5: + return TransformChebInPlace1DErrorFreeSplit(coeffs, np.sign(beta)) + transformedCoeffs = np.zeros_like(coeffs) + arr1 = np.zeros(len(coeffs)) + arr2 = np.zeros(len(coeffs)) + arr3 = np.zeros(len(coeffs)) + arr1E = np.zeros(len(coeffs)) + arr2E = np.zeros(len(coeffs)) + arr3E = np.zeros(len(coeffs)) + + alpha1,alpha2 = Split(alpha) + beta1,beta2 = Split(beta) + + #The first array + arr1[0] = 1. + transformedCoeffs[0] = coeffs[0] + #The second array + arr2[0] = beta + arr2[1] = alpha + transformedCoeffs[0] += beta * coeffs[1] + transformedCoeffs[1] += alpha * coeffs[1] + #Loop + maxRow = 2 + for col in range(2, len(coeffs)): + thisCoeff = coeffs[col] + + #Get the next arr from arr1 and arr2 + + #The 0 spot + # Calculate and store arr3[0] = -arr1[0] + alpha*arr2[1] + 2*beta*arr2[0] + V1, E1 = TwoProdWithSplit(beta, 2*arr2[0], beta1, beta2) + V2, E2 = TwoProdWithSplit(alpha, arr2[1], alpha1, alpha2) + V3, E3 = TwoSum(V1, V2) + V4, E4 = TwoSum(V3, -arr1[0]) + arr3[0] = V4 + # Now sum the error associated with this calculation and add it to the calculated value, + # then perform the matrix multiplication associated with this entry. + arr3E[0] = -arr1E[0] + alpha*arr2E[1] + 2*beta*arr2E[0] + E1 + E2 + E3 + E4 + transformedCoeffs[0] += thisCoeff * (arr3[0] + arr3E[0]) + + # The procedure associated with minimizing error is the same for subsequent spots. + #The 1 spot + if maxRow > 2: + #arr3[1] = -arr1[1] + alpha*(2*arr2[0] + arr2[2]) + 2*beta*arr2[1] + V1, E1 = TwoSum(2*arr2[0], arr2[2]) + V2, E2 = TwoProdWithSplit(beta, 2*arr2[1], beta1, beta2) + V3, E3 = TwoProdWithSplit(alpha, V1, alpha1, alpha2) + V4, E4 = TwoSum(V2, V3) + V5, E5 = TwoSum(V4, -arr1[1]) + arr3[1] = V5 + arr3E[1] = -arr1E[1] + alpha*(2*arr2E[0] + arr2E[2] + E1) + 2*beta*arr2E[1] + E2 + E3 + E4 + E5 + transformedCoeffs[1] += thisCoeff * (arr3[1] + arr3E[1]) + + #The middle spots + for i in range(2, maxRow - 1): + #arr3[i] = -arr1[i] + alpha*(arr2[i-1] + arr2[i+1]) + 2*beta*arr2[i] + V1, E1 = TwoSum(arr2[i-1], arr2[i+1]) + V2, E2 = TwoProdWithSplit(beta, 2*arr2[i], beta1, beta2) + V3, E3 = TwoProdWithSplit(alpha, V1, alpha1, alpha2) + V4, E4 = TwoSum(V2, V3) + V5, E5 = TwoSum(V4, -arr1[i]) + arr3[i] = V5 + arr3E[i] = -arr1E[i] + alpha*(arr2E[i-1] + arr2E[i+1] + E1) + 2*beta*arr2E[i] + E2 + E3 + E4 + E5 + transformedCoeffs[i] += thisCoeff * (arr3[i] + arr3E[i]) + + #The second to last spot + i = maxRow - 1 + C1 = (2 if i == 1 else 1) + #arr3[i] = -arr1[i] + C1*alpha*(arr2[i-1]) + 2*beta*arr2[i] + V1, E1 = TwoProdWithSplit(beta, 2*arr2[i], beta1, beta2) + V2, E2 = TwoProdWithSplit(alpha, C1*arr2[i-1], alpha1, alpha2) + V3, E3 = TwoSum(V1, V2) + V4, E4 = TwoSum(V3, -arr1[i]) + arr3[i] = V4 + arr3E[i] = -arr1E[i] + C1*alpha*arr2E[i-1] + 2*beta*arr2E[i] + E1 + E2 + E3 + E4 + transformedCoeffs[i] += thisCoeff * (arr3[i] + arr3E[i]) + + #The last spot + #finalVal = alpha*arr2[i] + finalVal, finalValE = TwoProdWithSplit(alpha, arr2[i], alpha1, alpha2) + arr3E[maxRow] = finalValE + alpha * arr2E[i] + arr3[maxRow] = finalVal + transformedCoeffs[maxRow] += thisCoeff * (arr3[maxRow] + arr3E[maxRow]) + if abs(arr3[maxRow] + arr3E[maxRow]) > 1e-32: #TODO: Justify this val! + maxRow += 1 + + #Rotate the vectors + arr = arr1 + arr1 = arr2 + arr2 = arr3 + arr3 = arr + arr = arr1E + arr1E = arr2E + arr2E = arr3E + arr3E = arr + return transformedCoeffs[:maxRow] + +@njit +def TransformChebInPlace1DErrorFreeSplit(coeffs, betaSign): + """Applies the transformation 0.5*x +- 0.5 to the Chebyshev polynomial coeffs with minimal error. + + This function is a special case of TransformChebInPlace1DErrorFree used to minimize computation + when alpha = 0.5 and beta = +- 0.5 + + Parameters + ---------- + coeffs : numpy array + The coefficient array + betaSign : int + 1 if beta = 0.5; -1 if beta is -0.5 + + Returns + ------- + coeffs : numpy array + The new coefficient array following the transformation + + """ + transformedCoeffs = np.zeros_like(coeffs) + arr1 = np.zeros(len(coeffs)) + arr2 = np.zeros(len(coeffs)) + arr3 = np.zeros(len(coeffs)) + arr1E = np.zeros(len(coeffs)) + arr2E = np.zeros(len(coeffs)) + arr3E = np.zeros(len(coeffs)) + + #The first array + arr1[0] = 1. + transformedCoeffs[0] = coeffs[0] + #The second array + arr2[0] = betaSign*0.5 + arr2[1] = 0.5 + transformedCoeffs[0] += betaSign*coeffs[1]/2 + transformedCoeffs[1] += coeffs[1]/2 + #Loop + maxRow = 2 + for col in range(2, len(coeffs)): + thisCoeff = coeffs[col] + #Get the next arr from arr1 and arr2 + + #The 0 spot + #arr3[0] = -arr1[0] + alpha*arr2[1] + 2*beta*arr2[0] + V1, E1 = TwoSum(arr2[1]/2, betaSign*arr2[0]) + V2, E2 = TwoSum(V1, -arr1[0]) + arr3[0] = V2 + arr3E[0] = -arr1E[0] + arr2E[1]/2 + betaSign*arr2E[0] + E1 + E2 + transformedCoeffs[0] += thisCoeff * (arr3[0] + arr3E[0]) + + #The 1 spot + if maxRow > 2: + #arr3[1] = -arr1[1] + alpha*(2*arr2[0] + arr2[2]) + 2*beta*arr2[1] + V1, E1 = TwoSum(arr2[0], arr2[2]/2) + V2, E2 = TwoSum(V1, betaSign*arr2[1]) + V3, E3 = TwoSum(V2, -arr1[1]) + arr3[1] = V3 + arr3E[1] = -arr1E[1] + arr2E[0] + arr2E[2]/2 + betaSign*arr2E[1] + E1 + E2 + E3 + transformedCoeffs[1] += thisCoeff * (arr3[1] + arr3E[1]) + + #The middle spots + for i in range(2, maxRow - 1): + #arr3[i] = -arr1[i] + alpha*(arr2[i-1] + arr2[i+1]) + 2*beta*arr2[i] + V1, E1 = TwoSum(arr2[i-1], arr2[i+1]) + V2, E2 = TwoSum(V1/2, betaSign*arr2[i]) + V3, E3 = TwoSum(V2, -arr1[i]) + arr3[i] = V3 + arr3E[i] = -arr1E[i] + (arr2E[i-1] + arr2E[i+1] + E1)/2 + betaSign*arr2E[i] + E2 + E3 + transformedCoeffs[i] += thisCoeff * (arr3[i] + arr3E[i]) + + #The second to last spot + i = maxRow - 1 + C1 = (1 if i == 1 else 0.5) + #arr3[i] = -arr1[i] + C1*alpha*(arr2[i-1]) + 2*beta*arr2[i] + V1, E1 = TwoSum(C1*arr2[i-1], betaSign*arr2[i]) + V2, E2 = TwoSum(V1, -arr1[i]) + arr3[i] = V2 + arr3E[i] = -arr1E[i] + C1*arr2E[i-1] + betaSign*arr2E[i] + E1 + E2 + transformedCoeffs[i] += thisCoeff * (arr3[i] + arr3E[i]) + + #The last spot + #finalVal = alpha*arr2[i] + arr3[maxRow] = arr2[i]/2 + arr3E[maxRow] = arr2E[i] / 2 + transformedCoeffs[maxRow] += thisCoeff * (arr3[maxRow] + arr3E[maxRow]) + if abs(arr3[maxRow] + arr3E[maxRow]) > 1e-32: #TODO: Justify this val! + maxRow += 1 + + #Rotate the vectors + arr = arr1 + arr1 = arr2 + arr2 = arr3 + arr3 = arr + arr = arr1E + arr1E = arr2E + arr2E = arr3E + arr3E = arr + return transformedCoeffs[:maxRow] + +def TransformChebInPlaceND(coeffs, dim, alpha, beta, exact): + """Transforms a single dimension of a Chebyshev approximation for a polynomial. + + Parameters + ---------- + coeffs : numpy array + The coefficient tensor to transform + dim : int + The index of the dimension to transform + alpha: double + The scaler of the transformation + beta: double + The shifting of the transformation + exact: bool + Whether to perform the transformation with higher precision to minimize error + + Returns + ------- + transformedCoeffs : numpy array + The new coefficient array following the transformation + """ + + #TODO: Could we calculate the allowed error beforehand and pass it in here? + #TODO: Make this work for the power basis polynomials + if (alpha == 1.0 and beta == 0.0) or coeffs.shape[dim] == 1: + return coeffs # No need to transform if the degree of dim is 0 or transformation is the identity. + TransformFunc = TransformChebInPlace1DErrorFree if exact else TransformChebInPlace1D + if dim == 0: + return TransformFunc(coeffs, alpha, beta) + else: # Need to transpose the matrix to line up the multiplication for the current dim + # Move the current dimension to the dim 0 spot in the np array. + order = np.array([dim] + [i for i in range(dim)] + [i for i in range(dim+1, coeffs.ndim)]) + # Then transpose with the inverted order after the transformation occurs. + backOrder = np.zeros(coeffs.ndim, dtype = int) + backOrder[order] = np.arange(coeffs.ndim) + return TransformFunc(coeffs.transpose(order), alpha, beta).transpose(backOrder) + +class TrackedInterval: + """Tracks the properties of and changes to each interval as it passes through the solver. + + Parameters + ---------- + topInterval: numpy array + The original interval before any changes + interval: numpy array + The current interval (lower bound and upper bound for each dimension in order) + transforms: list + List of the alpha and beta values for all the transformations the interval has undergone + ndim: int + The number of dimensions of which the interval consists + empty: bool + Whether the interval is known to contain no roots + finalStep: bool + Whether the interval is in the final step (zooming in on the bounding box to a point at the end) + canThrowOutFinalStep: bool + Defaults to False. Whether or not the interval should be thrown out if empty in the final step + of solving. Changed to True if subdivision occurs in the final step. + possibleDuplicateRoots: list + Any multiple roots found through subdivision in the final step that would have been + returned as just one root before the final step + possibleExtraRoot: bool + Defaults to False. Whether or not the interval would have been thrown out during the final step. + nextTransformPoints: numpy array + Where the midpoint of the next subdivision should be for each dimension + """ + def __init__(self, interval): + self.topInterval = interval + self.interval = interval + self.transforms = [] + self.ndim = len(self.interval) + self.empty = False + self.finalStep = False + self.canThrowOutFinalStep = False + self.possibleDuplicateRoots = [] + self.possibleExtraRoot = False + self.nextTransformPoints = np.array([0.0394555475981047]*self.ndim) #Random Point near 0 + + def canThrowOut(self): + """Ensures that an interval that has not subdivided cannot be thrown out on the final step.""" + return not self.finalStep or self.canThrowOutFinalStep + + def addTransform(self, subInterval): + """Adds the next alpha and beta values to the list transforms and updates the current interval. + + Parameters: + ----------- + subInterval : numpy array + The subinterval to which the current interval is being reduced + """ + #Ensure the interval has non zero size; mark it empty if it doesn't + if np.any(subInterval[:,0] > subInterval[:,1]) and self.canThrowOut(): + self.empty = True + return + elif np.any(subInterval[:,0] > subInterval[:,1]): + #If we can't throw the interval out, it should be bounded by [-1,1]. + subInterval[:,0] = np.minimum(subInterval[:,0], np.ones_like(subInterval[:,0])) + subInterval[:,0] = np.maximum(subInterval[:,0], -np.ones_like(subInterval[:,0])) + subInterval[:,1] = np.minimum(subInterval[:,1], np.ones_like(subInterval[:,0])) + subInterval[:,1] = np.maximum(subInterval[:,1], subInterval[:,0]) + # Get the alpha and beta associated with the transformation in each dimension + a1,b1 = subInterval.T # all the lower bounds and upper bounds of the new interval, respectively + a2,b2 = self.interval.T # all the lower bounds and upper bounds of the original interval + alpha1, beta1 = (b1-a1)/2, (b1+a1)/2 + alpha2, beta2 = (b2-a2)/2, (b2+a2)/2 + self.transforms.append(np.array([alpha1, beta1])) + #Update the lower and upper bounds of the current interval + for dim in range(self.ndim): + for i in range(2): + x = subInterval[dim][i] + #Be exact if x = +-1 + if x == -1.0: + self.interval[dim][i] = self.interval[dim][0] + elif x == 1.0: + self.interval[dim][i] = self.interval[dim][1] + else: + self.interval[dim][i] = alpha2[dim]*x+beta2[dim] + + def getLastTransform(self): + """Gets the alpha and beta values of the last transformation the interval underwent.""" + return self.transforms[-1] + + def getFinalInterval(self): + """Finds the interval that should be reported as containing a root. + + The final interval is calculated by applying all of the recorded transformations that + occurred before the final step to topInterval, the original interval. + + Returns + ------- + finalInterval: numpy array + The final interval to be reported as containing a root + """ + # TODO: Make this a seperate function so it can use njit. + # Make these _NoNumba calls use floats so they call call the numba functions without a seperate compile + finalInterval = self.topInterval.T + finalIntervalError = np.zeros_like(finalInterval) + transformsToUse = self.transforms if not self.finalStep else self.preFinalTransforms + for alpha,beta in transformsToUse[::-1]: # Iteratively apply each saved transform + finalInterval, temp = TwoProd_NoNumba(finalInterval, alpha) + finalIntervalError = alpha * finalIntervalError + temp + finalInterval, temp = TwoSum_NoNumba(finalInterval,beta) + finalIntervalError += temp + + finalInterval = finalInterval.T + finalIntervalError = finalIntervalError.T + self.finalInterval = finalInterval + finalIntervalError # Add the error and save the result. + self.finalAlpha, alphaError = TwoSum_NoNumba(-finalInterval[:,0]/2,finalInterval[:,1]/2) + self.finalAlpha += alphaError + (finalIntervalError[:,1] - finalIntervalError[:,0])/2 + self.finalBeta, betaError = TwoSum_NoNumba(finalInterval[:,0]/2,finalInterval[:,1]/2) + self.finalBeta += betaError + (finalIntervalError[:,1] + finalIntervalError[:,0])/2 + return self.finalInterval + + def getFinalPoint(self): + """Finds the point that should be reported as the root (midpoint of the final step interval). + + Returns + ------- + root: numpy array + The final point to be reported as the root of the interval + """ + #TODO: Make this a seperate function so it can use njit. + #Make these _NoNumba calls use floats so they call call the numba functions without a seperate compile + if not self.finalStep: #If no final step, use the midpoint of the calculated final interval. + self.root = (self.finalInterval[:,0] + self.finalInterval[:,1]) / 2 + else: #If using the final step, recalculate the final interval using post-final transforms. + finalInterval = self.topInterval.T + finalIntervalError = np.zeros_like(finalInterval) + transformsToUse = self.transforms + for alpha,beta in transformsToUse[::-1]: + finalInterval, temp = TwoProd_NoNumba(finalInterval, alpha) + finalIntervalError = alpha * finalIntervalError + temp + finalInterval, temp = TwoSum_NoNumba(finalInterval,beta) + finalIntervalError += temp + finalInterval = finalInterval.T + finalIntervalError.T + self.root = (finalInterval[:,0] + finalInterval[:,1]) / 2 # Return the midpoint + return self.root + + def size(self): + """Gets the volume of the current interval.""" + return np.prod(self.interval[:,1] - self.interval[:,0]) + + def dimSize(self): + """Gets the lengths along each dimension of the current interval.""" + return self.interval[:,1] - self.interval[:,0] + + def finalDimSize(self): + """Gets the lengths along each dimension of the final interval.""" + return self.finalInterval[:,1] - self.finalInterval[:,0] + + def copy(self): + """Returns a deep copy of the current interval with all changes and properties preserved.""" + newone = TrackedInterval(self.topInterval) + newone.interval = self.interval.copy() + newone.transforms = self.transforms.copy() + newone.empty = self.empty + newone.nextTransformPoints = self.nextTransformPoints.copy() + if self.finalStep: + newone.finalStep = True + newone.canThrowOutFinalStep = self.canThrowOutFinalStep + newone.possibleDuplicateRoots = self.possibleDuplicateRoots.copy() + newone.possibleExtraRoot = self.possibleExtraRoot + newone.preFinalInterval = self.preFinalInterval.copy() + newone.preFinalTransforms = self.preFinalTransforms.copy() + return newone + + def __contains__(self, point): + """Determines if point is contained in the current interval.""" + return np.all(point >= self.interval[:,0]) and np.all(point <= self.interval[:,1]) + + def overlapsWith(self, otherInterval): + """Determines if the otherInterval overlaps with the current interval. + + Returns True if the lower bound of one interval is less than the upper bound of the other + in EVERY dimension; returns False otherwise.""" + for (a1,b1),(a2,b2) in zip(self.getIntervalForCombining(), otherInterval.getIntervalForCombining()): + if a1 > b2 or a2 > b1: + return False + return True + + def isPoint(self): + """Determines if the current interval has essentially length 0 in each dimension.""" + return np.all(np.abs(self.interval[:,0] - self.interval[:,1]) < 1e-32) + + def startFinalStep(self): + """Prepares for the final step by saving the current interval and its transform list.""" + self.finalStep = True + self.preFinalInterval = self.interval.copy() + self.preFinalTransforms = self.transforms.copy() + + def getIntervalForCombining(self): + """Returns the interval to be used in combining intervals to report at the end.""" + return self.preFinalInterval if self.finalStep else self.interval + + def __repr__(self): + return str(self) + + def __str__(self): + return str(self.interval) + +def getLinearTerms(M): + """Gets the linear terms of the Chebyshev coefficient tensor M. + + Uses the fact that the linear terms are located at + M[(0,0, ... ,0,1)] + M[(0,0, ... ,1,0)] + ... + M[(0,1, ... ,0,0)] + M[(1,0, ... ,0,0)] + which are indexes + 1, M.shape[-1], M.shape[-1]*M.shape[-2], ... when looking at M.ravel(). + + Parameters + ---------- + M : numpy array + The coefficient array to get the linear terms from + + Returns + ------- + A: numpy array + An array with the linear terms of M + """ + A = [] + spot = 1 + for i in M.shape[::-1]: + A.append(0 if i == 1 else M.ravel()[spot]) + spot *= i + return A[::-1] # Return linear terms in dimension order. + + +@njit +def linearCheck1(totalErrs, A, consts): + """Takes A, the linear terms of each function approximation, and makes any possible reduction + in the interval based on the totalErrs.""" + dim = len(A) + a = -np.ones(dim) * np.inf + b = np.ones(dim) * np.inf + for row in range(dim): + for col in range(dim): + if A[row,col] != 0: #Don't bother running the check if the linear term is too small. + v1 = totalErrs[row] / abs(A[row,col]) - 1 + v2 = 2 * consts[row] / A[row,col] + if v2 >= 0: + a_, b_ = -v1, v1-v2 + else: + a_, b_ = -v2-v1, v1 + a[col] = max(a[col], a_) + b[col] = min(b[col], b_) + return a, b + +def BoundingIntervalLinearSystem(Ms, errors, finalStep, macheps = 2**-52): + """Finds a smaller region in which any root must be. + + Parameters + ---------- + Ms : list of numpy arrays + Each numpy array is the coefficient tensor of a chebyshev polynomials + errors : iterable of floats + The maximum error of chebyshev approximations + finalStep : bool + Whether we are in the final step of the algorithm + + Returns + ------- + newInterval : numpy array + The smaller interval where any root must be + changed : bool + Whether the interval has shrunk at all + should_stop : bool + Whether we should stop subdividing + throwout : + Whether we should throw out the interval entirely + """ + if finalStep: + errors = np.zeros_like(errors) + + dim = Ms[0].ndim + #Some constants we use here + minZoomForChange = 0.99 #If the volume doesn't shrink by this amount say that it hasn't changed + minZoomForBaseCaseEnd = 0.4**dim #If the volume doesn't change by at least this amount when running with no error, stop + #Get the matrix of the linear terms + A = np.array([getLinearTerms(M) for M in Ms]) + #Get the Vector of the constant terms + consts = np.array([M.ravel()[0] for M in Ms]) + #Get the Error of everything else combined. + totalErrs = np.array([np.sum(np.abs(M)) + e for M,e in zip(Ms, errors)]) + linear_sums = np.sum(np.abs(A),axis=1) + err = np.array([tE-abs(c)-l for tE,c,l in zip(totalErrs,consts,linear_sums)]) + + #Scale all the polynomials relative to one another + errors = errors.copy() + for i in range(dim): + scaleVal = np.max(np.abs(A[i])) + if scaleVal > 0: + s = 2.**int(np.floor(np.log2(abs(scaleVal)))) + A[i] /= s + consts[i] /= s + totalErrs[i] /= s + linear_sums[i] /= s + err[i] /= s + errors[i] /= s + #Precondition the columns. (AP)X = B -> A(PX) = B. So scale columns, solve, then scale the solution. + colScaler = np.ones(dim) + for i in range(dim): + scaleVal = np.max(np.abs(A[:,i])) + if scaleVal > 0: + s = 2**(-np.floor(np.log2(abs(scaleVal)))) + colScaler[i] = s + totalErrs += np.abs(A[:,i]) * (s - 1) + A[:,i] *= s + + #Run linear algorithm for shrinking or deciding whether to subdivide. + #This loop will only execute the second time if the interval was not changed on the first iteration and it needs to run again with tighter errors + #Calculate the SVD outside of the for loop because it doesn't change + U, S, Vh = np.linalg.svd(A) + condNum = S[-1]/S[0] + wellConditioned = S[0] > 0 and condNum > 1e-10 + #Add this width to the new intervals we find to avoid rounding error throwing out roots + widthToAdd = max(condNum,2)*macheps + Ainv = (1/S * Vh.T) @ U.T + center = -Ainv@consts + #Use the first interval shrinking method + a_init, b_init = linearCheck1(totalErrs, A, consts) + for i in range(2): + a = a_init + b = b_init + #We use the matrix inverse to find the width, so might as well use it both spots. Should be fine as dim is small. + if wellConditioned: #Make sure conditioning is ok. + #Ainv transforms the hyperrectangle of side lengths err into a parallelogram with these as the principal direction + #So summing over them gets the farthest the parallelogram can reach in each dimension. + width = np.sum(np.abs(Ainv*err),axis=1) + #Bound with previous result + a = np.maximum(center - width, a) + b = np.minimum(center + width, b) + #Undo the column preconditioning + a *= colScaler + b *= colScaler + #Add error and bound + a -= widthToAdd + b += widthToAdd + if np.any(a > b): + with open("num_of_times","a") as file: + file.write("1\n") + throwOut = np.any(a > b) or np.any(a > 1) or np.any(b < -1) + a[a < -1] = -1 + b[b < -1] = -1 + a[a > 1] = 1 + b[b > 1] = 1 + + forceShouldStop = finalStep and not wellConditioned + # Calculate the "changed" variable + newRatio = np.prod(b - a) / 2**dim + if throwOut: + changed = True + elif i == 0: + changed = newRatio < minZoomForChange + else: + changed = newRatio < minZoomForBaseCaseEnd + + if i == 0 and changed: + #If it is the first time through the loop and there was a change, return the interval it shrunk down to and set "is_done" to false + return np.vstack([a,b]).T, changed, forceShouldStop, throwOut + elif i == 0 and not changed: + #If it is the first time through the loop and there was not a change, save the a and b as the original values to return, + #and then try running through the loop again with a tighter error to see if we shrink then + a_orig = a + b_orig = b + err = errors + elif changed: + #If it is the second time through the loop and it did change, it means we didn't change on the first time, + #but that the interval did shrink with tighter errors. So return the original interval with changed = False and is_done = False + return np.vstack([a_orig, b_orig]).T, False, forceShouldStop, False + else: + #If it is the second time through the loop and it did NOT change, it means we will not shrink the interval even if we subdivide, + #so return the original interval with changed = False and is_done = wellConditioned + return np.vstack([a_orig,b_orig]).T, False, wellConditioned or forceShouldStop, False + +@njit(UniTuple(float64,2)(float64, float64)) +def TwoSum(a,b): + """Returns x,y such that a+b=x+y exactly, and a+b=x in floating point using numba.""" + x = a+b + z = x-a + y = (a-(x-z)) + (b-z) + return x,y +def TwoSum_NoNumba(a,b): + """Returns x,y such that a+b=x+y exactly, and a+b=x in floating point without using numba.""" + x = a+b + z = x-a + y = (a-(x-z)) + (b-z) + return x,y + +@njit(UniTuple(float64,2)(float64)) +def Split(a): + """Returns x,y such that a = x+y exactly and a = x in floating point using numba.""" + c = (2**27 + 1) * a + x = c-(c-a) + y = a-x + return x,y +def Split_NoNumba(a): + """Returns x,y such that a = x+y exactly and a = x in floating point without using numba.""" + c = (2**27 + 1) * a + x = c-(c-a) + y = a-x + return x,y + +@njit(UniTuple(float64,2)(float64, float64)) +def TwoProd(a,b): + """Returns x,y such that a*b=x+y exactly and a*b=x in floating point using numba.""" + x = a*b + a1,a2 = Split(a) + b1,b2 = Split(b) + y=a2*b2-(((x-a1*b1)-a2*b1)-a1*b2) + return x,y +def TwoProd_NoNumba(a,b): + """Returns x,y such that a*b=x+y exactly and a*b=x in floating point without usin numba.""" + x = a*b + a1,a2 = Split_NoNumba(a) + b1,b2 = Split_NoNumba(b) + y=a2*b2-(((x-a1*b1)-a2*b1)-a1*b2) + return x,y + +@njit(UniTuple(float64,2)(float64, float64, float64, float64)) +def TwoProdWithSplit(a,b,a1,a2): + """Returns x,y such that a*b = x+y exactly and a*b = x in floating point but with a already split.""" + x = a*b + b1,b2 = Split(b) + y=a2*b2-(((x-a1*b1)-a2*b1)-a1*b2) + return x,y + +def getTransformPoints(newInterval): + """Gets the alpha and beta points needed to transform the current interval to newInterval.""" + a,b = newInterval + return (b-a)/2, (b+a)/2 + +def getTransformationError(M, dim): + """Returns an upper bound on the error of transforming the Chebyshev approximation M + + In the transformation of dimension dim in M, the matrix multiplication of M by the transformation + matrix C has each element of M involved in n element multiplications, where n is the number of rows + in C, which is equal to the degree of approximation of M in dimension dim, or M.shape[dim]. + + Parameters + ---------- + M : numpy array + The Chebyshev approximation coefficient tensor being transformed + dim : int + The dimension of M being transformed + + Returns + ------- + error : float + The upper bound for the error associated with the transformation of dimension dim in M + """ + machEps = 2**-52 + error = M.shape[dim] * machEps * np.sum(np.abs(M)) + return error #TODO: Figure out a more rigurous bound! + +def transformCheb(M, alphas, betas, error, exact): + """Transforms an entire Chebyshev coefficient matrix using the transformation xHat = alpha*x + beta. + + Parameters + ---------- + M : numpy array + The chebyshev coefficient matrix + alphas : iterable + The scalers in each dimension of the transformation. + betas : iterable + The offset in each dimension of the transformation. + error : float + A bound on the error of the chebyshev approximation + exact : bool + Whether to perform the transformation with higher precision to minimize error + + Returns + ------- + M : numpy array + The coefficient matrix transformed to the new interval + error : float + An upper bound on the error of the transformation + """ + #This just does the matrix multiplication on each dimension. Except it's by a tensor. + for dim,n,alpha,beta in zip(range(M.ndim),M.shape,alphas,betas): + error += getTransformationError(M, dim) + M = TransformChebInPlaceND(M,dim,alpha,beta,exact) + return M, error + +def transformChebToInterval(Ms, alphas, betas, errors, exact): + """Transforms an entire list of Chebyshev approximations to a new interval xHat = alpha*x + beta. + + Parameters + ---------- + Ms : list of numpy arrays + The chebyshev coefficient matrices + alphas : iterable + The scalers of the transformation we are doing. + betas : iterable + The offsets of the transformation we are doing. + errors : numpy array + A bound on the error of each Chebyshev approximation + exact : bool + Whether to perform the transformation with higher precision to minimize error + + Returns + ------- + newMs : list of numpy arrays + The coefficient matrices transformed to the new interval + newErrors : list of numpy arrays + The new errors associated with the transformed coefficient matrices + """ + #Transform the chebyshev polynomials + newMs = [] + newErrors = [] + for M,e in zip(Ms, errors): + newM, newE = transformCheb(M, alphas, betas, e, exact) + newMs.append(newM) + newErrors.append(newE) + return newMs, np.array(newErrors) + +def zoomInOnIntervalIter(Ms, errors, trackedInterval, exact): + """One iteration of shrinking an interval that may contain roots. + + Calls BoundingIntervaLinearSystem which determines a smaller interval in which any roots are + bound to lie. Then calls transformChebToInterval to transform the current coefficient + approximations to the new interval. + + Parameters + ---------- + Ms : list of numpy arrays + The Chebyshev coefficient tensors of each approximation + errors : numpy array + An upper bound on the error of each Chebyshev approximation + trackedInterval : TrackedInterval + The current interval for which the Chebyshev approximations are valid + exact : bool + Whether the transformation should be done with higher precision to minimize error + + Returns + ------- + Ms : list of numpy arrays + The chebyshev coefficient matrices transformed to the new interval + errors : numpy array + The new errors associated with the transformed coefficient matrices + trackedInterval : TrackedInterval + The new interval that the transformed coefficient matrices are valid for + changed : bool + Whether or not the interval shrunk significantly during the iteration + should_stop : bool + Whether or not to continue subdiviing after the iteration of shrinking is completed + """ + + dim = len(Ms) + #Zoom in on the current interval + interval, changed, should_stop, throwOut = BoundingIntervalLinearSystem(Ms, errors, trackedInterval.finalStep) + #Don't zoom in if we're already at a point + for dim in range(len(Ms)): + if trackedInterval.interval[dim,0] == trackedInterval.interval[dim,1]: + interval[dim, 0] = -1. + interval[dim, 1] = 1. + #We can't throw out on the final step + if throwOut and not trackedInterval.canThrowOut(): + throwOut = False + should_stop = True + changed = True + #Check if we can throw out the whole thing + if throwOut: + trackedInterval.empty = True + return Ms, errors, trackedInterval, True, True + #Check if we are done iterating + if not changed: + return Ms, errors, trackedInterval, changed, should_stop + #Transform the chebyshev polynomials + trackedInterval.addTransform(interval) + Ms, errors = transformChebToInterval(Ms, *trackedInterval.getLastTransform(), errors, exact) + #We should stop in the final step once the interval has become a point + if trackedInterval.finalStep and trackedInterval.isPoint(): + should_stop = True + changed = False + + return Ms, errors, trackedInterval, changed, should_stop + +def chebTransform1D(M, alpha, beta, transformDim, exact): + """Transforms a single dimension of a Chebyshev coefficient matrix. + + Parameters + ---------- + M : numpy array + The Chebyshev coefficient matrix + alpha: + The scaler of the transformation + beta: + The shifting of the transformation + transformDim: + The particular dimension of the approximation to be transformed + exact: + Whether the transformation should be performed with higher precision to minimize error + + Returns + ------- + transformed_M : numpy array + The Chebyshev coefficient matrix transformed to the new interval in dimension transformDim + """ + return TransformChebInPlaceND(M, transformDim, alpha, beta, exact) + +def getInverseOrder(order): + """Gets a particular order of matrices needed in getSubdivisionIntervals (helper function). + + Takes the order of dimensions in which a Chebyshev coefficient tensor M was subdivided and gets + the order of the indexes that will arrange the list of resulting transformed matrices as if the + dimensions had bee subdivided in standard index order. For example, if dimensions 0, 3, 1 were + subdivided in that order, this function returns the order [0,2,1,3,4,6,5,7] corresponding to the + indices of currMs such that when arranged in this order, it appears as if the dimensions were + subdivided in order 0, 1, 3. + + Parameters + ---------- + order : numpy array + The order of dimensions along which a coefficient tensor was subdivided + + Returns + ------- + invOrder : numpy array + The order of indices of currMs (in the function getSubdivisionIntervals) that arranges the + matrices resulting from the subdivision as if the original matrix had been subdivided in + numerical order + """ + + t = np.zeros_like(order) + t[np.argsort(order)] = np.arange(len(t)) + order = t + order = 2**(len(order)-1 - order) + newOrder = np.array([i@order for i in product([0,1],repeat=len(order))]) + invOrder = np.zeros_like(newOrder) + invOrder[newOrder] = np.arange(len(newOrder)) + return tuple(invOrder) + +def getSubdivisionDims(Ms,trackedInterval,level): + """Decides which dimensions to subdivide in and in what order. + + Parameters + ---------- + Ms : list of numpy arrays + The chebyshev coefficient matrices + trackedInterval : trackedInterval + The interval to be subdivided + level : int + The current depth of subdivision from the original interval + + Returns + ------- + allDims : numpy array + The ith row gives the dimensions in which Ms[i] should be subdivided, in order. + """ + dim = len(Ms) + dims_to_consider = np.arange(dim) + for i in range(dim): + if np.isclose(trackedInterval.interval[i,0], trackedInterval.interval[i,1]): + if len(dims_to_consider) != 1: + dims_to_consider = np.delete(dims_to_consider, np.argwhere(dims_to_consider==i)) + if level > 5: + return np.vstack([dims_to_consider[np.argsort(np.array(M.shape)[dims_to_consider])[::-1]] for M in Ms]) + else: + dim_lengths = trackedInterval.dimSize() + max_length = np.max([dim_lengths[i] for i in dims_to_consider]) + dims_to_consider = np.extract(dim_lengths[dims_to_consider]>max_length/5,dims_to_consider) + if len(dims_to_consider) > 1: + shapes = np.array([np.array(M.shape) for M in Ms]) + degree_sums = np.sum(shapes,axis=0) + total_sum = np.sum(degree_sums) + for i in dims_to_consider.copy(): + if len(dims_to_consider) > 1 and degree_sums[i] < np.floor(total_sum/(dim+1)): + dims_to_consider = np.delete(dims_to_consider, np.argwhere(dims_to_consider==i)) + return np.vstack([dims_to_consider[np.argsort(np.array(M.shape)[dims_to_consider])[::-1]] for M in Ms]) + +def getSubdivisionIntervals(Ms, errors, trackedInterval, exact, level): + """Gets the matrices, error bounds, and intervals for the next iteration of subdivision. + + Parameters + ---------- + Ms : list of numpy arrays + The chebyshev coefficient matrices + errors : numpy array + An upper bound on the error of each Chebyshev approximation + trackedInterval : trackedInterval + The interval to be subdivided + exact : bool + Whether transformations should be completed with higher precision to minimize error + level : int + The current depth of subdivision from the original interval + + Returns + ------- + allMs : list of numpy arrays + The transformed coefficient matrices associated with each new interval + allErrors : numpy array + A list of upper bounds for the errors associated with each transformed coefficient matrix + allIntervals : list of TrackedIntervals + The intervals from the subdivision (corresponding one to one with the matrices in allMs) + """ + subdivisionDims = getSubdivisionDims(Ms,trackedInterval,level) + dimSet = set(subdivisionDims.flatten()) + if len(dimSet) != subdivisionDims.shape[1]: + raise ValueError("Subdivision Dimensions are invalid! Each Polynomial must subdivide in the same dimensions!") + allMs = [] + allErrors = [] + idx = 0 + for M,error,order in zip(Ms, errors, subdivisionDims): + idx += 1 + #Iterate through the dimensions, highest degree first. + currMs, currErrs = [M],[error] + for thisDim in order: + newMidpoint = trackedInterval.nextTransformPoints[thisDim] + alpha, beta = (newMidpoint+1)/2, (newMidpoint-1)/2 + tempMs = [] + tempErrs = [] + for T,E in zip(currMs, currErrs): + #Transform the polys + P1, P2 = chebTransform1D(T, alpha, beta, thisDim, exact), chebTransform1D(T, -beta, alpha, thisDim, exact) + E1 = getTransformationError(T, thisDim) + tempMs += [P1, P2] + tempErrs += [E1 + E, E1 + E] + currMs = tempMs + currErrs = tempErrs + if M.ndim == 1: + allMs.append(currMs) #Already ordered because there's only 1. + allErrors.append(currErrs) #Already ordered because there's only 1. + else: + #Order the polynomials so they match the intervals in subdivideInterval + invOrder = getInverseOrder(order) + allMs.append([currMs[i] for i in invOrder]) + allErrors.append([currErrs[i] for i in invOrder]) + allMs = [[allMs[i][j] for i in range(len(allMs))] for j in range(len(allMs[0]))] + allErrors = [[allErrors[i][j] for i in range(len(allErrors))] for j in range(len(allErrors[0]))] + #Get the intervals + allIntervals = [trackedInterval] + for thisDim in dimSet: + newMidpoint = trackedInterval.nextTransformPoints[thisDim] + newSubinterval = np.ones_like(trackedInterval.interval) #TODO: Make this outside for loop + newSubinterval[:,0] = -1. + newIntervals = [] + for oldInterval in allIntervals: + newInterval1 = oldInterval.copy() + newInterval2 = oldInterval.copy() + newSubinterval[thisDim] = [-1., newMidpoint] + newInterval1.addTransform(newSubinterval) + newSubinterval[thisDim] = [newMidpoint, 1.] + newInterval2.addTransform(newSubinterval) + newInterval1.nextTransformPoints[thisDim] = 0 + newInterval2.nextTransformPoints[thisDim] = 0 + newIntervals.append(newInterval1) + newIntervals.append(newInterval2) + allIntervals = newIntervals + return allMs, allErrors, allIntervals + +def trimMs(Ms, errors, relApproxTol=1e-3, absApproxTol=0): + """Reduces the degree of each chebyshev approximation M when doing so has negligible error. + + The coefficient matrices are trimmed in place. This function iteratively looks at the highest + degree coefficient row of each M along each dimension and trims it as long as the error introduced + is less than the allowed error increase for that dimension. + + Parameters + ---------- + Ms : list of numpy arrays + The chebyshev approximations of the functions + errors : numpy array + The max error of the chebyshev approximation from the function on the interval + relApproxTol : double + The relative error increase allowed + absApproxTol : double + The absolute error increase allowed + """ + dim = Ms[0].ndim + for polyNum in range(len(Ms)): #Loop through the polynomials + allowedErrorIncrease = absApproxTol + errors[polyNum] * relApproxTol + #Use slicing to look at a slice of the highest degree in the dimension we want to trim + slices = [slice(None) for i in range(dim)] # equivalent to selecting everything + for currDim in range(dim): + slices[currDim] = -1 # Now look at just the last row of the current dimension's approximation + lastSum = np.sum(np.abs(Ms[polyNum][tuple(slices)])) + + # Iteratively eliminate the highest degree row of the current dimension if + # the sum of its approximation coefficients is of low error, but keep deg at least 2 + while lastSum < allowedErrorIncrease and Ms[polyNum].shape[currDim] > 3: + # Trim the polynomial + slices[currDim] = slice(None,-1) + Ms[polyNum] = Ms[polyNum][tuple(slices)] + # Update the remaining error increase allowed an the error of the approximation. + allowedErrorIncrease -= lastSum + errors[polyNum] += lastSum + # Reset for the next iteration with the next highest degree of the current dimension. + slices[currDim] = -1 + lastSum = np.sum(np.abs(Ms[polyNum][tuple(slices)])) + # Reset to select all of the current dimension when looking at the next dimension. + slices[currDim] = slice(None) + +def isExteriorInterval(originalInterval, trackedInterval): + """Determines if the current interval is exterior to its original interval.""" + return np.any(trackedInterval.getIntervalForCombining() == originalInterval.getIntervalForCombining()) + +# Edit Edit +def make_child_tasks(allMs, allErrors, allIntervals, parent_id=None, level=0): + return [ + SolveTask(newMs, newInt, newErrs, parent_id=parent_id, level=level) + for newMs, newErrs, newInt in zip(allMs, allErrors, allIntervals) + ] + +def solvePolySequential(Ms, trackedInterval, errors, solverOptions): + """ + Fully sequential solve. + + Use this inside workers when you do not want nested parallelism. + """ + localOptions = solverOptions.copy() + localOptions.allowParallel = False + return solvePolyRecursive( + Ms, + trackedInterval, + errors, + localOptions, + returnChildren=False + ) + +def _solve_one_level_worker(task, solverOptions): + """ + Worker for one unit of multilevel work. + + It solves one interval until either: + 1. it finishes, or + 2. it reaches subdivision and returns child tasks. + """ + localOptions = solverOptions.copy() + localOptions.allowParallel = False + localOptions.level = task.level + + return solvePolyRecursive( + task.Ms, + task.trackedInterval, + task.errors, + localOptions, + returnChildren=True + ) + +def finish_subdivision_state(state, childInterior, childExterior): + """ + Finish a parent interval after its children have completed. + + This contains the logic that used to happen immediately after the + recursive child calls returned. + """ + originalMs = state.originalMs + originalInterval = state.originalInterval + trackedInterval = state.trackedInterval + errors = state.errors + solverOptions = state.solverOptions + + resultInterior = list(childInterior) + resultExterior = list(childExterior) + + if state.isFinalStep: + resultsAll = resultInterior + resultExterior + + if len(resultsAll) == 0: + trackedInterval.possibleExtraRoot = True + + if isExteriorInterval(originalInterval, trackedInterval): + return [], [trackedInterval] + else: + return [trackedInterval], [] + + # Combine all roots that converged to the same point. + allFoundRoots = set() + tempResults = [] + + for result in resultsAll: + point = tuple(result.interval[:, 0]) + if point in allFoundRoots: + continue + allFoundRoots.add(point) + tempResults.append(result) + + for result in tempResults: + if len(result.possibleDuplicateRoots) > 0: + trackedInterval.possibleDuplicateRoots += result.possibleDuplicateRoots + else: + trackedInterval.possibleDuplicateRoots.append(result.getFinalPoint()) + + if isExteriorInterval(originalInterval, trackedInterval): + return [], [trackedInterval] + else: + return [trackedInterval], [] + + idx1 = 0 + idx2 = 1 + + for tempInterval in resultExterior: + tempInterval.reRun = False + + while idx1 < len(resultExterior): + while idx2 < len(resultExterior): + if resultExterior[idx1].overlapsWith(resultExterior[idx2]): + combinedInterval = originalInterval.copy() + + if combinedInterval.finalStep: + combinedInterval.interval = combinedInterval.preFinalInterval.copy() + combinedInterval.transforms = combinedInterval.preFinalTransforms.copy() + + newAs = np.min( + [ + resultExterior[idx1].getIntervalForCombining()[:, 0], + resultExterior[idx2].getIntervalForCombining()[:, 0] + ], + axis=0 + ) + + newBs = np.max( + [ + resultExterior[idx1].getIntervalForCombining()[:, 1], + resultExterior[idx2].getIntervalForCombining()[:, 1] + ], + axis=0 + ) + + final1 = resultExterior[idx1].getFinalInterval() + final2 = resultExterior[idx2].getFinalInterval() + + newAsFinal = np.min([final1[:, 0], final2[:, 0]], axis=0) + newBsFinal = np.max([final1[:, 1], final2[:, 1]], axis=0) + + oldAs = originalInterval.interval[:, 0] + oldBs = originalInterval.interval[:, 1] + oldAsFinal, oldBsFinal = originalInterval.getFinalInterval().T + + equalMask = oldBsFinal == oldAsFinal + oldBsFinal[equalMask] = oldBsFinal[equalMask] + 1 + + currSubinterval = ( + ( + 2 * np.array([newAsFinal, newBsFinal]) + - oldAsFinal + - oldBsFinal + ) + / (oldBsFinal - oldAsFinal) + ).T + + currSubinterval[equalMask, 0] = -1 + currSubinterval[equalMask, 1] = 1 + + currSubinterval[:, 0][oldAs == newAs] = -1 + currSubinterval[:, 1][oldBs == newBs] = 1 + + combinedInterval.addTransform(currSubinterval) + combinedInterval.interval = np.array([newAs, newBs]).T + combinedInterval.reRun = True + + del resultExterior[idx2] + del resultExterior[idx1] + + resultExterior.append(combinedInterval) + idx2 = idx1 + 1 + else: + idx2 += 1 + + idx1 += 1 + idx2 = idx1 + 1 + + # Rerun touching intervals. + newResultExterior = [] + + for tempInterval in resultExterior: + if tempInterval.reRun: + if np.all(tempInterval.interval == originalInterval.interval): + newResultExterior.append(tempInterval) + else: + tempMs, tempErrors = transformChebToInterval( + originalMs, + *tempInterval.getLastTransform(), + errors, + solverOptions.exact + ) + + tempResultsInterior, tempResultsExterior = solvePolySequential( + tempMs, + tempInterval, + tempErrors, + solverOptions + ) + + resultInterior += tempResultsInterior + newResultExterior += tempResultsExterior + + elif isExteriorInterval(originalInterval, tempInterval): + newResultExterior.append(tempInterval) + + else: + resultInterior.append(tempInterval) + + return resultInterior, newResultExterior + + +def solvePolyParallelMultilevel(Ms, trackedInterval, errors, solverOptions): + """ + Multilevel parallel driver. + + This is the only place where a process pool is created. + """ + max_workers = max(1, solverOptions.max_cpu) + + workerOptions = solverOptions.copy() + workerOptions.allowParallel = False + + next_parent_id = 0 + + pendingTasks = [SolveTask(Ms, trackedInterval, errors, parent_id=None)] + + futures = set() + + # parent_id -> bookkeeping + waitingParents = {} + + finalInterior = [] + finalExterior = [] + + def submit_task(executor, task): + return executor.submit(_solve_one_level_worker, task, workerOptions), task.parent_id + + def complete_result(result, parent_id): + """ + Handle a completed TaskResult. + + If parent_id is None, add directly to final result. + Otherwise, accumulate into the waiting parent. + """ + nonlocal next_parent_id + + # Case 1: the task finished normally. + if len(result.childTasks) == 0: + if parent_id is None: + finalInterior.extend(result.interior) + finalExterior.extend(result.exterior) + else: + parent = waitingParents[parent_id] + parent["interior"].extend(result.interior) + parent["exterior"].extend(result.exterior) + parent["remaining"] -= 1 + + return + + # Case 2: the task subdivided. + this_parent_id = next_parent_id + next_parent_id += 1 + + waitingParents[this_parent_id] = { + "state": result.subdivisionState, + "parent_id": parent_id, + "remaining": len(result.childTasks), + "interior": list(result.interior), + "exterior": list(result.exterior), + } + + for child in result.childTasks: + child.parent_id = this_parent_id + pendingTasks.append(child) + + def finish_ready_parents(): + """ + Some parent may become ready after its final child finishes. + + Finishing a parent produces normal interior/exterior results, + which then need to be passed upward to that parent's parent. + """ + changed = True + + while changed: + changed = False + + ready_ids = [ + parent_id + for parent_id, parent in waitingParents.items() + if parent["remaining"] == 0 + ] + + for parent_id in ready_ids: + parent = waitingParents.pop(parent_id) + + interior, exterior = finish_subdivision_state( + parent["state"], + parent["interior"], + parent["exterior"] + ) + + parent_result = TaskResult( + interior=interior, + exterior=exterior, + childTasks=[], + subdivisionState=None + ) + + complete_result(parent_result, parent["parent_id"]) + changed = True + + with ThreadPoolExecutor(max_workers=max_workers) as executor: + future_to_parent = {} + + # Fill pool initially. + while pendingTasks and len(futures) < max_workers: + task = pendingTasks.pop() + fut, parent_id = submit_task(executor, task) + futures.add(fut) + future_to_parent[fut] = parent_id + + while futures: + done, futures = wait(futures, return_when=FIRST_COMPLETED) + + for fut in done: + parent_id = future_to_parent.pop(fut) + result = fut.result() + + complete_result(result, parent_id) + finish_ready_parents() + + # Refill available worker slots. + while pendingTasks and len(futures) < max_workers: + task = pendingTasks.pop() + fut, parent_id = submit_task(executor, task) + futures.add(fut) + future_to_parent[fut] = parent_id + + # After all futures finish, make sure all parent continuations are finished. + finish_ready_parents() + + return finalInterior, finalExterior + + +def solvePolyRecursive(Ms, trackedInterval, errors, solverOptions, returnChildren=False): + """ + Recursively shrinks and subdivides the given interval to find the locations of all roots. + + When returnChildren=False: + behaves like the original sequential recursive function. + + When returnChildren=True: + solves until it reaches a subdivision point, then returns a TaskResult + containing child tasks instead of recursively solving those children. + """ + + if trackedInterval.isPoint(): + if returnChildren: + return TaskResult([], [trackedInterval], []) + return [], [trackedInterval] + + solverOptions = solverOptions.copy() + solverOptions.level += 1 + + # Constant term check. + if solverOptions.constant_check: + consts = np.array([M.ravel()[0] for M in Ms]) + err = np.array([np.sum(np.abs(M)) - abs(c) + e for M, e, c in zip(Ms, errors, consts)]) + + if np.any(np.abs(consts) > err): + if returnChildren: + return TaskResult([], [], []) + return [], [] + + # Quadratic check. + if (solverOptions.low_dim_quadratic_check and Ms[0].ndim <= 3) or solverOptions.all_dim_quadratic_check: + for i in range(len(Ms)): + if quadratic_check(Ms[i], errors[i]): + if returnChildren: + return TaskResult([], [], []) + return [], [] + + # Trim. + Ms = Ms.copy() + originalMs = Ms.copy() + trackedInterval = trackedInterval.copy() + errors = errors.copy() + + tolerable_error = max(errors) * 1e-3 + trimMs(Ms, errors) + + dim = Ms[0].ndim + changed = True + zoomCount = 0 + + originalInterval = trackedInterval.copy() + originalIntervalSize = trackedInterval.size() + + lastSizes = trackedInterval.dimSize() + + start_time = time() + + while changed and zoomCount <= solverOptions.maxZoomCount: + Ms, errors, trackedInterval, changed, should_stop = zoomInOnIntervalIter(Ms,errors,trackedInterval,solverOptions.exact) + + if trackedInterval.empty: + if returnChildren: + return TaskResult([], [], []) + return [], [] + + newSizes = trackedInterval.dimSize() + + if np.all(newSizes >= lastSizes / 2): + zoomCount += 1 + + lastSizes = newSizes + + finish_time = time() + + if should_stop: + if trackedInterval.finalStep or not solverOptions.useFinalStep: + if solverOptions.verbose: + print("*", end="") + + if isExteriorInterval(originalInterval, trackedInterval): + if returnChildren: + return TaskResult([], [trackedInterval], []) + return [], [trackedInterval] + else: + if returnChildren: + return TaskResult([trackedInterval], [], []) + return [trackedInterval], [] + + else: + trackedInterval.startFinalStep() + + if returnChildren and solverOptions.level < solverOptions.parallel_depth: + # Continue solving this same interval in the global scheduler. + child = SolveTask(Ms, trackedInterval, errors, level=solverOptions.level) + state = SubdivisionState( + originalMs=originalMs, + originalInterval=originalInterval, + trackedInterval=trackedInterval, + errors=errors, + solverOptions=solverOptions, + isFinalStep=False + ) + + return TaskResult(interior=[], exterior=[], childTasks=[child], subdivisionState=state) + + serialInterior, serialExterior = solvePolyRecursive(Ms, trackedInterval, errors, solverOptions, returnChildren=False) + + if returnChildren: + return TaskResult(interior=serialInterior, exterior=serialExterior, childTasks=[], subdivisionState=None) + + return serialInterior, serialExterior + + elif trackedInterval.finalStep: + trackedInterval.canThrowOutFinalStep = True + + resultInterior, resultExterior = [], [] + + allMs, allErrors, allIntervals = getSubdivisionIntervals( + Ms, + errors, + trackedInterval, + solverOptions.exact, + solverOptions.level + ) + + state = SubdivisionState( + originalMs=originalMs, + originalInterval=originalInterval, + trackedInterval=trackedInterval, + errors=errors, + solverOptions=solverOptions, + isFinalStep=True + ) + + childTasks = make_child_tasks( + allMs, allErrors, allIntervals, level=solverOptions.level + ) + + if returnChildren and solverOptions.level < solverOptions.parallel_depth: + return TaskResult( + interior=resultInterior, + exterior=resultExterior, + childTasks=childTasks, + subdivisionState=state + ) + + # Solve children serially in this worker/process. + for child in childTasks: + newInterior, newExterior = solvePolyRecursive( + child.Ms, + child.trackedInterval, + child.errors, + solverOptions, + returnChildren=False + ) + + resultInterior += newInterior + resultExterior += newExterior + + resultInterior, resultExterior = finish_subdivision_state( + state, resultInterior, resultExterior + ) + + if returnChildren: + return TaskResult( + interior=resultInterior, + exterior=resultExterior, + childTasks=[], + subdivisionState=None + ) + + return resultInterior, resultExterior + + else: + # Normal subdivision. + if solverOptions.level == 15: + warnings.warn( + "High subdivision depth!\n" + "Subdivision on the search interval has now reached " + "at least depth 15. Runtime may be prolonged." + ) + + elif solverOptions.level == 25: + warnings.warn( + "Extreme subdivision depth!\n" + "Subdivision on the search interval has now reached " + "at least depth 25, which is unusual. The solver may not finish running. " + "Ensure the input functions meet the requirements of being continuous, " + "smooth, and having only finitely many simple roots on the search interval." + ) + + resultInterior, resultExterior = [], [] + + allMs, allErrors, allIntervals = getSubdivisionIntervals( + Ms, + errors, + trackedInterval, + solverOptions.exact, + solverOptions.level + ) + + state = SubdivisionState( + originalMs=originalMs, + originalInterval=originalInterval, + trackedInterval=trackedInterval, + errors=errors, + solverOptions=solverOptions, + isFinalStep=False + ) + + childTasks = make_child_tasks( + allMs, allErrors, allIntervals, level=solverOptions.level + ) + + if returnChildren and solverOptions.level < solverOptions.parallel_depth: + return TaskResult( + interior=resultInterior, + exterior=resultExterior, + childTasks=childTasks, + subdivisionState=state + ) + + # Solve children serially in this worker/process. + for child in childTasks: + newInterior, newExterior = solvePolyRecursive( + child.Ms, + child.trackedInterval, + child.errors, + solverOptions, + returnChildren=False + ) + + resultInterior += newInterior + resultExterior += newExterior + + resultInterior, resultExterior = finish_subdivision_state( + state, resultInterior, resultExterior + ) + + if returnChildren: + return TaskResult( + interior=resultInterior, + exterior=resultExterior, + childTasks=[], + subdivisionState=None + ) + return resultInterior, resultExterior + + +def solvePoly(Ms, trackedInterval, errors, solverOptions): + """ + Recommended public entry point. + + Call this instead of calling solvePolyRecursive directly. + """ + if solverOptions.parallel_depth > 0 and solverOptions.max_cpu > 1: + return solvePolyParallelMultilevel( + Ms, + trackedInterval, + errors, + solverOptions + ) + + return solvePolyRecursive( + Ms, + trackedInterval, + errors, + solverOptions, + returnChildren=False + ) + +def solveChebyshevSubdivision(Ms, errors, verbose = False, returnBoundingBoxes = False, exact = False, constant_check = True, + low_dim_quadratic_check = True,all_dim_quadratic_check = False, max_cpu=1, parallel_depth=1): + """Initiates shrinking and subdivision recursion and returns the roots and bounding boxes. + + Parameters + ---------- + Ms : list of numpy arrays + The chebyshev approximations of the functions on the interval given to CombinedSolver + errors : numpy array + The max error of the chebyshev approximation from the function on the interval + verbose : bool + Defaults to False. Whether or not to output progress of solving to the terminal. + returnBoundingBoxes : bool (Optional) + Defaults to False. If True, returns the bounding boxes around each root as well as the roots. + exact : bool + Whether transformations should be done with higher precision to minimize error. + constant_check : bool + Defaults to True. Whether or not to run constant term check after each subdivision. + low_dim_quadratic_check : bool + Defaults to True. Whether or not to run quadratic check in dim 2, 3. + all_dim_quadratic_check : bool + Defaults to False. Whether or not to run quadratic check in dim >= 4. + + Returns + ------- + roots : list + The roots of the system of functions on the interval given to Combined Solver + boundingBoxes : list of numpy arrays (optional) + List of intervals for each root in which the root is bound to lie. + """ + #Assert that we have n nD polys + if np.any([M.ndim != len(Ms) for M in Ms]): + raise ValueError("Solver Takes in N polynomials of dimension N!") + if len(Ms) != len(errors): + raise ValueError("Ms and errors must be same length!") + + #Solve + originalInterval = TrackedInterval(np.array([[-1.,1.]]*Ms[0].ndim)) + solverOptions = SolverOptions() + solverOptions.verbose = verbose + solverOptions.exact = exact + solverOptions.constant_check = constant_check + solverOptions.low_dim_quadratic_check = low_dim_quadratic_check + solverOptions.all_dim_quadratic_check = all_dim_quadratic_check + solverOptions.useFinalStep = True + solverOptions.max_cpu=max_cpu-1 + solverOptions.parallel_depth=parallel_depth + + if verbose: + print("Finding roots...", end=' ') + b1, b2 = solvePoly(Ms, originalInterval, errors, solverOptions) + + boundingIntervals = b1 + b2 + roots = [] + hasDupRoots = False + hasExtraRoots = False + for interval in boundingIntervals: + #TODO: Figure out the best way to return the bounding intervals. + #Right now interval.finalInterval is the interval where we say the root is. + interval.getFinalInterval() + if interval.possibleExtraRoot: + hasExtraRoots = True + if len(interval.possibleDuplicateRoots) > 0: + roots += interval.possibleDuplicateRoots + hasDupRoots = True + else: + roots.append(interval.getFinalPoint()) + #Warn if extra or duplicate roots + if hasExtraRoots: + warnings.warn(f"Might Have Extra Roots! See Bounding Boxes for details!") + if hasDupRoots: + warnings.warn(f"Might Have Duplicate Roots! See Bounding Boxes for details!") + #Return + roots = np.array(roots) + if verbose: + finish_string = '\n' + f"Found {len(roots)} roots" + print((finish_string if len(roots) != 1 else finish_string[:-1]),end='\n\n') + if returnBoundingBoxes: + return roots, boundingIntervals + else: + return roots diff --git a/yroots/Combined_Solver.py b/yroots/Combined_Solver.py index fbc4f61e..2931dd94 100644 --- a/yroots/Combined_Solver.py +++ b/yroots/Combined_Solver.py @@ -2,12 +2,13 @@ from numba import njit import itertools import functools -import yroots.ChebyshevSubdivisionSolver as ChebyshevSubdivisionSolver +import yroots.ChebyshevSubdivisionSolverClaude as ChebyshevSubdivisionSolver import yroots.ChebyshevApproximator as ChebyshevApproximator from yroots.polynomial import MultiCheb,MultiPower from time import time -def solve(funcs,a=-1,b=1, verbose = False, returnBoundingBoxes = False, exact=False, minBoundingIntervalSize=1e-5, max_cpu=1): +def solve(funcs,a=-1,b=1, verbose = False, returnBoundingBoxes = False, exact=False, minBoundingIntervalSize=1e-5, max_cpu=1, + parallel_depth=1): """Finds and returns the roots of a system of functions on the search interval [a,b]. Generates an approximation for each function using Chebyshev polynomials on the interval given, @@ -143,7 +144,7 @@ def solve(funcs,a=-1,b=1, verbose = False, returnBoundingBoxes = False, exact=Fa #Solve the Chebyshev polynomial system yroots, boundingBoxes = ChebyshevSubdivisionSolver.solveChebyshevSubdivision(polys,errs,verbose,True,exact, - constant_check=True, low_dim_quadratic_check=True, all_dim_quadratic_check=False, max_cpu=max_cpu) + constant_check=True, low_dim_quadratic_check=True, all_dim_quadratic_check=False, max_cpu=max_cpu, parallel_depth=parallel_depth) #If the bounding box is the entire interval, subdivide it! usingSubdivision = np.all(b-a > minBoundingIntervalSize) @@ -160,7 +161,8 @@ def solve(funcs,a=-1,b=1, verbose = False, returnBoundingBoxes = False, exact=Fa #Solve recursively if verbose: print("Re-solving on:", newA, newB) - roots, boxes = solve(funcs, a=newA, b=newB, verbose=verbose, returnBoundingBoxes=True, exact=exact, minBoundingIntervalSize = minBoundingIntervalSize) + roots, boxes = solve(funcs, a=newA, b=newB, verbose=verbose, returnBoundingBoxes=True, exact=exact, minBoundingIntervalSize = minBoundingIntervalSize, + max_cpu=max_cpu, parallel_depth=parallel_depth) if len(roots) != 0: boundingBoxes.append(boxes) yroots.append(roots) @@ -187,7 +189,8 @@ def solve(funcs,a=-1,b=1, verbose = False, returnBoundingBoxes = False, exact=Fa #Re-solve this box if verbose: print("Re-solving on:", newA, newB) - roots, boxes = solve(funcs, a=newA, b=newB, verbose=verbose, returnBoundingBoxes=True, exact=exact, minBoundingIntervalSize = minBoundingIntervalSize) + roots, boxes = solve(funcs, a=newA, b=newB, verbose=verbose, returnBoundingBoxes=True, exact=exact, minBoundingIntervalSize=minBoundingIntervalSize, + max_cpu=max_cpu, parallel_depth=parallel_depth) if len(roots) > 0: finalRoots.append(roots) finalBoxes.append(boxes) From 4b1019e8bc4633c2d65fb48ab46d9ef1349b0b96 Mon Sep 17 00:00:00 2001 From: JarvisRAs Date: Fri, 22 May 2026 15:44:35 -0600 Subject: [PATCH 07/36] Moved general parallelization code --- yroots/ChebyshevSubdivisionSolver.py | 182 +- yroots/ChebyshevSubdivisionSolverClaude.py | 1911 -------------------- 2 files changed, 75 insertions(+), 2018 deletions(-) delete mode 100644 yroots/ChebyshevSubdivisionSolverClaude.py diff --git a/yroots/ChebyshevSubdivisionSolver.py b/yroots/ChebyshevSubdivisionSolver.py index d72ef6a3..fde0d8de 100644 --- a/yroots/ChebyshevSubdivisionSolver.py +++ b/yroots/ChebyshevSubdivisionSolver.py @@ -11,7 +11,7 @@ # Edit number 1 from dataclasses import dataclass -from concurrent.futures import ProcessPoolExecutor, wait, FIRST_COMPLETED +from concurrent.futures import ThreadPoolExecutor, wait, FIRST_COMPLETED from multiprocessing import Pool # Edit Edit @@ -21,6 +21,7 @@ class SolveTask: trackedInterval: object errors: object parent_id: int | None = None + level: int = 0 @dataclass class SubdivisionState: """ @@ -81,7 +82,10 @@ def __init__(self): # Parameters for parallelization self.max_cpu = 1 self.allowParallel = True - self.parallel_depth = 1 + # Subdivision depth below which child tasks are pushed to the process + # pool. Tasks at or beyond this depth solve their children serially in + # the worker, avoiding the scheduling overhead of tiny tasks. + self.parallel_depth = np.inf def copy(self): return copy.copy(self) #Return shallow copy, everything should be a basic type @@ -1219,9 +1223,9 @@ def isExteriorInterval(originalInterval, trackedInterval): return np.any(trackedInterval.getIntervalForCombining() == originalInterval.getIntervalForCombining()) # Edit Edit -def make_child_tasks(allMs, allErrors, allIntervals, parent_id=None): +def make_child_tasks(allMs, allErrors, allIntervals, parent_id=None, level=0): return [ - SolveTask(newMs, newInt, newErrs, parent_id=parent_id) + SolveTask(newMs, newInt, newErrs, parent_id=parent_id, level=level) for newMs, newErrs, newInt in zip(allMs, allErrors, allIntervals) ] @@ -1251,6 +1255,7 @@ def _solve_one_level_worker(task, solverOptions): """ localOptions = solverOptions.copy() localOptions.allowParallel = False + localOptions.level = task.level return solvePolyRecursive( task.Ms, @@ -1430,9 +1435,7 @@ def solvePolyParallelMultilevel(Ms, trackedInterval, errors, solverOptions): next_parent_id = 0 - pendingTasks = [ - SolveTask(Ms, trackedInterval, errors, parent_id=None) - ] + pendingTasks = [SolveTask(Ms, trackedInterval, errors, parent_id=None)] futures = set() @@ -1520,7 +1523,7 @@ def finish_ready_parents(): complete_result(parent_result, parent["parent_id"]) changed = True - with ProcessPoolExecutor(max_workers=max_workers) as executor: + with ThreadPoolExecutor(max_workers=max_workers) as executor: future_to_parent = {} # Fill pool initially. @@ -1576,10 +1579,7 @@ def solvePolyRecursive(Ms, trackedInterval, errors, solverOptions, returnChildre # Constant term check. if solverOptions.constant_check: consts = np.array([M.ravel()[0] for M in Ms]) - err = np.array([ - np.sum(np.abs(M)) - abs(c) + e - for M, e, c in zip(Ms, errors, consts) - ]) + err = np.array([np.sum(np.abs(M)) - abs(c) + e for M, e, c in zip(Ms, errors, consts)]) if np.any(np.abs(consts) > err): if returnChildren: @@ -1587,9 +1587,7 @@ def solvePolyRecursive(Ms, trackedInterval, errors, solverOptions, returnChildre return [], [] # Quadratic check. - if ( - solverOptions.low_dim_quadratic_check and Ms[0].ndim <= 3 - ) or solverOptions.all_dim_quadratic_check: + if (solverOptions.low_dim_quadratic_check and Ms[0].ndim <= 3) or solverOptions.all_dim_quadratic_check: for i in range(len(Ms)): if quadratic_check(Ms[i], errors[i]): if returnChildren: @@ -1617,12 +1615,7 @@ def solvePolyRecursive(Ms, trackedInterval, errors, solverOptions, returnChildre start_time = time() while changed and zoomCount <= solverOptions.maxZoomCount: - Ms, errors, trackedInterval, changed, should_stop = zoomInOnIntervalIter( - Ms, - errors, - trackedInterval, - solverOptions.exact - ) + Ms, errors, trackedInterval, changed, should_stop = zoomInOnIntervalIter(Ms,errors,trackedInterval,solverOptions.exact) if trackedInterval.empty: if returnChildren: @@ -1655,9 +1648,9 @@ def solvePolyRecursive(Ms, trackedInterval, errors, solverOptions, returnChildre else: trackedInterval.startFinalStep() - if returnChildren: + if returnChildren and solverOptions.level < solverOptions.parallel_depth: # Continue solving this same interval in the global scheduler. - child = SolveTask(Ms, trackedInterval, errors) + child = SolveTask(Ms, trackedInterval, errors, level=solverOptions.level) state = SubdivisionState( originalMs=originalMs, originalInterval=originalInterval, @@ -1667,20 +1660,14 @@ def solvePolyRecursive(Ms, trackedInterval, errors, solverOptions, returnChildre isFinalStep=False ) - return TaskResult( - interior=[], - exterior=[], - childTasks=[child], - subdivisionState=state - ) + return TaskResult(interior=[], exterior=[], childTasks=[child], subdivisionState=state) - return solvePolyRecursive( - Ms, - trackedInterval, - errors, - solverOptions, - returnChildren=False - ) + serialInterior, serialExterior = solvePolyRecursive(Ms, trackedInterval, errors, solverOptions, returnChildren=False) + + if returnChildren: + return TaskResult(interior=serialInterior, exterior=serialExterior, childTasks=[], subdivisionState=None) + + return serialInterior, serialExterior elif trackedInterval.finalStep: trackedInterval.canThrowOutFinalStep = True @@ -1695,18 +1682,20 @@ def solvePolyRecursive(Ms, trackedInterval, errors, solverOptions, returnChildre solverOptions.level ) - childTasks = make_child_tasks(allMs, allErrors, allIntervals) + state = SubdivisionState( + originalMs=originalMs, + originalInterval=originalInterval, + trackedInterval=trackedInterval, + errors=errors, + solverOptions=solverOptions, + isFinalStep=True + ) - if returnChildren: - state = SubdivisionState( - originalMs=originalMs, - originalInterval=originalInterval, - trackedInterval=trackedInterval, - errors=errors, - solverOptions=solverOptions, - isFinalStep=True - ) + childTasks = make_child_tasks( + allMs, allErrors, allIntervals, level=solverOptions.level + ) + if returnChildren and solverOptions.level < solverOptions.parallel_depth: return TaskResult( interior=resultInterior, exterior=resultExterior, @@ -1714,9 +1703,7 @@ def solvePolyRecursive(Ms, trackedInterval, errors, solverOptions, returnChildre subdivisionState=state ) - # Sequential fallback. - resultsAll = [] - + # Solve children serially in this worker/process. for child in childTasks: newInterior, newExterior = solvePolyRecursive( child.Ms, @@ -1729,40 +1716,19 @@ def solvePolyRecursive(Ms, trackedInterval, errors, solverOptions, returnChildre resultInterior += newInterior resultExterior += newExterior - resultsAll += newInterior - resultsAll += newExterior - - if len(resultsAll) == 0: - trackedInterval.possibleExtraRoot = True - - if isExteriorInterval(originalInterval, trackedInterval): - return [], [trackedInterval] - else: - return [trackedInterval], [] - - else: - allFoundRoots = set() - tempResults = [] - - for result in resultsAll: - point = tuple(result.interval[:, 0]) - - if point in allFoundRoots: - continue - - allFoundRoots.add(point) - tempResults.append(result) - - for result in tempResults: - if len(result.possibleDuplicateRoots) > 0: - trackedInterval.possibleDuplicateRoots += result.possibleDuplicateRoots - else: - trackedInterval.possibleDuplicateRoots.append(result.getFinalPoint()) + resultInterior, resultExterior = finish_subdivision_state( + state, resultInterior, resultExterior + ) - if isExteriorInterval(originalInterval, trackedInterval): - return [], [trackedInterval] - else: - return [trackedInterval], [] + if returnChildren: + return TaskResult( + interior=resultInterior, + exterior=resultExterior, + childTasks=[], + subdivisionState=None + ) + + return resultInterior, resultExterior else: # Normal subdivision. @@ -1792,18 +1758,20 @@ def solvePolyRecursive(Ms, trackedInterval, errors, solverOptions, returnChildre solverOptions.level ) - childTasks = make_child_tasks(allMs, allErrors, allIntervals) + state = SubdivisionState( + originalMs=originalMs, + originalInterval=originalInterval, + trackedInterval=trackedInterval, + errors=errors, + solverOptions=solverOptions, + isFinalStep=False + ) - if returnChildren: - state = SubdivisionState( - originalMs=originalMs, - originalInterval=originalInterval, - trackedInterval=trackedInterval, - errors=errors, - solverOptions=solverOptions, - isFinalStep=False - ) + childTasks = make_child_tasks( + allMs, allErrors, allIntervals, level=solverOptions.level + ) + if returnChildren and solverOptions.level < solverOptions.parallel_depth: return TaskResult( interior=resultInterior, exterior=resultExterior, @@ -1811,7 +1779,7 @@ def solvePolyRecursive(Ms, trackedInterval, errors, solverOptions, returnChildre subdivisionState=state ) - # Sequential fallback. + # Solve children serially in this worker/process. for child in childTasks: newInterior, newExterior = solvePolyRecursive( child.Ms, @@ -1824,19 +1792,19 @@ def solvePolyRecursive(Ms, trackedInterval, errors, solverOptions, returnChildre resultInterior += newInterior resultExterior += newExterior - return finish_subdivision_state( - SubdivisionState( - originalMs=originalMs, - originalInterval=originalInterval, - trackedInterval=trackedInterval, - errors=errors, - solverOptions=solverOptions, - isFinalStep=False - ), - resultInterior, - resultExterior + resultInterior, resultExterior = finish_subdivision_state( + state, resultInterior, resultExterior ) + if returnChildren: + return TaskResult( + interior=resultInterior, + exterior=resultExterior, + childTasks=[], + subdivisionState=None + ) + return resultInterior, resultExterior + def solvePoly(Ms, trackedInterval, errors, solverOptions): """ @@ -1860,8 +1828,8 @@ def solvePoly(Ms, trackedInterval, errors, solverOptions): returnChildren=False ) -def solveChebyshevSubdivision(Ms, errors, verbose=False, returnBoundingBoxes=False, exact=False, constant_check=True, - low_dim_quadratic_check=True, all_dim_quadratic_check=False, max_cpu=1, parallel_depth=1): +def solveChebyshevSubdivision(Ms, errors, verbose = False, returnBoundingBoxes = False, exact = False, constant_check = True, + low_dim_quadratic_check = True,all_dim_quadratic_check = False, max_cpu=1, parallel_depth=1): """Initiates shrinking and subdivision recursion and returns the roots and bounding boxes. Parameters @@ -1905,7 +1873,7 @@ def solveChebyshevSubdivision(Ms, errors, verbose=False, returnBoundingBoxes=Fal solverOptions.low_dim_quadratic_check = low_dim_quadratic_check solverOptions.all_dim_quadratic_check = all_dim_quadratic_check solverOptions.useFinalStep = True - solverOptions.max_cpu=max_cpu + solverOptions.max_cpu=max_cpu-1 solverOptions.parallel_depth=parallel_depth if verbose: diff --git a/yroots/ChebyshevSubdivisionSolverClaude.py b/yroots/ChebyshevSubdivisionSolverClaude.py deleted file mode 100644 index fde0d8de..00000000 --- a/yroots/ChebyshevSubdivisionSolverClaude.py +++ /dev/null @@ -1,1911 +0,0 @@ -import numpy as np -from numba import njit, float64 -from numba.types import UniTuple -from itertools import product -from scipy.spatial import HalfspaceIntersection, QhullError -from scipy.optimize import linprog -from yroots.QuadraticCheck import quadratic_check -from time import time -import copy -import warnings - -# Edit number 1 -from dataclasses import dataclass -from concurrent.futures import ThreadPoolExecutor, wait, FIRST_COMPLETED -from multiprocessing import Pool - -# Edit Edit -@dataclass -class SolveTask: - Ms: object - trackedInterval: object - errors: object - parent_id: int | None = None - level: int = 0 -@dataclass -class SubdivisionState: - """ - Stores the information needed to finish a parent interval - after all of its children have completed. - """ - originalMs: object - originalInterval: object - trackedInterval: object - errors: object - solverOptions: object - isFinalStep: bool -@dataclass -class TaskResult: - """ - If childTasks is empty, this task is finished. - - If childTasks is nonempty, this task subdivided and needs the - driver to solve children before finishing the parent. - """ - interior: list - exterior: list - childTasks: list - subdivisionState: SubdivisionState | None = None -# End Edit - -class SolverOptions(): - """Settings for running interval checks, transformations, and subdivision in solvePolyRecursive. - - Parameters - ---------- - verbose : bool - Defaults to False. Whether or not to output progress of solving to the terminal. - exact : bool - Defaults to False. Whether the transformation in TransformChebInPlaceND should minimize error. - constant_check : bool - Defaults to True. Whether or not to run constant term check after each subdivision. - low_dim_quadratic_check : bool - Defaults to True. Whether or not to run quadratic check in dim 2, 3. - all_dim_quadratic_check : bool - Defaults to False. Whether or not to run quadratic check in dim >= 4. - maxZoomCount : int - Maximum number of zooms allowed before subdividing (prevents infinite infintesimal shrinking) - level : int - Depth of subdivision for the given interval. - """ - def __init__(self): - #Init all the Options to default value - self.verbose = False - self.exact = False - self.constant_check = True - self.low_dim_quadratic_check = True - self.all_dim_quadratic_check = False - self.maxZoomCount = 25 - self.level = 0 - - # Edit number 2 - # Parameters for parallelization - self.max_cpu = 1 - self.allowParallel = True - # Subdivision depth below which child tasks are pushed to the process - # pool. Tasks at or beyond this depth solve their children serially in - # the worker, avoiding the scheduling overhead of tiny tasks. - self.parallel_depth = np.inf - - def copy(self): - return copy.copy(self) #Return shallow copy, everything should be a basic type - -@njit -def TransformChebInPlace1D(coeffs, alpha, beta): - """Applies the transformation alpha*x + beta to one dimension of a Chebyshev approximation. - - Recursively finds each column of the transformation matrix C from the previous two columns - and then performs entrywise matrix multiplication for each entry of the column, thus enabling - the transformation to occur while only retaining three columns of C in memory at a time. - - Parameters - ---------- - coeffs : numpy array - The coefficient array - alpha : double - The scaler of the transformation - beta : double - The shifting of the transformation - - Returns - ------- - transformedCoeffs : numpy array - The new coefficient array following the transformation - """ - transformedCoeffs = np.zeros_like(coeffs) - - #Initialize three arrays to represent subsequent columns of the transformation matrix. - arr1 = np.zeros(len(coeffs)) - arr2 = np.zeros(len(coeffs)) - arr3 = np.zeros(len(coeffs)) - - #The first column of the transformation matrix C. Since T_0(alpha*x + beta) = T_0(x) = 1 has 1 in the top entry and 0's elsewhere. - arr1[0] = 1. - transformedCoeffs[0] = coeffs[0] # arr1[0] * coeffs[0] (matrix multiplication step) - #The second column of C. Note that T_1(alpha*x + beta) = alpha*T_1(x) + beta*T_0(x). - arr2[0] = beta - arr2[1] = alpha - transformedCoeffs[0] += beta * coeffs[1] # arr2[0] * coeffs[1] (matrix muliplication) - transformedCoeffs[1] += alpha * coeffs[1] # arr2[1] * coeffs[1] (matrix multiplication) - - maxRow = 2 - for col in range(2, len(coeffs)): # For each column, calculate each entry and do matrix mult - thisCoeff = coeffs[col] # the row of coeffs corresponding to the column col of C (for matrix mult) - # The first entry - arr3[0] = -arr1[0] + alpha*arr2[1] + 2*beta*arr2[0] - transformedCoeffs[0] += thisCoeff * arr3[0] - - # The second entry - if maxRow > 2: - arr3[1] = -arr1[1] + alpha*(2*arr2[0] + arr2[2]) + 2*beta*arr2[1] - transformedCoeffs[1] += thisCoeff * arr3[1] - - # All middle entries - for i in range(2, maxRow - 1): - arr3[i] = -arr1[i] + alpha*(arr2[i-1] + arr2[i+1]) + 2*beta*arr2[i] - transformedCoeffs[i] += thisCoeff * arr3[i] - - # The second to last entry - i = maxRow - 1 - arr3[i] = -arr1[i] + (2 if i == 1 else 1)*alpha*(arr2[i-1]) + 2*beta*arr2[i] - transformedCoeffs[i] += thisCoeff * arr3[i] - - #The last entry - finalVal = alpha*arr2[i] - # This final entry is typically very small. If it is essentially machine epsilon, - # zero it out to save calculations. - if abs(finalVal) > 1e-16: #TODO: Justify this val! - arr3[maxRow] = finalVal - transformedCoeffs[maxRow] += thisCoeff * finalVal - maxRow += 1 # Next column will have one more entry than the current column. - - # Save the values of arr2 and arr3 to arr1 and arr2 to get ready for calculating the next column. - arr = arr1 - arr1 = arr2 - arr2 = arr3 - arr3 = arr - # - return transformedCoeffs[:maxRow] - -@njit -def TransformChebInPlace1DErrorFree(coeffs, alpha, beta): - """Applies the transformation alpha*x + beta to the Chebyshev polynomial coeffs with minimal error. - - This function is identical to TransformChebInPlace1D except that this function is more careful to - minimize error by calling on functions to more precisely perform the multiplication and addition. - - Parameters - ---------- - coeffs : numpy array - The coefficient array - alpha : double - The scaler of the transformation - beta : double - The shifting of the transformation - - Returns - ------- - coeffs : numpy array - The new coefficient array following the transformation - """ - if alpha == 0.5 and abs(beta) == 0.5: - return TransformChebInPlace1DErrorFreeSplit(coeffs, np.sign(beta)) - transformedCoeffs = np.zeros_like(coeffs) - arr1 = np.zeros(len(coeffs)) - arr2 = np.zeros(len(coeffs)) - arr3 = np.zeros(len(coeffs)) - arr1E = np.zeros(len(coeffs)) - arr2E = np.zeros(len(coeffs)) - arr3E = np.zeros(len(coeffs)) - - alpha1,alpha2 = Split(alpha) - beta1,beta2 = Split(beta) - - #The first array - arr1[0] = 1. - transformedCoeffs[0] = coeffs[0] - #The second array - arr2[0] = beta - arr2[1] = alpha - transformedCoeffs[0] += beta * coeffs[1] - transformedCoeffs[1] += alpha * coeffs[1] - #Loop - maxRow = 2 - for col in range(2, len(coeffs)): - thisCoeff = coeffs[col] - - #Get the next arr from arr1 and arr2 - - #The 0 spot - # Calculate and store arr3[0] = -arr1[0] + alpha*arr2[1] + 2*beta*arr2[0] - V1, E1 = TwoProdWithSplit(beta, 2*arr2[0], beta1, beta2) - V2, E2 = TwoProdWithSplit(alpha, arr2[1], alpha1, alpha2) - V3, E3 = TwoSum(V1, V2) - V4, E4 = TwoSum(V3, -arr1[0]) - arr3[0] = V4 - # Now sum the error associated with this calculation and add it to the calculated value, - # then perform the matrix multiplication associated with this entry. - arr3E[0] = -arr1E[0] + alpha*arr2E[1] + 2*beta*arr2E[0] + E1 + E2 + E3 + E4 - transformedCoeffs[0] += thisCoeff * (arr3[0] + arr3E[0]) - - # The procedure associated with minimizing error is the same for subsequent spots. - #The 1 spot - if maxRow > 2: - #arr3[1] = -arr1[1] + alpha*(2*arr2[0] + arr2[2]) + 2*beta*arr2[1] - V1, E1 = TwoSum(2*arr2[0], arr2[2]) - V2, E2 = TwoProdWithSplit(beta, 2*arr2[1], beta1, beta2) - V3, E3 = TwoProdWithSplit(alpha, V1, alpha1, alpha2) - V4, E4 = TwoSum(V2, V3) - V5, E5 = TwoSum(V4, -arr1[1]) - arr3[1] = V5 - arr3E[1] = -arr1E[1] + alpha*(2*arr2E[0] + arr2E[2] + E1) + 2*beta*arr2E[1] + E2 + E3 + E4 + E5 - transformedCoeffs[1] += thisCoeff * (arr3[1] + arr3E[1]) - - #The middle spots - for i in range(2, maxRow - 1): - #arr3[i] = -arr1[i] + alpha*(arr2[i-1] + arr2[i+1]) + 2*beta*arr2[i] - V1, E1 = TwoSum(arr2[i-1], arr2[i+1]) - V2, E2 = TwoProdWithSplit(beta, 2*arr2[i], beta1, beta2) - V3, E3 = TwoProdWithSplit(alpha, V1, alpha1, alpha2) - V4, E4 = TwoSum(V2, V3) - V5, E5 = TwoSum(V4, -arr1[i]) - arr3[i] = V5 - arr3E[i] = -arr1E[i] + alpha*(arr2E[i-1] + arr2E[i+1] + E1) + 2*beta*arr2E[i] + E2 + E3 + E4 + E5 - transformedCoeffs[i] += thisCoeff * (arr3[i] + arr3E[i]) - - #The second to last spot - i = maxRow - 1 - C1 = (2 if i == 1 else 1) - #arr3[i] = -arr1[i] + C1*alpha*(arr2[i-1]) + 2*beta*arr2[i] - V1, E1 = TwoProdWithSplit(beta, 2*arr2[i], beta1, beta2) - V2, E2 = TwoProdWithSplit(alpha, C1*arr2[i-1], alpha1, alpha2) - V3, E3 = TwoSum(V1, V2) - V4, E4 = TwoSum(V3, -arr1[i]) - arr3[i] = V4 - arr3E[i] = -arr1E[i] + C1*alpha*arr2E[i-1] + 2*beta*arr2E[i] + E1 + E2 + E3 + E4 - transformedCoeffs[i] += thisCoeff * (arr3[i] + arr3E[i]) - - #The last spot - #finalVal = alpha*arr2[i] - finalVal, finalValE = TwoProdWithSplit(alpha, arr2[i], alpha1, alpha2) - arr3E[maxRow] = finalValE + alpha * arr2E[i] - arr3[maxRow] = finalVal - transformedCoeffs[maxRow] += thisCoeff * (arr3[maxRow] + arr3E[maxRow]) - if abs(arr3[maxRow] + arr3E[maxRow]) > 1e-32: #TODO: Justify this val! - maxRow += 1 - - #Rotate the vectors - arr = arr1 - arr1 = arr2 - arr2 = arr3 - arr3 = arr - arr = arr1E - arr1E = arr2E - arr2E = arr3E - arr3E = arr - return transformedCoeffs[:maxRow] - -@njit -def TransformChebInPlace1DErrorFreeSplit(coeffs, betaSign): - """Applies the transformation 0.5*x +- 0.5 to the Chebyshev polynomial coeffs with minimal error. - - This function is a special case of TransformChebInPlace1DErrorFree used to minimize computation - when alpha = 0.5 and beta = +- 0.5 - - Parameters - ---------- - coeffs : numpy array - The coefficient array - betaSign : int - 1 if beta = 0.5; -1 if beta is -0.5 - - Returns - ------- - coeffs : numpy array - The new coefficient array following the transformation - - """ - transformedCoeffs = np.zeros_like(coeffs) - arr1 = np.zeros(len(coeffs)) - arr2 = np.zeros(len(coeffs)) - arr3 = np.zeros(len(coeffs)) - arr1E = np.zeros(len(coeffs)) - arr2E = np.zeros(len(coeffs)) - arr3E = np.zeros(len(coeffs)) - - #The first array - arr1[0] = 1. - transformedCoeffs[0] = coeffs[0] - #The second array - arr2[0] = betaSign*0.5 - arr2[1] = 0.5 - transformedCoeffs[0] += betaSign*coeffs[1]/2 - transformedCoeffs[1] += coeffs[1]/2 - #Loop - maxRow = 2 - for col in range(2, len(coeffs)): - thisCoeff = coeffs[col] - #Get the next arr from arr1 and arr2 - - #The 0 spot - #arr3[0] = -arr1[0] + alpha*arr2[1] + 2*beta*arr2[0] - V1, E1 = TwoSum(arr2[1]/2, betaSign*arr2[0]) - V2, E2 = TwoSum(V1, -arr1[0]) - arr3[0] = V2 - arr3E[0] = -arr1E[0] + arr2E[1]/2 + betaSign*arr2E[0] + E1 + E2 - transformedCoeffs[0] += thisCoeff * (arr3[0] + arr3E[0]) - - #The 1 spot - if maxRow > 2: - #arr3[1] = -arr1[1] + alpha*(2*arr2[0] + arr2[2]) + 2*beta*arr2[1] - V1, E1 = TwoSum(arr2[0], arr2[2]/2) - V2, E2 = TwoSum(V1, betaSign*arr2[1]) - V3, E3 = TwoSum(V2, -arr1[1]) - arr3[1] = V3 - arr3E[1] = -arr1E[1] + arr2E[0] + arr2E[2]/2 + betaSign*arr2E[1] + E1 + E2 + E3 - transformedCoeffs[1] += thisCoeff * (arr3[1] + arr3E[1]) - - #The middle spots - for i in range(2, maxRow - 1): - #arr3[i] = -arr1[i] + alpha*(arr2[i-1] + arr2[i+1]) + 2*beta*arr2[i] - V1, E1 = TwoSum(arr2[i-1], arr2[i+1]) - V2, E2 = TwoSum(V1/2, betaSign*arr2[i]) - V3, E3 = TwoSum(V2, -arr1[i]) - arr3[i] = V3 - arr3E[i] = -arr1E[i] + (arr2E[i-1] + arr2E[i+1] + E1)/2 + betaSign*arr2E[i] + E2 + E3 - transformedCoeffs[i] += thisCoeff * (arr3[i] + arr3E[i]) - - #The second to last spot - i = maxRow - 1 - C1 = (1 if i == 1 else 0.5) - #arr3[i] = -arr1[i] + C1*alpha*(arr2[i-1]) + 2*beta*arr2[i] - V1, E1 = TwoSum(C1*arr2[i-1], betaSign*arr2[i]) - V2, E2 = TwoSum(V1, -arr1[i]) - arr3[i] = V2 - arr3E[i] = -arr1E[i] + C1*arr2E[i-1] + betaSign*arr2E[i] + E1 + E2 - transformedCoeffs[i] += thisCoeff * (arr3[i] + arr3E[i]) - - #The last spot - #finalVal = alpha*arr2[i] - arr3[maxRow] = arr2[i]/2 - arr3E[maxRow] = arr2E[i] / 2 - transformedCoeffs[maxRow] += thisCoeff * (arr3[maxRow] + arr3E[maxRow]) - if abs(arr3[maxRow] + arr3E[maxRow]) > 1e-32: #TODO: Justify this val! - maxRow += 1 - - #Rotate the vectors - arr = arr1 - arr1 = arr2 - arr2 = arr3 - arr3 = arr - arr = arr1E - arr1E = arr2E - arr2E = arr3E - arr3E = arr - return transformedCoeffs[:maxRow] - -def TransformChebInPlaceND(coeffs, dim, alpha, beta, exact): - """Transforms a single dimension of a Chebyshev approximation for a polynomial. - - Parameters - ---------- - coeffs : numpy array - The coefficient tensor to transform - dim : int - The index of the dimension to transform - alpha: double - The scaler of the transformation - beta: double - The shifting of the transformation - exact: bool - Whether to perform the transformation with higher precision to minimize error - - Returns - ------- - transformedCoeffs : numpy array - The new coefficient array following the transformation - """ - - #TODO: Could we calculate the allowed error beforehand and pass it in here? - #TODO: Make this work for the power basis polynomials - if (alpha == 1.0 and beta == 0.0) or coeffs.shape[dim] == 1: - return coeffs # No need to transform if the degree of dim is 0 or transformation is the identity. - TransformFunc = TransformChebInPlace1DErrorFree if exact else TransformChebInPlace1D - if dim == 0: - return TransformFunc(coeffs, alpha, beta) - else: # Need to transpose the matrix to line up the multiplication for the current dim - # Move the current dimension to the dim 0 spot in the np array. - order = np.array([dim] + [i for i in range(dim)] + [i for i in range(dim+1, coeffs.ndim)]) - # Then transpose with the inverted order after the transformation occurs. - backOrder = np.zeros(coeffs.ndim, dtype = int) - backOrder[order] = np.arange(coeffs.ndim) - return TransformFunc(coeffs.transpose(order), alpha, beta).transpose(backOrder) - -class TrackedInterval: - """Tracks the properties of and changes to each interval as it passes through the solver. - - Parameters - ---------- - topInterval: numpy array - The original interval before any changes - interval: numpy array - The current interval (lower bound and upper bound for each dimension in order) - transforms: list - List of the alpha and beta values for all the transformations the interval has undergone - ndim: int - The number of dimensions of which the interval consists - empty: bool - Whether the interval is known to contain no roots - finalStep: bool - Whether the interval is in the final step (zooming in on the bounding box to a point at the end) - canThrowOutFinalStep: bool - Defaults to False. Whether or not the interval should be thrown out if empty in the final step - of solving. Changed to True if subdivision occurs in the final step. - possibleDuplicateRoots: list - Any multiple roots found through subdivision in the final step that would have been - returned as just one root before the final step - possibleExtraRoot: bool - Defaults to False. Whether or not the interval would have been thrown out during the final step. - nextTransformPoints: numpy array - Where the midpoint of the next subdivision should be for each dimension - """ - def __init__(self, interval): - self.topInterval = interval - self.interval = interval - self.transforms = [] - self.ndim = len(self.interval) - self.empty = False - self.finalStep = False - self.canThrowOutFinalStep = False - self.possibleDuplicateRoots = [] - self.possibleExtraRoot = False - self.nextTransformPoints = np.array([0.0394555475981047]*self.ndim) #Random Point near 0 - - def canThrowOut(self): - """Ensures that an interval that has not subdivided cannot be thrown out on the final step.""" - return not self.finalStep or self.canThrowOutFinalStep - - def addTransform(self, subInterval): - """Adds the next alpha and beta values to the list transforms and updates the current interval. - - Parameters: - ----------- - subInterval : numpy array - The subinterval to which the current interval is being reduced - """ - #Ensure the interval has non zero size; mark it empty if it doesn't - if np.any(subInterval[:,0] > subInterval[:,1]) and self.canThrowOut(): - self.empty = True - return - elif np.any(subInterval[:,0] > subInterval[:,1]): - #If we can't throw the interval out, it should be bounded by [-1,1]. - subInterval[:,0] = np.minimum(subInterval[:,0], np.ones_like(subInterval[:,0])) - subInterval[:,0] = np.maximum(subInterval[:,0], -np.ones_like(subInterval[:,0])) - subInterval[:,1] = np.minimum(subInterval[:,1], np.ones_like(subInterval[:,0])) - subInterval[:,1] = np.maximum(subInterval[:,1], subInterval[:,0]) - # Get the alpha and beta associated with the transformation in each dimension - a1,b1 = subInterval.T # all the lower bounds and upper bounds of the new interval, respectively - a2,b2 = self.interval.T # all the lower bounds and upper bounds of the original interval - alpha1, beta1 = (b1-a1)/2, (b1+a1)/2 - alpha2, beta2 = (b2-a2)/2, (b2+a2)/2 - self.transforms.append(np.array([alpha1, beta1])) - #Update the lower and upper bounds of the current interval - for dim in range(self.ndim): - for i in range(2): - x = subInterval[dim][i] - #Be exact if x = +-1 - if x == -1.0: - self.interval[dim][i] = self.interval[dim][0] - elif x == 1.0: - self.interval[dim][i] = self.interval[dim][1] - else: - self.interval[dim][i] = alpha2[dim]*x+beta2[dim] - - def getLastTransform(self): - """Gets the alpha and beta values of the last transformation the interval underwent.""" - return self.transforms[-1] - - def getFinalInterval(self): - """Finds the interval that should be reported as containing a root. - - The final interval is calculated by applying all of the recorded transformations that - occurred before the final step to topInterval, the original interval. - - Returns - ------- - finalInterval: numpy array - The final interval to be reported as containing a root - """ - # TODO: Make this a seperate function so it can use njit. - # Make these _NoNumba calls use floats so they call call the numba functions without a seperate compile - finalInterval = self.topInterval.T - finalIntervalError = np.zeros_like(finalInterval) - transformsToUse = self.transforms if not self.finalStep else self.preFinalTransforms - for alpha,beta in transformsToUse[::-1]: # Iteratively apply each saved transform - finalInterval, temp = TwoProd_NoNumba(finalInterval, alpha) - finalIntervalError = alpha * finalIntervalError + temp - finalInterval, temp = TwoSum_NoNumba(finalInterval,beta) - finalIntervalError += temp - - finalInterval = finalInterval.T - finalIntervalError = finalIntervalError.T - self.finalInterval = finalInterval + finalIntervalError # Add the error and save the result. - self.finalAlpha, alphaError = TwoSum_NoNumba(-finalInterval[:,0]/2,finalInterval[:,1]/2) - self.finalAlpha += alphaError + (finalIntervalError[:,1] - finalIntervalError[:,0])/2 - self.finalBeta, betaError = TwoSum_NoNumba(finalInterval[:,0]/2,finalInterval[:,1]/2) - self.finalBeta += betaError + (finalIntervalError[:,1] + finalIntervalError[:,0])/2 - return self.finalInterval - - def getFinalPoint(self): - """Finds the point that should be reported as the root (midpoint of the final step interval). - - Returns - ------- - root: numpy array - The final point to be reported as the root of the interval - """ - #TODO: Make this a seperate function so it can use njit. - #Make these _NoNumba calls use floats so they call call the numba functions without a seperate compile - if not self.finalStep: #If no final step, use the midpoint of the calculated final interval. - self.root = (self.finalInterval[:,0] + self.finalInterval[:,1]) / 2 - else: #If using the final step, recalculate the final interval using post-final transforms. - finalInterval = self.topInterval.T - finalIntervalError = np.zeros_like(finalInterval) - transformsToUse = self.transforms - for alpha,beta in transformsToUse[::-1]: - finalInterval, temp = TwoProd_NoNumba(finalInterval, alpha) - finalIntervalError = alpha * finalIntervalError + temp - finalInterval, temp = TwoSum_NoNumba(finalInterval,beta) - finalIntervalError += temp - finalInterval = finalInterval.T + finalIntervalError.T - self.root = (finalInterval[:,0] + finalInterval[:,1]) / 2 # Return the midpoint - return self.root - - def size(self): - """Gets the volume of the current interval.""" - return np.prod(self.interval[:,1] - self.interval[:,0]) - - def dimSize(self): - """Gets the lengths along each dimension of the current interval.""" - return self.interval[:,1] - self.interval[:,0] - - def finalDimSize(self): - """Gets the lengths along each dimension of the final interval.""" - return self.finalInterval[:,1] - self.finalInterval[:,0] - - def copy(self): - """Returns a deep copy of the current interval with all changes and properties preserved.""" - newone = TrackedInterval(self.topInterval) - newone.interval = self.interval.copy() - newone.transforms = self.transforms.copy() - newone.empty = self.empty - newone.nextTransformPoints = self.nextTransformPoints.copy() - if self.finalStep: - newone.finalStep = True - newone.canThrowOutFinalStep = self.canThrowOutFinalStep - newone.possibleDuplicateRoots = self.possibleDuplicateRoots.copy() - newone.possibleExtraRoot = self.possibleExtraRoot - newone.preFinalInterval = self.preFinalInterval.copy() - newone.preFinalTransforms = self.preFinalTransforms.copy() - return newone - - def __contains__(self, point): - """Determines if point is contained in the current interval.""" - return np.all(point >= self.interval[:,0]) and np.all(point <= self.interval[:,1]) - - def overlapsWith(self, otherInterval): - """Determines if the otherInterval overlaps with the current interval. - - Returns True if the lower bound of one interval is less than the upper bound of the other - in EVERY dimension; returns False otherwise.""" - for (a1,b1),(a2,b2) in zip(self.getIntervalForCombining(), otherInterval.getIntervalForCombining()): - if a1 > b2 or a2 > b1: - return False - return True - - def isPoint(self): - """Determines if the current interval has essentially length 0 in each dimension.""" - return np.all(np.abs(self.interval[:,0] - self.interval[:,1]) < 1e-32) - - def startFinalStep(self): - """Prepares for the final step by saving the current interval and its transform list.""" - self.finalStep = True - self.preFinalInterval = self.interval.copy() - self.preFinalTransforms = self.transforms.copy() - - def getIntervalForCombining(self): - """Returns the interval to be used in combining intervals to report at the end.""" - return self.preFinalInterval if self.finalStep else self.interval - - def __repr__(self): - return str(self) - - def __str__(self): - return str(self.interval) - -def getLinearTerms(M): - """Gets the linear terms of the Chebyshev coefficient tensor M. - - Uses the fact that the linear terms are located at - M[(0,0, ... ,0,1)] - M[(0,0, ... ,1,0)] - ... - M[(0,1, ... ,0,0)] - M[(1,0, ... ,0,0)] - which are indexes - 1, M.shape[-1], M.shape[-1]*M.shape[-2], ... when looking at M.ravel(). - - Parameters - ---------- - M : numpy array - The coefficient array to get the linear terms from - - Returns - ------- - A: numpy array - An array with the linear terms of M - """ - A = [] - spot = 1 - for i in M.shape[::-1]: - A.append(0 if i == 1 else M.ravel()[spot]) - spot *= i - return A[::-1] # Return linear terms in dimension order. - - -@njit -def linearCheck1(totalErrs, A, consts): - """Takes A, the linear terms of each function approximation, and makes any possible reduction - in the interval based on the totalErrs.""" - dim = len(A) - a = -np.ones(dim) * np.inf - b = np.ones(dim) * np.inf - for row in range(dim): - for col in range(dim): - if A[row,col] != 0: #Don't bother running the check if the linear term is too small. - v1 = totalErrs[row] / abs(A[row,col]) - 1 - v2 = 2 * consts[row] / A[row,col] - if v2 >= 0: - a_, b_ = -v1, v1-v2 - else: - a_, b_ = -v2-v1, v1 - a[col] = max(a[col], a_) - b[col] = min(b[col], b_) - return a, b - -def BoundingIntervalLinearSystem(Ms, errors, finalStep, macheps = 2**-52): - """Finds a smaller region in which any root must be. - - Parameters - ---------- - Ms : list of numpy arrays - Each numpy array is the coefficient tensor of a chebyshev polynomials - errors : iterable of floats - The maximum error of chebyshev approximations - finalStep : bool - Whether we are in the final step of the algorithm - - Returns - ------- - newInterval : numpy array - The smaller interval where any root must be - changed : bool - Whether the interval has shrunk at all - should_stop : bool - Whether we should stop subdividing - throwout : - Whether we should throw out the interval entirely - """ - if finalStep: - errors = np.zeros_like(errors) - - dim = Ms[0].ndim - #Some constants we use here - minZoomForChange = 0.99 #If the volume doesn't shrink by this amount say that it hasn't changed - minZoomForBaseCaseEnd = 0.4**dim #If the volume doesn't change by at least this amount when running with no error, stop - #Get the matrix of the linear terms - A = np.array([getLinearTerms(M) for M in Ms]) - #Get the Vector of the constant terms - consts = np.array([M.ravel()[0] for M in Ms]) - #Get the Error of everything else combined. - totalErrs = np.array([np.sum(np.abs(M)) + e for M,e in zip(Ms, errors)]) - linear_sums = np.sum(np.abs(A),axis=1) - err = np.array([tE-abs(c)-l for tE,c,l in zip(totalErrs,consts,linear_sums)]) - - #Scale all the polynomials relative to one another - errors = errors.copy() - for i in range(dim): - scaleVal = np.max(np.abs(A[i])) - if scaleVal > 0: - s = 2.**int(np.floor(np.log2(abs(scaleVal)))) - A[i] /= s - consts[i] /= s - totalErrs[i] /= s - linear_sums[i] /= s - err[i] /= s - errors[i] /= s - #Precondition the columns. (AP)X = B -> A(PX) = B. So scale columns, solve, then scale the solution. - colScaler = np.ones(dim) - for i in range(dim): - scaleVal = np.max(np.abs(A[:,i])) - if scaleVal > 0: - s = 2**(-np.floor(np.log2(abs(scaleVal)))) - colScaler[i] = s - totalErrs += np.abs(A[:,i]) * (s - 1) - A[:,i] *= s - - #Run linear algorithm for shrinking or deciding whether to subdivide. - #This loop will only execute the second time if the interval was not changed on the first iteration and it needs to run again with tighter errors - #Calculate the SVD outside of the for loop because it doesn't change - U, S, Vh = np.linalg.svd(A) - condNum = S[-1]/S[0] - wellConditioned = S[0] > 0 and condNum > 1e-10 - #Add this width to the new intervals we find to avoid rounding error throwing out roots - widthToAdd = max(condNum,2)*macheps - Ainv = (1/S * Vh.T) @ U.T - center = -Ainv@consts - #Use the first interval shrinking method - a_init, b_init = linearCheck1(totalErrs, A, consts) - for i in range(2): - a = a_init - b = b_init - #We use the matrix inverse to find the width, so might as well use it both spots. Should be fine as dim is small. - if wellConditioned: #Make sure conditioning is ok. - #Ainv transforms the hyperrectangle of side lengths err into a parallelogram with these as the principal direction - #So summing over them gets the farthest the parallelogram can reach in each dimension. - width = np.sum(np.abs(Ainv*err),axis=1) - #Bound with previous result - a = np.maximum(center - width, a) - b = np.minimum(center + width, b) - #Undo the column preconditioning - a *= colScaler - b *= colScaler - #Add error and bound - a -= widthToAdd - b += widthToAdd - if np.any(a > b): - with open("num_of_times","a") as file: - file.write("1\n") - throwOut = np.any(a > b) or np.any(a > 1) or np.any(b < -1) - a[a < -1] = -1 - b[b < -1] = -1 - a[a > 1] = 1 - b[b > 1] = 1 - - forceShouldStop = finalStep and not wellConditioned - # Calculate the "changed" variable - newRatio = np.prod(b - a) / 2**dim - if throwOut: - changed = True - elif i == 0: - changed = newRatio < minZoomForChange - else: - changed = newRatio < minZoomForBaseCaseEnd - - if i == 0 and changed: - #If it is the first time through the loop and there was a change, return the interval it shrunk down to and set "is_done" to false - return np.vstack([a,b]).T, changed, forceShouldStop, throwOut - elif i == 0 and not changed: - #If it is the first time through the loop and there was not a change, save the a and b as the original values to return, - #and then try running through the loop again with a tighter error to see if we shrink then - a_orig = a - b_orig = b - err = errors - elif changed: - #If it is the second time through the loop and it did change, it means we didn't change on the first time, - #but that the interval did shrink with tighter errors. So return the original interval with changed = False and is_done = False - return np.vstack([a_orig, b_orig]).T, False, forceShouldStop, False - else: - #If it is the second time through the loop and it did NOT change, it means we will not shrink the interval even if we subdivide, - #so return the original interval with changed = False and is_done = wellConditioned - return np.vstack([a_orig,b_orig]).T, False, wellConditioned or forceShouldStop, False - -@njit(UniTuple(float64,2)(float64, float64)) -def TwoSum(a,b): - """Returns x,y such that a+b=x+y exactly, and a+b=x in floating point using numba.""" - x = a+b - z = x-a - y = (a-(x-z)) + (b-z) - return x,y -def TwoSum_NoNumba(a,b): - """Returns x,y such that a+b=x+y exactly, and a+b=x in floating point without using numba.""" - x = a+b - z = x-a - y = (a-(x-z)) + (b-z) - return x,y - -@njit(UniTuple(float64,2)(float64)) -def Split(a): - """Returns x,y such that a = x+y exactly and a = x in floating point using numba.""" - c = (2**27 + 1) * a - x = c-(c-a) - y = a-x - return x,y -def Split_NoNumba(a): - """Returns x,y such that a = x+y exactly and a = x in floating point without using numba.""" - c = (2**27 + 1) * a - x = c-(c-a) - y = a-x - return x,y - -@njit(UniTuple(float64,2)(float64, float64)) -def TwoProd(a,b): - """Returns x,y such that a*b=x+y exactly and a*b=x in floating point using numba.""" - x = a*b - a1,a2 = Split(a) - b1,b2 = Split(b) - y=a2*b2-(((x-a1*b1)-a2*b1)-a1*b2) - return x,y -def TwoProd_NoNumba(a,b): - """Returns x,y such that a*b=x+y exactly and a*b=x in floating point without usin numba.""" - x = a*b - a1,a2 = Split_NoNumba(a) - b1,b2 = Split_NoNumba(b) - y=a2*b2-(((x-a1*b1)-a2*b1)-a1*b2) - return x,y - -@njit(UniTuple(float64,2)(float64, float64, float64, float64)) -def TwoProdWithSplit(a,b,a1,a2): - """Returns x,y such that a*b = x+y exactly and a*b = x in floating point but with a already split.""" - x = a*b - b1,b2 = Split(b) - y=a2*b2-(((x-a1*b1)-a2*b1)-a1*b2) - return x,y - -def getTransformPoints(newInterval): - """Gets the alpha and beta points needed to transform the current interval to newInterval.""" - a,b = newInterval - return (b-a)/2, (b+a)/2 - -def getTransformationError(M, dim): - """Returns an upper bound on the error of transforming the Chebyshev approximation M - - In the transformation of dimension dim in M, the matrix multiplication of M by the transformation - matrix C has each element of M involved in n element multiplications, where n is the number of rows - in C, which is equal to the degree of approximation of M in dimension dim, or M.shape[dim]. - - Parameters - ---------- - M : numpy array - The Chebyshev approximation coefficient tensor being transformed - dim : int - The dimension of M being transformed - - Returns - ------- - error : float - The upper bound for the error associated with the transformation of dimension dim in M - """ - machEps = 2**-52 - error = M.shape[dim] * machEps * np.sum(np.abs(M)) - return error #TODO: Figure out a more rigurous bound! - -def transformCheb(M, alphas, betas, error, exact): - """Transforms an entire Chebyshev coefficient matrix using the transformation xHat = alpha*x + beta. - - Parameters - ---------- - M : numpy array - The chebyshev coefficient matrix - alphas : iterable - The scalers in each dimension of the transformation. - betas : iterable - The offset in each dimension of the transformation. - error : float - A bound on the error of the chebyshev approximation - exact : bool - Whether to perform the transformation with higher precision to minimize error - - Returns - ------- - M : numpy array - The coefficient matrix transformed to the new interval - error : float - An upper bound on the error of the transformation - """ - #This just does the matrix multiplication on each dimension. Except it's by a tensor. - for dim,n,alpha,beta in zip(range(M.ndim),M.shape,alphas,betas): - error += getTransformationError(M, dim) - M = TransformChebInPlaceND(M,dim,alpha,beta,exact) - return M, error - -def transformChebToInterval(Ms, alphas, betas, errors, exact): - """Transforms an entire list of Chebyshev approximations to a new interval xHat = alpha*x + beta. - - Parameters - ---------- - Ms : list of numpy arrays - The chebyshev coefficient matrices - alphas : iterable - The scalers of the transformation we are doing. - betas : iterable - The offsets of the transformation we are doing. - errors : numpy array - A bound on the error of each Chebyshev approximation - exact : bool - Whether to perform the transformation with higher precision to minimize error - - Returns - ------- - newMs : list of numpy arrays - The coefficient matrices transformed to the new interval - newErrors : list of numpy arrays - The new errors associated with the transformed coefficient matrices - """ - #Transform the chebyshev polynomials - newMs = [] - newErrors = [] - for M,e in zip(Ms, errors): - newM, newE = transformCheb(M, alphas, betas, e, exact) - newMs.append(newM) - newErrors.append(newE) - return newMs, np.array(newErrors) - -def zoomInOnIntervalIter(Ms, errors, trackedInterval, exact): - """One iteration of shrinking an interval that may contain roots. - - Calls BoundingIntervaLinearSystem which determines a smaller interval in which any roots are - bound to lie. Then calls transformChebToInterval to transform the current coefficient - approximations to the new interval. - - Parameters - ---------- - Ms : list of numpy arrays - The Chebyshev coefficient tensors of each approximation - errors : numpy array - An upper bound on the error of each Chebyshev approximation - trackedInterval : TrackedInterval - The current interval for which the Chebyshev approximations are valid - exact : bool - Whether the transformation should be done with higher precision to minimize error - - Returns - ------- - Ms : list of numpy arrays - The chebyshev coefficient matrices transformed to the new interval - errors : numpy array - The new errors associated with the transformed coefficient matrices - trackedInterval : TrackedInterval - The new interval that the transformed coefficient matrices are valid for - changed : bool - Whether or not the interval shrunk significantly during the iteration - should_stop : bool - Whether or not to continue subdiviing after the iteration of shrinking is completed - """ - - dim = len(Ms) - #Zoom in on the current interval - interval, changed, should_stop, throwOut = BoundingIntervalLinearSystem(Ms, errors, trackedInterval.finalStep) - #Don't zoom in if we're already at a point - for dim in range(len(Ms)): - if trackedInterval.interval[dim,0] == trackedInterval.interval[dim,1]: - interval[dim, 0] = -1. - interval[dim, 1] = 1. - #We can't throw out on the final step - if throwOut and not trackedInterval.canThrowOut(): - throwOut = False - should_stop = True - changed = True - #Check if we can throw out the whole thing - if throwOut: - trackedInterval.empty = True - return Ms, errors, trackedInterval, True, True - #Check if we are done iterating - if not changed: - return Ms, errors, trackedInterval, changed, should_stop - #Transform the chebyshev polynomials - trackedInterval.addTransform(interval) - Ms, errors = transformChebToInterval(Ms, *trackedInterval.getLastTransform(), errors, exact) - #We should stop in the final step once the interval has become a point - if trackedInterval.finalStep and trackedInterval.isPoint(): - should_stop = True - changed = False - - return Ms, errors, trackedInterval, changed, should_stop - -def chebTransform1D(M, alpha, beta, transformDim, exact): - """Transforms a single dimension of a Chebyshev coefficient matrix. - - Parameters - ---------- - M : numpy array - The Chebyshev coefficient matrix - alpha: - The scaler of the transformation - beta: - The shifting of the transformation - transformDim: - The particular dimension of the approximation to be transformed - exact: - Whether the transformation should be performed with higher precision to minimize error - - Returns - ------- - transformed_M : numpy array - The Chebyshev coefficient matrix transformed to the new interval in dimension transformDim - """ - return TransformChebInPlaceND(M, transformDim, alpha, beta, exact) - -def getInverseOrder(order): - """Gets a particular order of matrices needed in getSubdivisionIntervals (helper function). - - Takes the order of dimensions in which a Chebyshev coefficient tensor M was subdivided and gets - the order of the indexes that will arrange the list of resulting transformed matrices as if the - dimensions had bee subdivided in standard index order. For example, if dimensions 0, 3, 1 were - subdivided in that order, this function returns the order [0,2,1,3,4,6,5,7] corresponding to the - indices of currMs such that when arranged in this order, it appears as if the dimensions were - subdivided in order 0, 1, 3. - - Parameters - ---------- - order : numpy array - The order of dimensions along which a coefficient tensor was subdivided - - Returns - ------- - invOrder : numpy array - The order of indices of currMs (in the function getSubdivisionIntervals) that arranges the - matrices resulting from the subdivision as if the original matrix had been subdivided in - numerical order - """ - - t = np.zeros_like(order) - t[np.argsort(order)] = np.arange(len(t)) - order = t - order = 2**(len(order)-1 - order) - newOrder = np.array([i@order for i in product([0,1],repeat=len(order))]) - invOrder = np.zeros_like(newOrder) - invOrder[newOrder] = np.arange(len(newOrder)) - return tuple(invOrder) - -def getSubdivisionDims(Ms,trackedInterval,level): - """Decides which dimensions to subdivide in and in what order. - - Parameters - ---------- - Ms : list of numpy arrays - The chebyshev coefficient matrices - trackedInterval : trackedInterval - The interval to be subdivided - level : int - The current depth of subdivision from the original interval - - Returns - ------- - allDims : numpy array - The ith row gives the dimensions in which Ms[i] should be subdivided, in order. - """ - dim = len(Ms) - dims_to_consider = np.arange(dim) - for i in range(dim): - if np.isclose(trackedInterval.interval[i,0], trackedInterval.interval[i,1]): - if len(dims_to_consider) != 1: - dims_to_consider = np.delete(dims_to_consider, np.argwhere(dims_to_consider==i)) - if level > 5: - return np.vstack([dims_to_consider[np.argsort(np.array(M.shape)[dims_to_consider])[::-1]] for M in Ms]) - else: - dim_lengths = trackedInterval.dimSize() - max_length = np.max([dim_lengths[i] for i in dims_to_consider]) - dims_to_consider = np.extract(dim_lengths[dims_to_consider]>max_length/5,dims_to_consider) - if len(dims_to_consider) > 1: - shapes = np.array([np.array(M.shape) for M in Ms]) - degree_sums = np.sum(shapes,axis=0) - total_sum = np.sum(degree_sums) - for i in dims_to_consider.copy(): - if len(dims_to_consider) > 1 and degree_sums[i] < np.floor(total_sum/(dim+1)): - dims_to_consider = np.delete(dims_to_consider, np.argwhere(dims_to_consider==i)) - return np.vstack([dims_to_consider[np.argsort(np.array(M.shape)[dims_to_consider])[::-1]] for M in Ms]) - -def getSubdivisionIntervals(Ms, errors, trackedInterval, exact, level): - """Gets the matrices, error bounds, and intervals for the next iteration of subdivision. - - Parameters - ---------- - Ms : list of numpy arrays - The chebyshev coefficient matrices - errors : numpy array - An upper bound on the error of each Chebyshev approximation - trackedInterval : trackedInterval - The interval to be subdivided - exact : bool - Whether transformations should be completed with higher precision to minimize error - level : int - The current depth of subdivision from the original interval - - Returns - ------- - allMs : list of numpy arrays - The transformed coefficient matrices associated with each new interval - allErrors : numpy array - A list of upper bounds for the errors associated with each transformed coefficient matrix - allIntervals : list of TrackedIntervals - The intervals from the subdivision (corresponding one to one with the matrices in allMs) - """ - subdivisionDims = getSubdivisionDims(Ms,trackedInterval,level) - dimSet = set(subdivisionDims.flatten()) - if len(dimSet) != subdivisionDims.shape[1]: - raise ValueError("Subdivision Dimensions are invalid! Each Polynomial must subdivide in the same dimensions!") - allMs = [] - allErrors = [] - idx = 0 - for M,error,order in zip(Ms, errors, subdivisionDims): - idx += 1 - #Iterate through the dimensions, highest degree first. - currMs, currErrs = [M],[error] - for thisDim in order: - newMidpoint = trackedInterval.nextTransformPoints[thisDim] - alpha, beta = (newMidpoint+1)/2, (newMidpoint-1)/2 - tempMs = [] - tempErrs = [] - for T,E in zip(currMs, currErrs): - #Transform the polys - P1, P2 = chebTransform1D(T, alpha, beta, thisDim, exact), chebTransform1D(T, -beta, alpha, thisDim, exact) - E1 = getTransformationError(T, thisDim) - tempMs += [P1, P2] - tempErrs += [E1 + E, E1 + E] - currMs = tempMs - currErrs = tempErrs - if M.ndim == 1: - allMs.append(currMs) #Already ordered because there's only 1. - allErrors.append(currErrs) #Already ordered because there's only 1. - else: - #Order the polynomials so they match the intervals in subdivideInterval - invOrder = getInverseOrder(order) - allMs.append([currMs[i] for i in invOrder]) - allErrors.append([currErrs[i] for i in invOrder]) - allMs = [[allMs[i][j] for i in range(len(allMs))] for j in range(len(allMs[0]))] - allErrors = [[allErrors[i][j] for i in range(len(allErrors))] for j in range(len(allErrors[0]))] - #Get the intervals - allIntervals = [trackedInterval] - for thisDim in dimSet: - newMidpoint = trackedInterval.nextTransformPoints[thisDim] - newSubinterval = np.ones_like(trackedInterval.interval) #TODO: Make this outside for loop - newSubinterval[:,0] = -1. - newIntervals = [] - for oldInterval in allIntervals: - newInterval1 = oldInterval.copy() - newInterval2 = oldInterval.copy() - newSubinterval[thisDim] = [-1., newMidpoint] - newInterval1.addTransform(newSubinterval) - newSubinterval[thisDim] = [newMidpoint, 1.] - newInterval2.addTransform(newSubinterval) - newInterval1.nextTransformPoints[thisDim] = 0 - newInterval2.nextTransformPoints[thisDim] = 0 - newIntervals.append(newInterval1) - newIntervals.append(newInterval2) - allIntervals = newIntervals - return allMs, allErrors, allIntervals - -def trimMs(Ms, errors, relApproxTol=1e-3, absApproxTol=0): - """Reduces the degree of each chebyshev approximation M when doing so has negligible error. - - The coefficient matrices are trimmed in place. This function iteratively looks at the highest - degree coefficient row of each M along each dimension and trims it as long as the error introduced - is less than the allowed error increase for that dimension. - - Parameters - ---------- - Ms : list of numpy arrays - The chebyshev approximations of the functions - errors : numpy array - The max error of the chebyshev approximation from the function on the interval - relApproxTol : double - The relative error increase allowed - absApproxTol : double - The absolute error increase allowed - """ - dim = Ms[0].ndim - for polyNum in range(len(Ms)): #Loop through the polynomials - allowedErrorIncrease = absApproxTol + errors[polyNum] * relApproxTol - #Use slicing to look at a slice of the highest degree in the dimension we want to trim - slices = [slice(None) for i in range(dim)] # equivalent to selecting everything - for currDim in range(dim): - slices[currDim] = -1 # Now look at just the last row of the current dimension's approximation - lastSum = np.sum(np.abs(Ms[polyNum][tuple(slices)])) - - # Iteratively eliminate the highest degree row of the current dimension if - # the sum of its approximation coefficients is of low error, but keep deg at least 2 - while lastSum < allowedErrorIncrease and Ms[polyNum].shape[currDim] > 3: - # Trim the polynomial - slices[currDim] = slice(None,-1) - Ms[polyNum] = Ms[polyNum][tuple(slices)] - # Update the remaining error increase allowed an the error of the approximation. - allowedErrorIncrease -= lastSum - errors[polyNum] += lastSum - # Reset for the next iteration with the next highest degree of the current dimension. - slices[currDim] = -1 - lastSum = np.sum(np.abs(Ms[polyNum][tuple(slices)])) - # Reset to select all of the current dimension when looking at the next dimension. - slices[currDim] = slice(None) - -def isExteriorInterval(originalInterval, trackedInterval): - """Determines if the current interval is exterior to its original interval.""" - return np.any(trackedInterval.getIntervalForCombining() == originalInterval.getIntervalForCombining()) - -# Edit Edit -def make_child_tasks(allMs, allErrors, allIntervals, parent_id=None, level=0): - return [ - SolveTask(newMs, newInt, newErrs, parent_id=parent_id, level=level) - for newMs, newErrs, newInt in zip(allMs, allErrors, allIntervals) - ] - -def solvePolySequential(Ms, trackedInterval, errors, solverOptions): - """ - Fully sequential solve. - - Use this inside workers when you do not want nested parallelism. - """ - localOptions = solverOptions.copy() - localOptions.allowParallel = False - return solvePolyRecursive( - Ms, - trackedInterval, - errors, - localOptions, - returnChildren=False - ) - -def _solve_one_level_worker(task, solverOptions): - """ - Worker for one unit of multilevel work. - - It solves one interval until either: - 1. it finishes, or - 2. it reaches subdivision and returns child tasks. - """ - localOptions = solverOptions.copy() - localOptions.allowParallel = False - localOptions.level = task.level - - return solvePolyRecursive( - task.Ms, - task.trackedInterval, - task.errors, - localOptions, - returnChildren=True - ) - -def finish_subdivision_state(state, childInterior, childExterior): - """ - Finish a parent interval after its children have completed. - - This contains the logic that used to happen immediately after the - recursive child calls returned. - """ - originalMs = state.originalMs - originalInterval = state.originalInterval - trackedInterval = state.trackedInterval - errors = state.errors - solverOptions = state.solverOptions - - resultInterior = list(childInterior) - resultExterior = list(childExterior) - - if state.isFinalStep: - resultsAll = resultInterior + resultExterior - - if len(resultsAll) == 0: - trackedInterval.possibleExtraRoot = True - - if isExteriorInterval(originalInterval, trackedInterval): - return [], [trackedInterval] - else: - return [trackedInterval], [] - - # Combine all roots that converged to the same point. - allFoundRoots = set() - tempResults = [] - - for result in resultsAll: - point = tuple(result.interval[:, 0]) - if point in allFoundRoots: - continue - allFoundRoots.add(point) - tempResults.append(result) - - for result in tempResults: - if len(result.possibleDuplicateRoots) > 0: - trackedInterval.possibleDuplicateRoots += result.possibleDuplicateRoots - else: - trackedInterval.possibleDuplicateRoots.append(result.getFinalPoint()) - - if isExteriorInterval(originalInterval, trackedInterval): - return [], [trackedInterval] - else: - return [trackedInterval], [] - - idx1 = 0 - idx2 = 1 - - for tempInterval in resultExterior: - tempInterval.reRun = False - - while idx1 < len(resultExterior): - while idx2 < len(resultExterior): - if resultExterior[idx1].overlapsWith(resultExterior[idx2]): - combinedInterval = originalInterval.copy() - - if combinedInterval.finalStep: - combinedInterval.interval = combinedInterval.preFinalInterval.copy() - combinedInterval.transforms = combinedInterval.preFinalTransforms.copy() - - newAs = np.min( - [ - resultExterior[idx1].getIntervalForCombining()[:, 0], - resultExterior[idx2].getIntervalForCombining()[:, 0] - ], - axis=0 - ) - - newBs = np.max( - [ - resultExterior[idx1].getIntervalForCombining()[:, 1], - resultExterior[idx2].getIntervalForCombining()[:, 1] - ], - axis=0 - ) - - final1 = resultExterior[idx1].getFinalInterval() - final2 = resultExterior[idx2].getFinalInterval() - - newAsFinal = np.min([final1[:, 0], final2[:, 0]], axis=0) - newBsFinal = np.max([final1[:, 1], final2[:, 1]], axis=0) - - oldAs = originalInterval.interval[:, 0] - oldBs = originalInterval.interval[:, 1] - oldAsFinal, oldBsFinal = originalInterval.getFinalInterval().T - - equalMask = oldBsFinal == oldAsFinal - oldBsFinal[equalMask] = oldBsFinal[equalMask] + 1 - - currSubinterval = ( - ( - 2 * np.array([newAsFinal, newBsFinal]) - - oldAsFinal - - oldBsFinal - ) - / (oldBsFinal - oldAsFinal) - ).T - - currSubinterval[equalMask, 0] = -1 - currSubinterval[equalMask, 1] = 1 - - currSubinterval[:, 0][oldAs == newAs] = -1 - currSubinterval[:, 1][oldBs == newBs] = 1 - - combinedInterval.addTransform(currSubinterval) - combinedInterval.interval = np.array([newAs, newBs]).T - combinedInterval.reRun = True - - del resultExterior[idx2] - del resultExterior[idx1] - - resultExterior.append(combinedInterval) - idx2 = idx1 + 1 - else: - idx2 += 1 - - idx1 += 1 - idx2 = idx1 + 1 - - # Rerun touching intervals. - newResultExterior = [] - - for tempInterval in resultExterior: - if tempInterval.reRun: - if np.all(tempInterval.interval == originalInterval.interval): - newResultExterior.append(tempInterval) - else: - tempMs, tempErrors = transformChebToInterval( - originalMs, - *tempInterval.getLastTransform(), - errors, - solverOptions.exact - ) - - tempResultsInterior, tempResultsExterior = solvePolySequential( - tempMs, - tempInterval, - tempErrors, - solverOptions - ) - - resultInterior += tempResultsInterior - newResultExterior += tempResultsExterior - - elif isExteriorInterval(originalInterval, tempInterval): - newResultExterior.append(tempInterval) - - else: - resultInterior.append(tempInterval) - - return resultInterior, newResultExterior - - -def solvePolyParallelMultilevel(Ms, trackedInterval, errors, solverOptions): - """ - Multilevel parallel driver. - - This is the only place where a process pool is created. - """ - max_workers = max(1, solverOptions.max_cpu) - - workerOptions = solverOptions.copy() - workerOptions.allowParallel = False - - next_parent_id = 0 - - pendingTasks = [SolveTask(Ms, trackedInterval, errors, parent_id=None)] - - futures = set() - - # parent_id -> bookkeeping - waitingParents = {} - - finalInterior = [] - finalExterior = [] - - def submit_task(executor, task): - return executor.submit(_solve_one_level_worker, task, workerOptions), task.parent_id - - def complete_result(result, parent_id): - """ - Handle a completed TaskResult. - - If parent_id is None, add directly to final result. - Otherwise, accumulate into the waiting parent. - """ - nonlocal next_parent_id - - # Case 1: the task finished normally. - if len(result.childTasks) == 0: - if parent_id is None: - finalInterior.extend(result.interior) - finalExterior.extend(result.exterior) - else: - parent = waitingParents[parent_id] - parent["interior"].extend(result.interior) - parent["exterior"].extend(result.exterior) - parent["remaining"] -= 1 - - return - - # Case 2: the task subdivided. - this_parent_id = next_parent_id - next_parent_id += 1 - - waitingParents[this_parent_id] = { - "state": result.subdivisionState, - "parent_id": parent_id, - "remaining": len(result.childTasks), - "interior": list(result.interior), - "exterior": list(result.exterior), - } - - for child in result.childTasks: - child.parent_id = this_parent_id - pendingTasks.append(child) - - def finish_ready_parents(): - """ - Some parent may become ready after its final child finishes. - - Finishing a parent produces normal interior/exterior results, - which then need to be passed upward to that parent's parent. - """ - changed = True - - while changed: - changed = False - - ready_ids = [ - parent_id - for parent_id, parent in waitingParents.items() - if parent["remaining"] == 0 - ] - - for parent_id in ready_ids: - parent = waitingParents.pop(parent_id) - - interior, exterior = finish_subdivision_state( - parent["state"], - parent["interior"], - parent["exterior"] - ) - - parent_result = TaskResult( - interior=interior, - exterior=exterior, - childTasks=[], - subdivisionState=None - ) - - complete_result(parent_result, parent["parent_id"]) - changed = True - - with ThreadPoolExecutor(max_workers=max_workers) as executor: - future_to_parent = {} - - # Fill pool initially. - while pendingTasks and len(futures) < max_workers: - task = pendingTasks.pop() - fut, parent_id = submit_task(executor, task) - futures.add(fut) - future_to_parent[fut] = parent_id - - while futures: - done, futures = wait(futures, return_when=FIRST_COMPLETED) - - for fut in done: - parent_id = future_to_parent.pop(fut) - result = fut.result() - - complete_result(result, parent_id) - finish_ready_parents() - - # Refill available worker slots. - while pendingTasks and len(futures) < max_workers: - task = pendingTasks.pop() - fut, parent_id = submit_task(executor, task) - futures.add(fut) - future_to_parent[fut] = parent_id - - # After all futures finish, make sure all parent continuations are finished. - finish_ready_parents() - - return finalInterior, finalExterior - - -def solvePolyRecursive(Ms, trackedInterval, errors, solverOptions, returnChildren=False): - """ - Recursively shrinks and subdivides the given interval to find the locations of all roots. - - When returnChildren=False: - behaves like the original sequential recursive function. - - When returnChildren=True: - solves until it reaches a subdivision point, then returns a TaskResult - containing child tasks instead of recursively solving those children. - """ - - if trackedInterval.isPoint(): - if returnChildren: - return TaskResult([], [trackedInterval], []) - return [], [trackedInterval] - - solverOptions = solverOptions.copy() - solverOptions.level += 1 - - # Constant term check. - if solverOptions.constant_check: - consts = np.array([M.ravel()[0] for M in Ms]) - err = np.array([np.sum(np.abs(M)) - abs(c) + e for M, e, c in zip(Ms, errors, consts)]) - - if np.any(np.abs(consts) > err): - if returnChildren: - return TaskResult([], [], []) - return [], [] - - # Quadratic check. - if (solverOptions.low_dim_quadratic_check and Ms[0].ndim <= 3) or solverOptions.all_dim_quadratic_check: - for i in range(len(Ms)): - if quadratic_check(Ms[i], errors[i]): - if returnChildren: - return TaskResult([], [], []) - return [], [] - - # Trim. - Ms = Ms.copy() - originalMs = Ms.copy() - trackedInterval = trackedInterval.copy() - errors = errors.copy() - - tolerable_error = max(errors) * 1e-3 - trimMs(Ms, errors) - - dim = Ms[0].ndim - changed = True - zoomCount = 0 - - originalInterval = trackedInterval.copy() - originalIntervalSize = trackedInterval.size() - - lastSizes = trackedInterval.dimSize() - - start_time = time() - - while changed and zoomCount <= solverOptions.maxZoomCount: - Ms, errors, trackedInterval, changed, should_stop = zoomInOnIntervalIter(Ms,errors,trackedInterval,solverOptions.exact) - - if trackedInterval.empty: - if returnChildren: - return TaskResult([], [], []) - return [], [] - - newSizes = trackedInterval.dimSize() - - if np.all(newSizes >= lastSizes / 2): - zoomCount += 1 - - lastSizes = newSizes - - finish_time = time() - - if should_stop: - if trackedInterval.finalStep or not solverOptions.useFinalStep: - if solverOptions.verbose: - print("*", end="") - - if isExteriorInterval(originalInterval, trackedInterval): - if returnChildren: - return TaskResult([], [trackedInterval], []) - return [], [trackedInterval] - else: - if returnChildren: - return TaskResult([trackedInterval], [], []) - return [trackedInterval], [] - - else: - trackedInterval.startFinalStep() - - if returnChildren and solverOptions.level < solverOptions.parallel_depth: - # Continue solving this same interval in the global scheduler. - child = SolveTask(Ms, trackedInterval, errors, level=solverOptions.level) - state = SubdivisionState( - originalMs=originalMs, - originalInterval=originalInterval, - trackedInterval=trackedInterval, - errors=errors, - solverOptions=solverOptions, - isFinalStep=False - ) - - return TaskResult(interior=[], exterior=[], childTasks=[child], subdivisionState=state) - - serialInterior, serialExterior = solvePolyRecursive(Ms, trackedInterval, errors, solverOptions, returnChildren=False) - - if returnChildren: - return TaskResult(interior=serialInterior, exterior=serialExterior, childTasks=[], subdivisionState=None) - - return serialInterior, serialExterior - - elif trackedInterval.finalStep: - trackedInterval.canThrowOutFinalStep = True - - resultInterior, resultExterior = [], [] - - allMs, allErrors, allIntervals = getSubdivisionIntervals( - Ms, - errors, - trackedInterval, - solverOptions.exact, - solverOptions.level - ) - - state = SubdivisionState( - originalMs=originalMs, - originalInterval=originalInterval, - trackedInterval=trackedInterval, - errors=errors, - solverOptions=solverOptions, - isFinalStep=True - ) - - childTasks = make_child_tasks( - allMs, allErrors, allIntervals, level=solverOptions.level - ) - - if returnChildren and solverOptions.level < solverOptions.parallel_depth: - return TaskResult( - interior=resultInterior, - exterior=resultExterior, - childTasks=childTasks, - subdivisionState=state - ) - - # Solve children serially in this worker/process. - for child in childTasks: - newInterior, newExterior = solvePolyRecursive( - child.Ms, - child.trackedInterval, - child.errors, - solverOptions, - returnChildren=False - ) - - resultInterior += newInterior - resultExterior += newExterior - - resultInterior, resultExterior = finish_subdivision_state( - state, resultInterior, resultExterior - ) - - if returnChildren: - return TaskResult( - interior=resultInterior, - exterior=resultExterior, - childTasks=[], - subdivisionState=None - ) - - return resultInterior, resultExterior - - else: - # Normal subdivision. - if solverOptions.level == 15: - warnings.warn( - "High subdivision depth!\n" - "Subdivision on the search interval has now reached " - "at least depth 15. Runtime may be prolonged." - ) - - elif solverOptions.level == 25: - warnings.warn( - "Extreme subdivision depth!\n" - "Subdivision on the search interval has now reached " - "at least depth 25, which is unusual. The solver may not finish running. " - "Ensure the input functions meet the requirements of being continuous, " - "smooth, and having only finitely many simple roots on the search interval." - ) - - resultInterior, resultExterior = [], [] - - allMs, allErrors, allIntervals = getSubdivisionIntervals( - Ms, - errors, - trackedInterval, - solverOptions.exact, - solverOptions.level - ) - - state = SubdivisionState( - originalMs=originalMs, - originalInterval=originalInterval, - trackedInterval=trackedInterval, - errors=errors, - solverOptions=solverOptions, - isFinalStep=False - ) - - childTasks = make_child_tasks( - allMs, allErrors, allIntervals, level=solverOptions.level - ) - - if returnChildren and solverOptions.level < solverOptions.parallel_depth: - return TaskResult( - interior=resultInterior, - exterior=resultExterior, - childTasks=childTasks, - subdivisionState=state - ) - - # Solve children serially in this worker/process. - for child in childTasks: - newInterior, newExterior = solvePolyRecursive( - child.Ms, - child.trackedInterval, - child.errors, - solverOptions, - returnChildren=False - ) - - resultInterior += newInterior - resultExterior += newExterior - - resultInterior, resultExterior = finish_subdivision_state( - state, resultInterior, resultExterior - ) - - if returnChildren: - return TaskResult( - interior=resultInterior, - exterior=resultExterior, - childTasks=[], - subdivisionState=None - ) - return resultInterior, resultExterior - - -def solvePoly(Ms, trackedInterval, errors, solverOptions): - """ - Recommended public entry point. - - Call this instead of calling solvePolyRecursive directly. - """ - if solverOptions.parallel_depth > 0 and solverOptions.max_cpu > 1: - return solvePolyParallelMultilevel( - Ms, - trackedInterval, - errors, - solverOptions - ) - - return solvePolyRecursive( - Ms, - trackedInterval, - errors, - solverOptions, - returnChildren=False - ) - -def solveChebyshevSubdivision(Ms, errors, verbose = False, returnBoundingBoxes = False, exact = False, constant_check = True, - low_dim_quadratic_check = True,all_dim_quadratic_check = False, max_cpu=1, parallel_depth=1): - """Initiates shrinking and subdivision recursion and returns the roots and bounding boxes. - - Parameters - ---------- - Ms : list of numpy arrays - The chebyshev approximations of the functions on the interval given to CombinedSolver - errors : numpy array - The max error of the chebyshev approximation from the function on the interval - verbose : bool - Defaults to False. Whether or not to output progress of solving to the terminal. - returnBoundingBoxes : bool (Optional) - Defaults to False. If True, returns the bounding boxes around each root as well as the roots. - exact : bool - Whether transformations should be done with higher precision to minimize error. - constant_check : bool - Defaults to True. Whether or not to run constant term check after each subdivision. - low_dim_quadratic_check : bool - Defaults to True. Whether or not to run quadratic check in dim 2, 3. - all_dim_quadratic_check : bool - Defaults to False. Whether or not to run quadratic check in dim >= 4. - - Returns - ------- - roots : list - The roots of the system of functions on the interval given to Combined Solver - boundingBoxes : list of numpy arrays (optional) - List of intervals for each root in which the root is bound to lie. - """ - #Assert that we have n nD polys - if np.any([M.ndim != len(Ms) for M in Ms]): - raise ValueError("Solver Takes in N polynomials of dimension N!") - if len(Ms) != len(errors): - raise ValueError("Ms and errors must be same length!") - - #Solve - originalInterval = TrackedInterval(np.array([[-1.,1.]]*Ms[0].ndim)) - solverOptions = SolverOptions() - solverOptions.verbose = verbose - solverOptions.exact = exact - solverOptions.constant_check = constant_check - solverOptions.low_dim_quadratic_check = low_dim_quadratic_check - solverOptions.all_dim_quadratic_check = all_dim_quadratic_check - solverOptions.useFinalStep = True - solverOptions.max_cpu=max_cpu-1 - solverOptions.parallel_depth=parallel_depth - - if verbose: - print("Finding roots...", end=' ') - b1, b2 = solvePoly(Ms, originalInterval, errors, solverOptions) - - boundingIntervals = b1 + b2 - roots = [] - hasDupRoots = False - hasExtraRoots = False - for interval in boundingIntervals: - #TODO: Figure out the best way to return the bounding intervals. - #Right now interval.finalInterval is the interval where we say the root is. - interval.getFinalInterval() - if interval.possibleExtraRoot: - hasExtraRoots = True - if len(interval.possibleDuplicateRoots) > 0: - roots += interval.possibleDuplicateRoots - hasDupRoots = True - else: - roots.append(interval.getFinalPoint()) - #Warn if extra or duplicate roots - if hasExtraRoots: - warnings.warn(f"Might Have Extra Roots! See Bounding Boxes for details!") - if hasDupRoots: - warnings.warn(f"Might Have Duplicate Roots! See Bounding Boxes for details!") - #Return - roots = np.array(roots) - if verbose: - finish_string = '\n' + f"Found {len(roots)} roots" - print((finish_string if len(roots) != 1 else finish_string[:-1]),end='\n\n') - if returnBoundingBoxes: - return roots, boundingIntervals - else: - return roots From a757e7e47c87a0dd33c38235c91821ea00101cac Mon Sep 17 00:00:00 2001 From: JarvisRAs Date: Fri, 22 May 2026 15:51:31 -0600 Subject: [PATCH 08/36] Add git action workflow dispatch --- .github/workflows/Unit_Tests.yml | 1 + yroots/Combined_Solver.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Unit_Tests.yml b/.github/workflows/Unit_Tests.yml index ba15384b..7c7d4a3e 100644 --- a/.github/workflows/Unit_Tests.yml +++ b/.github/workflows/Unit_Tests.yml @@ -5,6 +5,7 @@ on: branches: [ "main" ] pull_request: branches: [ "main" ] + workflow_dispatch: permissions: contents: read diff --git a/yroots/Combined_Solver.py b/yroots/Combined_Solver.py index 2931dd94..e479a183 100644 --- a/yroots/Combined_Solver.py +++ b/yroots/Combined_Solver.py @@ -2,7 +2,7 @@ from numba import njit import itertools import functools -import yroots.ChebyshevSubdivisionSolverClaude as ChebyshevSubdivisionSolver +import yroots.ChebyshevSubdivisionSolver as ChebyshevSubdivisionSolver import yroots.ChebyshevApproximator as ChebyshevApproximator from yroots.polynomial import MultiCheb,MultiPower from time import time From ad5f4212604ecaa44ae9729f41c6895aedde541a Mon Sep 17 00:00:00 2001 From: JarvisRAs Date: Fri, 22 May 2026 17:51:14 -0600 Subject: [PATCH 09/36] Removed unused imports --- yroots/ChebyshevSubdivisionSolver.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/yroots/ChebyshevSubdivisionSolver.py b/yroots/ChebyshevSubdivisionSolver.py index fde0d8de..2f608646 100644 --- a/yroots/ChebyshevSubdivisionSolver.py +++ b/yroots/ChebyshevSubdivisionSolver.py @@ -2,8 +2,6 @@ from numba import njit, float64 from numba.types import UniTuple from itertools import product -from scipy.spatial import HalfspaceIntersection, QhullError -from scipy.optimize import linprog from yroots.QuadraticCheck import quadratic_check from time import time import copy @@ -12,7 +10,6 @@ # Edit number 1 from dataclasses import dataclass from concurrent.futures import ThreadPoolExecutor, wait, FIRST_COMPLETED -from multiprocessing import Pool # Edit Edit @dataclass From ea6d7f07ce4f0ca5b20fd766d68961f870604674 Mon Sep 17 00:00:00 2001 From: JarvisRAs Date: Fri, 22 May 2026 17:58:41 -0600 Subject: [PATCH 10/36] Switch to uv --- .github/workflows/Unit_Tests.yml | 26 +- pyproject.toml | 19 ++ requirements.txt | 12 +- uv.lock | 413 +++++++++++++++++++++++++++++++ 4 files changed, 448 insertions(+), 22 deletions(-) create mode 100644 pyproject.toml create mode 100644 uv.lock diff --git a/.github/workflows/Unit_Tests.yml b/.github/workflows/Unit_Tests.yml index 7c7d4a3e..3e8b42d3 100644 --- a/.github/workflows/Unit_Tests.yml +++ b/.github/workflows/Unit_Tests.yml @@ -1,41 +1,35 @@ name: Unit_Tests - on: push: branches: [ "main" ] pull_request: branches: [ "main" ] workflow_dispatch: - permissions: contents: read - jobs: build: runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 + - name: Install uv + uses: astral-sh/setup-uv@v5 + with: + enable-cache: true + - name: Set up Python 3.14t - uses: actions/setup-python@v6 + uses: astral-sh/setup-uv@v5 with: python-version: "3.14t" - - name: Check CPU count - run: nproc - - name: Check Python version run: | - python --version - python -c "import sysconfig; print('Py_GIL_DISABLED =', sysconfig.get_config_var('Py_GIL_DISABLED'))" + uv run python --version + uv run python -c "import sysconfig; print('Py_GIL_DISABLED =', sysconfig.get_config_var('Py_GIL_DISABLED'))" - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + run: uv sync --frozen - name: Test with pytest - run: | - pytest tests --ignore=tests/_old_unit_tests \ No newline at end of file + run: uv run pytest tests --ignore=tests/_old_unit_tests \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..0eef05e3 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,19 @@ +[project] +name = "rootfinding" +version = "0.1.0" +description = "Add your description here" +readme = "README.md" +requires-python = ">=3.14" +dependencies = [ + "matplotlib>=3.10.9", + "mpmath>=1.3.0", + "numba>=0.65.1", + "numpy>=2.4.6", + "scipy>=1.17.1", + "sympy>=1.14.0", +] + +[dependency-groups] +dev = [ + "pytest>=9.0.3", +] diff --git a/requirements.txt b/requirements.txt index 6e22912a..776f875d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ -numpy==1.24.3 -scipy==1.10.1 -numba==0.57.0 -matplotlib==3.7.1 -mpmath==1.3.0 -sympy==1.12 +numpy +scipy +numba +matplotlib +mpmath +sympy diff --git a/uv.lock b/uv.lock new file mode 100644 index 00000000..8040749f --- /dev/null +++ b/uv.lock @@ -0,0 +1,413 @@ +version = 1 +revision = 3 +requires-python = ">=3.14" + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" }, +] + +[[package]] +name = "contourpy" +version = "1.3.3" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "numpy" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/58/01/1253e6698a07380cd31a736d248a3f2a50a7c88779a1813da27503cadc2a/contourpy-1.3.3.tar.gz", hash = "sha256:083e12155b210502d0bca491432bb04d56dc3432f95a979b429f2848c3dbe880", size = 13466174, upload-time = "2025-07-26T12:03:12.549Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/72/8b/4546f3ab60f78c514ffb7d01a0bd743f90de36f0019d1be84d0a708a580a/contourpy-1.3.3-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:fde6c716d51c04b1c25d0b90364d0be954624a0ee9d60e23e850e8d48353d07a", size = 292189, upload-time = "2025-07-26T12:02:16.095Z" }, + { url = "https://files.pythonhosted.org/packages/fd/e1/3542a9cb596cadd76fcef413f19c79216e002623158befe6daa03dbfa88c/contourpy-1.3.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:cbedb772ed74ff5be440fa8eee9bd49f64f6e3fc09436d9c7d8f1c287b121d77", size = 273251, upload-time = "2025-07-26T12:02:17.524Z" }, + { url = "https://files.pythonhosted.org/packages/b1/71/f93e1e9471d189f79d0ce2497007731c1e6bf9ef6d1d61b911430c3db4e5/contourpy-1.3.3-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:22e9b1bd7a9b1d652cd77388465dc358dafcd2e217d35552424aa4f996f524f5", size = 335810, upload-time = "2025-07-26T12:02:18.9Z" }, + { url = "https://files.pythonhosted.org/packages/91/f9/e35f4c1c93f9275d4e38681a80506b5510e9327350c51f8d4a5a724d178c/contourpy-1.3.3-cp314-cp314-manylinux_2_26_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:a22738912262aa3e254e4f3cb079a95a67132fc5a063890e224393596902f5a4", size = 382871, upload-time = "2025-07-26T12:02:20.418Z" }, + { url = "https://files.pythonhosted.org/packages/b5/71/47b512f936f66a0a900d81c396a7e60d73419868fba959c61efed7a8ab46/contourpy-1.3.3-cp314-cp314-manylinux_2_26_s390x.manylinux_2_28_s390x.whl", hash = "sha256:afe5a512f31ee6bd7d0dda52ec9864c984ca3d66664444f2d72e0dc4eb832e36", size = 386264, upload-time = "2025-07-26T12:02:21.916Z" }, + { url = "https://files.pythonhosted.org/packages/04/5f/9ff93450ba96b09c7c2b3f81c94de31c89f92292f1380261bd7195bea4ea/contourpy-1.3.3-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f64836de09927cba6f79dcd00fdd7d5329f3fccc633468507079c829ca4db4e3", size = 363819, upload-time = "2025-07-26T12:02:23.759Z" }, + { url = "https://files.pythonhosted.org/packages/3e/a6/0b185d4cc480ee494945cde102cb0149ae830b5fa17bf855b95f2e70ad13/contourpy-1.3.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:1fd43c3be4c8e5fd6e4f2baeae35ae18176cf2e5cced681cca908addf1cdd53b", size = 1333650, upload-time = "2025-07-26T12:02:26.181Z" }, + { url = "https://files.pythonhosted.org/packages/43/d7/afdc95580ca56f30fbcd3060250f66cedbde69b4547028863abd8aa3b47e/contourpy-1.3.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:6afc576f7b33cf00996e5c1102dc2a8f7cc89e39c0b55df93a0b78c1bd992b36", size = 1404833, upload-time = "2025-07-26T12:02:28.782Z" }, + { url = "https://files.pythonhosted.org/packages/e2/e2/366af18a6d386f41132a48f033cbd2102e9b0cf6345d35ff0826cd984566/contourpy-1.3.3-cp314-cp314-win32.whl", hash = "sha256:66c8a43a4f7b8df8b71ee1840e4211a3c8d93b214b213f590e18a1beca458f7d", size = 189692, upload-time = "2025-07-26T12:02:30.128Z" }, + { url = "https://files.pythonhosted.org/packages/7d/c2/57f54b03d0f22d4044b8afb9ca0e184f8b1afd57b4f735c2fa70883dc601/contourpy-1.3.3-cp314-cp314-win_amd64.whl", hash = "sha256:cf9022ef053f2694e31d630feaacb21ea24224be1c3ad0520b13d844274614fd", size = 232424, upload-time = "2025-07-26T12:02:31.395Z" }, + { url = "https://files.pythonhosted.org/packages/18/79/a9416650df9b525737ab521aa181ccc42d56016d2123ddcb7b58e926a42c/contourpy-1.3.3-cp314-cp314-win_arm64.whl", hash = "sha256:95b181891b4c71de4bb404c6621e7e2390745f887f2a026b2d99e92c17892339", size = 198300, upload-time = "2025-07-26T12:02:32.956Z" }, + { url = "https://files.pythonhosted.org/packages/1f/42/38c159a7d0f2b7b9c04c64ab317042bb6952b713ba875c1681529a2932fe/contourpy-1.3.3-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:33c82d0138c0a062380332c861387650c82e4cf1747aaa6938b9b6516762e772", size = 306769, upload-time = "2025-07-26T12:02:34.2Z" }, + { url = "https://files.pythonhosted.org/packages/c3/6c/26a8205f24bca10974e77460de68d3d7c63e282e23782f1239f226fcae6f/contourpy-1.3.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:ea37e7b45949df430fe649e5de8351c423430046a2af20b1c1961cae3afcda77", size = 287892, upload-time = "2025-07-26T12:02:35.807Z" }, + { url = "https://files.pythonhosted.org/packages/66/06/8a475c8ab718ebfd7925661747dbb3c3ee9c82ac834ccb3570be49d129f4/contourpy-1.3.3-cp314-cp314t-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d304906ecc71672e9c89e87c4675dc5c2645e1f4269a5063b99b0bb29f232d13", size = 326748, upload-time = "2025-07-26T12:02:37.193Z" }, + { url = "https://files.pythonhosted.org/packages/b4/a3/c5ca9f010a44c223f098fccd8b158bb1cb287378a31ac141f04730dc49be/contourpy-1.3.3-cp314-cp314t-manylinux_2_26_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:ca658cd1a680a5c9ea96dc61cdbae1e85c8f25849843aa799dfd3cb370ad4fbe", size = 375554, upload-time = "2025-07-26T12:02:38.894Z" }, + { url = "https://files.pythonhosted.org/packages/80/5b/68bd33ae63fac658a4145088c1e894405e07584a316738710b636c6d0333/contourpy-1.3.3-cp314-cp314t-manylinux_2_26_s390x.manylinux_2_28_s390x.whl", hash = "sha256:ab2fd90904c503739a75b7c8c5c01160130ba67944a7b77bbf36ef8054576e7f", size = 388118, upload-time = "2025-07-26T12:02:40.642Z" }, + { url = "https://files.pythonhosted.org/packages/40/52/4c285a6435940ae25d7410a6c36bda5145839bc3f0beb20c707cda18b9d2/contourpy-1.3.3-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b7301b89040075c30e5768810bc96a8e8d78085b47d8be6e4c3f5a0b4ed478a0", size = 352555, upload-time = "2025-07-26T12:02:42.25Z" }, + { url = "https://files.pythonhosted.org/packages/24/ee/3e81e1dd174f5c7fefe50e85d0892de05ca4e26ef1c9a59c2a57e43b865a/contourpy-1.3.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:2a2a8b627d5cc6b7c41a4beff6c5ad5eb848c88255fda4a8745f7e901b32d8e4", size = 1322295, upload-time = "2025-07-26T12:02:44.668Z" }, + { url = "https://files.pythonhosted.org/packages/3c/b2/6d913d4d04e14379de429057cd169e5e00f6c2af3bb13e1710bcbdb5da12/contourpy-1.3.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:fd6ec6be509c787f1caf6b247f0b1ca598bef13f4ddeaa126b7658215529ba0f", size = 1391027, upload-time = "2025-07-26T12:02:47.09Z" }, + { url = "https://files.pythonhosted.org/packages/93/8a/68a4ec5c55a2971213d29a9374913f7e9f18581945a7a31d1a39b5d2dfe5/contourpy-1.3.3-cp314-cp314t-win32.whl", hash = "sha256:e74a9a0f5e3fff48fb5a7f2fd2b9b70a3fe014a67522f79b7cca4c0c7e43c9ae", size = 202428, upload-time = "2025-07-26T12:02:48.691Z" }, + { url = "https://files.pythonhosted.org/packages/fa/96/fd9f641ffedc4fa3ace923af73b9d07e869496c9cc7a459103e6e978992f/contourpy-1.3.3-cp314-cp314t-win_amd64.whl", hash = "sha256:13b68d6a62db8eafaebb8039218921399baf6e47bf85006fd8529f2a08ef33fc", size = 250331, upload-time = "2025-07-26T12:02:50.137Z" }, + { url = "https://files.pythonhosted.org/packages/ae/8c/469afb6465b853afff216f9528ffda78a915ff880ed58813ba4faf4ba0b6/contourpy-1.3.3-cp314-cp314t-win_arm64.whl", hash = "sha256:b7448cb5a725bb1e35ce88771b86fba35ef418952474492cf7c764059933ff8b", size = 203831, upload-time = "2025-07-26T12:02:51.449Z" }, +] + +[[package]] +name = "cycler" +version = "0.12.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/a9/95/a3dbbb5028f35eafb79008e7522a75244477d2838f38cbb722248dabc2a8/cycler-0.12.1.tar.gz", hash = "sha256:88bb128f02ba341da8ef447245a9e138fae777f6a23943da4540077d3601eb1c", size = 7615, upload-time = "2023-10-07T05:32:18.335Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e7/05/c19819d5e3d95294a6f5947fb9b9629efb316b96de511b418c53d245aae6/cycler-0.12.1-py3-none-any.whl", hash = "sha256:85cef7cff222d8644161529808465972e51340599459b8ac3ccbac5a854e0d30", size = 8321, upload-time = "2023-10-07T05:32:16.783Z" }, +] + +[[package]] +name = "fonttools" +version = "4.63.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/84/69/c97f2c18e0db87d2c7b15da1974dace76ae938f1cfa22e2727a648b7ed43/fonttools-4.63.0.tar.gz", hash = "sha256:caeb583deeb5168e694b65cda8b4ee62abedfa66cf88488734466f2366b9c4e0", size = 3597189, upload-time = "2026-05-14T12:04:30.958Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/27/d2/23d25e3f247b328be58d04a4c9f894178a0d1eda7d42867cfb388adaf416/fonttools-4.63.0-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:fd1e3094f42d806d3d7c79162fc59e5910fcbe3a7360c385b8da969bc4493745", size = 2875338, upload-time = "2026-05-14T12:03:50.052Z" }, + { url = "https://files.pythonhosted.org/packages/cd/58/7dfa0c761cb3b2964e2a84c4dc986c926a87de0cb9fb60d5b28ded3f2914/fonttools-4.63.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:6e528da43bc3791085f8cb6141b1d13e459226790240340fcbb4625649238b03", size = 2422661, upload-time = "2026-05-14T12:03:52.154Z" }, + { url = "https://files.pythonhosted.org/packages/dd/87/64cfa18a7a1621d17b7f4502b2b0ed8a135a90c3db51ea590ee99043e76b/fonttools-4.63.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6b2248c5decb223562f7902ff6325077a073f608ee8e33e88ad88db734eb9f49", size = 5010526, upload-time = "2026-05-14T12:03:54.647Z" }, + { url = "https://files.pythonhosted.org/packages/36/e1/a8933a72c45a87177fbde2696e0d0755c8c9062f8c077a961c6215fa27b1/fonttools-4.63.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:308f957cdeaf8abe4e5f2f124902ef405448af92c90f80e302a3b771c2e6116b", size = 4923946, upload-time = "2026-05-14T12:03:56.984Z" }, + { url = "https://files.pythonhosted.org/packages/27/60/872e6e233b8c5e8b41413796ff18b7fe479661bd40147e071b450dfad7a1/fonttools-4.63.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:bf00f21eb5fb721dbaf73d1e9da6d02a1af7768f2ebcf9798be98beab8ba90f6", size = 4962489, upload-time = "2026-05-14T12:03:59.443Z" }, + { url = "https://files.pythonhosted.org/packages/30/c4/83c24f2ec38b90cfda84bf4b1a1f49df80e84a1db4e7ac6e0d41bf23bc39/fonttools-4.63.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:c1aaa4b9c75798400ac043ce04d74e7830376c85095a5a6ed7cba2f17a266bf4", size = 5071870, upload-time = "2026-05-14T12:04:02.122Z" }, + { url = "https://files.pythonhosted.org/packages/de/40/3ae22b60ff1d41ce0bd044b31238cdc72cef99f28b976f1e128ebd618c9b/fonttools-4.63.0-cp314-cp314-win32.whl", hash = "sha256:22693918177bd9ceabec4736d338045f357769416fc6b0b2508eefef75b08616", size = 2295026, upload-time = "2026-05-14T12:04:04.47Z" }, + { url = "https://files.pythonhosted.org/packages/c3/d4/98078064ccc76b45cb0f6c002452011e93c4bd26f6850344f0951cc1fe89/fonttools-4.63.0-cp314-cp314-win_amd64.whl", hash = "sha256:7d782fac32985914c351556f68ac0855391572bcd87de50e05970d3cd4c96fc5", size = 2347454, upload-time = "2026-05-14T12:04:06.752Z" }, + { url = "https://files.pythonhosted.org/packages/49/4e/652d1580c5f4e39f7d103b0c793e4773129ad633dce4addd0cf4dfebde02/fonttools-4.63.0-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:6db5140a60a5d731d21ec076745b40a310607731b0a565b50776393188649001", size = 2958152, upload-time = "2026-05-14T12:04:08.706Z" }, + { url = "https://files.pythonhosted.org/packages/0e/55/ad864c9a9b219f552eb46b32cd7906c466e5a578ba0c3abfcc0fe7413eb6/fonttools-4.63.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:7d76edbff9014094dbf03bd2d074709dfa6ec7aba13d838c937a2b33d2d6a86e", size = 2460809, upload-time = "2026-05-14T12:04:10.783Z" }, + { url = "https://files.pythonhosted.org/packages/ea/2b/0aa8db70f18cf52e49b4ed5ecec68547f981160bf5ded3b5aed6faa0a6f9/fonttools-4.63.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0eac00b9118c3c2f87d272e45341871c5b3066baa3c86897fa634a7c3fb59096", size = 5148649, upload-time = "2026-05-14T12:04:12.747Z" }, + { url = "https://files.pythonhosted.org/packages/7f/63/18e4369c25043096f1048e0c9915951adc4f842bd81c6b18155824d6fa99/fonttools-4.63.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:51394295f1a51de8b5f30bdb1e1b9a4231536c7064ef5c6e211eec19fa36036f", size = 4932147, upload-time = "2026-05-14T12:04:14.806Z" }, + { url = "https://files.pythonhosted.org/packages/a1/3f/67f3eac2ffd8a98446c5022f8ed3864eac878a5ff7af8df4c8286dba16cc/fonttools-4.63.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:9e12f105d2b6342c559c298afb674006bb2893afc7102dcf8a1b55b0486b4e40", size = 5027237, upload-time = "2026-05-14T12:04:17.675Z" }, + { url = "https://files.pythonhosted.org/packages/1a/ba/4e6214cb38a7b04779e97bb7636de9a5c7f20af7018d03dee0b64c08510a/fonttools-4.63.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:796f27556dbe094c4824f75ca85267e4df776c79036c8441469a4df37038c196", size = 5053933, upload-time = "2026-05-14T12:04:20.818Z" }, + { url = "https://files.pythonhosted.org/packages/34/3b/214dcc19ee31d3d38fb5ad2755c11ef0514e5dc300bbaf41c0b69f393799/fonttools-4.63.0-cp314-cp314t-win32.whl", hash = "sha256:948428a275741f0b64b113c955425a953314f4b9ab9997f73a72c83e68e569c8", size = 2359326, upload-time = "2026-05-14T12:04:24.22Z" }, + { url = "https://files.pythonhosted.org/packages/dd/1e/3ff1a9b523058c2eeb6a9d50f5574e2a738200d0d94107d5bc4105e8da3f/fonttools-4.63.0-cp314-cp314t-win_amd64.whl", hash = "sha256:6d4741eb179121cab9eea4cb2393d24492373a260d7945006358c08cfbf45419", size = 2425829, upload-time = "2026-05-14T12:04:26.829Z" }, + { url = "https://files.pythonhosted.org/packages/2c/47/c99d5268f354002ce80f8d029cd9d7d872969da1de8b93d32de4dc56d6f4/fonttools-4.63.0-py3-none-any.whl", hash = "sha256:445af2eab030a16b9171ea8bdda7ebf7d96bda2df88ee182a464252f6e05e20d", size = 1164562, upload-time = "2026-05-14T12:04:29.092Z" }, +] + +[[package]] +name = "iniconfig" +version = "2.3.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/72/34/14ca021ce8e5dfedc35312d08ba8bf51fdd999c576889fc2c24cb97f4f10/iniconfig-2.3.0.tar.gz", hash = "sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730", size = 20503, upload-time = "2025-10-18T21:55:43.219Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484, upload-time = "2025-10-18T21:55:41.639Z" }, +] + +[[package]] +name = "kiwisolver" +version = "1.5.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d0/67/9c61eccb13f0bdca9307614e782fec49ffdde0f7a2314935d489fa93cd9c/kiwisolver-1.5.0.tar.gz", hash = "sha256:d4193f3d9dc3f6f79aaed0e5637f45d98850ebf01f7ca20e69457f3e8946b66a", size = 103482, upload-time = "2026-03-09T13:15:53.382Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e4/d7/060f45052f2a01ad5762c8fdecd6d7a752b43400dc29ff75cd47225a40fd/kiwisolver-1.5.0-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:8df31fe574b8b3993cc61764f40941111b25c2d9fea13d3ce24a49907cd2d615", size = 123231, upload-time = "2026-03-09T13:14:41.323Z" }, + { url = "https://files.pythonhosted.org/packages/c2/a7/78da680eadd06ff35edef6ef68a1ad273bad3e2a0936c9a885103230aece/kiwisolver-1.5.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:1d49a49ac4cbfb7c1375301cd1ec90169dfeae55ff84710d782260ce77a75a02", size = 66489, upload-time = "2026-03-09T13:14:42.534Z" }, + { url = "https://files.pythonhosted.org/packages/49/b2/97980f3ad4fae37dd7fe31626e2bf75fbf8bdf5d303950ec1fab39a12da8/kiwisolver-1.5.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:0cbe94b69b819209a62cb27bdfa5dc2a8977d8de2f89dfd97ba4f53ed3af754e", size = 64063, upload-time = "2026-03-09T13:14:44.759Z" }, + { url = "https://files.pythonhosted.org/packages/e7/f9/b06c934a6aa8bc91f566bd2a214fd04c30506c2d9e2b6b171953216a65b6/kiwisolver-1.5.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:80aa065ffd378ff784822a6d7c3212f2d5f5e9c3589614b5c228b311fd3063ac", size = 1475913, upload-time = "2026-03-09T13:14:46.247Z" }, + { url = "https://files.pythonhosted.org/packages/6b/f0/f768ae564a710135630672981231320bc403cf9152b5596ec5289de0f106/kiwisolver-1.5.0-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4e7f886f47ab881692f278ae901039a234e4025a68e6dfab514263a0b1c4ae05", size = 1282782, upload-time = "2026-03-09T13:14:48.458Z" }, + { url = "https://files.pythonhosted.org/packages/e2/9f/1de7aad00697325f05238a5f2eafbd487fb637cc27a558b5367a5f37fb7f/kiwisolver-1.5.0-cp314-cp314-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:5060731cc3ed12ca3a8b57acd4aeca5bbc2f49216dd0bec1650a1acd89486bcd", size = 1300815, upload-time = "2026-03-09T13:14:50.721Z" }, + { url = "https://files.pythonhosted.org/packages/5a/c2/297f25141d2e468e0ce7f7a7b92e0cf8918143a0cbd3422c1ad627e85a06/kiwisolver-1.5.0-cp314-cp314-manylinux_2_24_s390x.manylinux_2_28_s390x.whl", hash = "sha256:7a4aa69609f40fce3cbc3f87b2061f042eee32f94b8f11db707b66a26461591a", size = 1347925, upload-time = "2026-03-09T13:14:52.304Z" }, + { url = "https://files.pythonhosted.org/packages/b9/d3/f4c73a02eb41520c47610207b21afa8cdd18fdbf64ffd94674ae21c4812d/kiwisolver-1.5.0-cp314-cp314-manylinux_2_39_riscv64.whl", hash = "sha256:d168fda2dbff7b9b5f38e693182d792a938c31db4dac3a80a4888de603c99554", size = 991322, upload-time = "2026-03-09T13:14:54.637Z" }, + { url = "https://files.pythonhosted.org/packages/7b/46/d3f2efef7732fcda98d22bf4ad5d3d71d545167a852ca710a494f4c15343/kiwisolver-1.5.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:413b820229730d358efd838ecbab79902fe97094565fdc80ddb6b0a18c18a581", size = 2232857, upload-time = "2026-03-09T13:14:56.471Z" }, + { url = "https://files.pythonhosted.org/packages/3f/ec/2d9756bf2b6d26ae4349b8d3662fb3993f16d80c1f971c179ce862b9dbae/kiwisolver-1.5.0-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:5124d1ea754509b09e53738ec185584cc609aae4a3b510aaf4ed6aa047ef9303", size = 2329376, upload-time = "2026-03-09T13:14:58.072Z" }, + { url = "https://files.pythonhosted.org/packages/8f/9f/876a0a0f2260f1bde92e002b3019a5fabc35e0939c7d945e0fa66185eb20/kiwisolver-1.5.0-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:e4415a8db000bf49a6dd1c478bf70062eaacff0f462b92b0ba68791a905861f9", size = 1982549, upload-time = "2026-03-09T13:14:59.668Z" }, + { url = "https://files.pythonhosted.org/packages/6c/4f/ba3624dfac23a64d54ac4179832860cb537c1b0af06024936e82ca4154a0/kiwisolver-1.5.0-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:d618fd27420381a4f6044faa71f46d8bfd911bd077c555f7138ed88729bfbe79", size = 2494680, upload-time = "2026-03-09T13:15:01.364Z" }, + { url = "https://files.pythonhosted.org/packages/39/b7/97716b190ab98911b20d10bf92eca469121ec483b8ce0edd314f51bc85af/kiwisolver-1.5.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:5092eb5b1172947f57d6ea7d89b2f29650414e4293c47707eb499ec07a0ac796", size = 2297905, upload-time = "2026-03-09T13:15:03.925Z" }, + { url = "https://files.pythonhosted.org/packages/a3/36/4e551e8aa55c9188bca9abb5096805edbf7431072b76e2298e34fd3a3008/kiwisolver-1.5.0-cp314-cp314-win_amd64.whl", hash = "sha256:d76e2d8c75051d58177e762164d2e9ab92886534e3a12e795f103524f221dd8e", size = 75086, upload-time = "2026-03-09T13:15:07.775Z" }, + { url = "https://files.pythonhosted.org/packages/70/15/9b90f7df0e31a003c71649cf66ef61c3c1b862f48c81007fa2383c8bd8d7/kiwisolver-1.5.0-cp314-cp314-win_arm64.whl", hash = "sha256:fa6248cd194edff41d7ea9425ced8ca3a6f838bfb295f6f1d6e6bb694a8518df", size = 66577, upload-time = "2026-03-09T13:15:09.139Z" }, + { url = "https://files.pythonhosted.org/packages/17/01/7dc8c5443ff42b38e72731643ed7cf1ed9bf01691ae5cdca98501999ed83/kiwisolver-1.5.0-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:d1ffeb80b5676463d7a7d56acbe8e37a20ce725570e09549fe738e02ca6b7e1e", size = 125794, upload-time = "2026-03-09T13:15:10.525Z" }, + { url = "https://files.pythonhosted.org/packages/46/8a/b4ebe46ebaac6a303417fab10c2e165c557ddaff558f9699d302b256bc53/kiwisolver-1.5.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:bc4d8e252f532ab46a1de9349e2d27b91fce46736a9eedaa37beaca66f574ed4", size = 67646, upload-time = "2026-03-09T13:15:12.016Z" }, + { url = "https://files.pythonhosted.org/packages/60/35/10a844afc5f19d6f567359bf4789e26661755a2f36200d5d1ed8ad0126e5/kiwisolver-1.5.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:6783e069732715ad0c3ce96dbf21dbc2235ab0593f2baf6338101f70371f4028", size = 65511, upload-time = "2026-03-09T13:15:13.311Z" }, + { url = "https://files.pythonhosted.org/packages/f8/8a/685b297052dd041dcebce8e8787b58923b6e78acc6115a0dc9189011c44b/kiwisolver-1.5.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:e7c4c09a490dc4d4a7f8cbee56c606a320f9dc28cf92a7157a39d1ce7676a657", size = 1584858, upload-time = "2026-03-09T13:15:15.103Z" }, + { url = "https://files.pythonhosted.org/packages/9e/80/04865e3d4638ac5bddec28908916df4a3075b8c6cc101786a96803188b96/kiwisolver-1.5.0-cp314-cp314t-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:2a075bd7bd19c70cf67c8badfa36cf7c5d8de3c9ddb8420c51e10d9c50e94920", size = 1392539, upload-time = "2026-03-09T13:15:16.661Z" }, + { url = "https://files.pythonhosted.org/packages/ba/01/77a19cacc0893fa13fafa46d1bba06fb4dc2360b3292baf4b56d8e067b24/kiwisolver-1.5.0-cp314-cp314t-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:bdd3e53429ff02aa319ba59dfe4ceeec345bf46cf180ec2cf6fd5b942e7975e9", size = 1405310, upload-time = "2026-03-09T13:15:18.229Z" }, + { url = "https://files.pythonhosted.org/packages/53/39/bcaf5d0cca50e604cfa9b4e3ae1d64b50ca1ae5b754122396084599ef903/kiwisolver-1.5.0-cp314-cp314t-manylinux_2_24_s390x.manylinux_2_28_s390x.whl", hash = "sha256:3cdcb35dc9d807259c981a85531048ede628eabcffb3239adf3d17463518992d", size = 1456244, upload-time = "2026-03-09T13:15:20.444Z" }, + { url = "https://files.pythonhosted.org/packages/d0/7a/72c187abc6975f6978c3e39b7cf67aeb8b3c0a8f9790aa7fd412855e9e1f/kiwisolver-1.5.0-cp314-cp314t-manylinux_2_39_riscv64.whl", hash = "sha256:70d593af6a6ca332d1df73d519fddb5148edb15cd90d5f0155e3746a6d4fcc65", size = 1073154, upload-time = "2026-03-09T13:15:22.039Z" }, + { url = "https://files.pythonhosted.org/packages/c7/ca/cf5b25783ebbd59143b4371ed0c8428a278abe68d6d0104b01865b1bbd0f/kiwisolver-1.5.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:377815a8616074cabbf3f53354e1d040c35815a134e01d7614b7692e4bf8acfa", size = 2334377, upload-time = "2026-03-09T13:15:23.741Z" }, + { url = "https://files.pythonhosted.org/packages/4a/e5/b1f492adc516796e88751282276745340e2a72dcd0d36cf7173e0daf3210/kiwisolver-1.5.0-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:0255a027391d52944eae1dbb5d4cc5903f57092f3674e8e544cdd2622826b3f0", size = 2425288, upload-time = "2026-03-09T13:15:25.789Z" }, + { url = "https://files.pythonhosted.org/packages/e6/e5/9b21fbe91a61b8f409d74a26498706e97a48008bfcd1864373d32a6ba31c/kiwisolver-1.5.0-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:012b1eb16e28718fa782b5e61dc6f2da1f0792ca73bd05d54de6cb9561665fc9", size = 2063158, upload-time = "2026-03-09T13:15:27.63Z" }, + { url = "https://files.pythonhosted.org/packages/b1/02/83f47986138310f95ea95531f851b2a62227c11cbc3e690ae1374fe49f0f/kiwisolver-1.5.0-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:0e3aafb33aed7479377e5e9a82e9d4bf87063741fc99fc7ae48b0f16e32bdd6f", size = 2597260, upload-time = "2026-03-09T13:15:29.421Z" }, + { url = "https://files.pythonhosted.org/packages/07/18/43a5f24608d8c313dd189cf838c8e68d75b115567c6279de7796197cfb6a/kiwisolver-1.5.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:e7a116ae737f0000343218c4edf5bd45893bfeaff0993c0b215d7124c9f77646", size = 2394403, upload-time = "2026-03-09T13:15:31.517Z" }, + { url = "https://files.pythonhosted.org/packages/3b/b5/98222136d839b8afabcaa943b09bd05888c2d36355b7e448550211d1fca4/kiwisolver-1.5.0-cp314-cp314t-win_amd64.whl", hash = "sha256:1dd9b0b119a350976a6d781e7278ec7aca0b201e1a9e2d23d9804afecb6ca681", size = 79687, upload-time = "2026-03-09T13:15:33.204Z" }, + { url = "https://files.pythonhosted.org/packages/99/a2/ca7dc962848040befed12732dff6acae7fb3c4f6fc4272b3f6c9a30b8713/kiwisolver-1.5.0-cp314-cp314t-win_arm64.whl", hash = "sha256:58f812017cd2985c21fbffb4864d59174d4903dd66fa23815e74bbc7a0e2dd57", size = 70032, upload-time = "2026-03-09T13:15:34.411Z" }, +] + +[[package]] +name = "llvmlite" +version = "0.47.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/01/88/a8952b6d5c21e74cbf158515b779666f692846502623e9e3c39d8e8ba25f/llvmlite-0.47.0.tar.gz", hash = "sha256:62031ce968ec74e95092184d4b0e857e444f8fdff0b8f9213707699570c33ccc", size = 193614, upload-time = "2026-03-31T18:29:53.497Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/1c/d4/33c8af00f0bf6f552d74f3a054f648af2c5bc6bece97972f3bfadce4f5ec/llvmlite-0.47.0-cp314-cp314-macosx_12_0_arm64.whl", hash = "sha256:de966c626c35c9dff5ae7bf12db25637738d0df83fc370cf793bc94d43d92d14", size = 37232773, upload-time = "2026-03-31T18:29:19.453Z" }, + { url = "https://files.pythonhosted.org/packages/64/1d/a760e993e0c0ba6db38d46b9f48f6c7dceb8ac838824997fb9e25f97bc04/llvmlite-0.47.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:ddbccff2aeaff8670368340a158abefc032fe9b3ccf7d9c496639263d00151aa", size = 56275176, upload-time = "2026-03-31T18:29:24.149Z" }, + { url = "https://files.pythonhosted.org/packages/84/3b/e679bc3b29127182a7f4aa2d2e9e5bea42adb93fb840484147d59c236299/llvmlite-0.47.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d4a7b778a2e144fc64468fb9bf509ac1226c9813a00b4d7afea5d988c4e22fca", size = 55128631, upload-time = "2026-03-31T18:29:29.536Z" }, + { url = "https://files.pythonhosted.org/packages/be/f7/19e2a09c62809c9e63bbd14ce71fb92c6ff7b7b3045741bb00c781efc3c9/llvmlite-0.47.0-cp314-cp314-win_amd64.whl", hash = "sha256:694e3c2cdc472ed2bd8bd4555ca002eec4310961dd58ef791d508f57b5cc4c94", size = 39153826, upload-time = "2026-03-31T18:29:33.681Z" }, + { url = "https://files.pythonhosted.org/packages/40/a1/581a8c707b5e80efdbbe1dd94527404d33fe50bceb71f39d5a7e11bd57b7/llvmlite-0.47.0-cp314-cp314t-macosx_12_0_arm64.whl", hash = "sha256:92ec8a169a20b473c1c54d4695e371bde36489fc1efa3688e11e99beba0abf9c", size = 37232772, upload-time = "2026-03-31T18:29:37.952Z" }, + { url = "https://files.pythonhosted.org/packages/11/03/16090dd6f74ba2b8b922276047f15962fbeea0a75d5601607edb301ba945/llvmlite-0.47.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:fa1cbd800edd3b20bc141521f7fd45a6185a5b84109aa6855134e81397ffe72b", size = 56275178, upload-time = "2026-03-31T18:29:42.58Z" }, + { url = "https://files.pythonhosted.org/packages/f5/cb/0abf1dd4c5286a95ffe0c1d8c67aec06b515894a0dd2ac97f5e27b82ab0b/llvmlite-0.47.0-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f6725179b89f03b17dabe236ff3422cb8291b4c1bf40af152826dfd34e350ae8", size = 55128632, upload-time = "2026-03-31T18:29:46.939Z" }, + { url = "https://files.pythonhosted.org/packages/4f/79/d3bbab197e86e0ff4f9c07122895b66a3e0d024247fcff7f12c473cb36d9/llvmlite-0.47.0-cp314-cp314t-win_amd64.whl", hash = "sha256:6842cf6f707ec4be3d985a385ad03f72b2d724439e118fcbe99b2929964f0453", size = 39153839, upload-time = "2026-03-31T18:29:51.004Z" }, +] + +[[package]] +name = "matplotlib" +version = "3.10.9" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "contourpy" }, + { name = "cycler" }, + { name = "fonttools" }, + { name = "kiwisolver" }, + { name = "numpy" }, + { name = "packaging" }, + { name = "pillow" }, + { name = "pyparsing" }, + { name = "python-dateutil" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/63/1b/4be5be87d43d327a0cf4de1a56e86f7f84c89312452406cf122efe2839e6/matplotlib-3.10.9.tar.gz", hash = "sha256:fd66508e8c6877d98e586654b608a0456db8d7e8a546eb1e2600efd957302358", size = 34811233, upload-time = "2026-04-24T00:14:13.539Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d6/e6/3bd8afd04949f02eabc1c17115ea5255e19cacd4d06fc5abdde4eeb0052c/matplotlib-3.10.9-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:172db52c9e683f5d12eaf57f0f54834190e12581fe1cc2a19595a8f5acb4e77d", size = 8321276, upload-time = "2026-04-24T00:13:18.318Z" }, + { url = "https://files.pythonhosted.org/packages/41/86/86231232fff41c9f8e4a1a7d7a597d349a02527109c3af7d618366122139/matplotlib-3.10.9-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:97e35e8d39ccc85859095e01a53847432ba9a53ddf7986f7a54a11b73d0e143f", size = 8218218, upload-time = "2026-04-24T00:13:20.974Z" }, + { url = "https://files.pythonhosted.org/packages/85/8f/becc9722cafc64f5d2eb0b7c1bf5f585271c618a45dbd8fabeb021f898b6/matplotlib-3.10.9-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:aba1615dabe83188e19d4f75a253c6a08423e04c1425e64039f800050a69de6b", size = 9608145, upload-time = "2026-04-24T00:13:23.228Z" }, + { url = "https://files.pythonhosted.org/packages/32/5d/f7e914f7d9325abff4057cee62c0fa70263683189f774473cbfb534cd13b/matplotlib-3.10.9-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:34cf8167e023ad956c15f36302911d5406bd99a9862c1a8499ea6f7c0e015dc2", size = 9885085, upload-time = "2026-04-24T00:13:25.849Z" }, + { url = "https://files.pythonhosted.org/packages/a5/fd/fa69f2221534e80cc5772ac2b7d222011a2acafc2ec7216d5dd174c864ae/matplotlib-3.10.9-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:59476c6d29d612b8e9bb6ce8c5b631be6ba8f9e3a2421f22a02b192c7dd28716", size = 9672358, upload-time = "2026-04-24T00:13:28.906Z" }, + { url = "https://files.pythonhosted.org/packages/ab/1a/5a4f747a8b271cbb024946d2dd3c913ab5032ba430626f8c3528ada96b4b/matplotlib-3.10.9-cp314-cp314-win_amd64.whl", hash = "sha256:336b9acc64d309063126edcdaca00db9373af3c476bb94388fe9c5a53ad13e6f", size = 8349970, upload-time = "2026-04-24T00:13:31.904Z" }, + { url = "https://files.pythonhosted.org/packages/64/dc/95d60ecaefe30680a154b52ea96ab4b0dab547f1fd6aa12f5fb655e89cae/matplotlib-3.10.9-cp314-cp314-win_arm64.whl", hash = "sha256:2dc9477819ffd78ad12a20df1d9d6a6bd4fec6aaa9072681465fddca052f1456", size = 8272785, upload-time = "2026-04-24T00:13:34.511Z" }, + { url = "https://files.pythonhosted.org/packages/70/a0/005d68bc8b8418300ce6591f18586910a8526806e2ab663933d9f20a41e9/matplotlib-3.10.9-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:da4e09638420548f31c354032a6250e473c68e5a4e96899b4844cf39ddea23fe", size = 8367999, upload-time = "2026-04-24T00:13:36.962Z" }, + { url = "https://files.pythonhosted.org/packages/22/05/1236cc9290be70b2498af20ca348add76e3fffe7f67b477db5133a84f3ea/matplotlib-3.10.9-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:345f6f68ecc8da0ca56fad2ea08fde1a115eda530079eca185d50a7bc3e146c6", size = 8264543, upload-time = "2026-04-24T00:13:39.851Z" }, + { url = "https://files.pythonhosted.org/packages/cd/c2/071f5a5ff6c5bd63aaaf2f45c811d9bf2ced94bde188d9e1a519e21d0cba/matplotlib-3.10.9-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4edcfbd8565339aa62f1cd4012f7180926fdbe71850f7b0d3c379c175cd6b66c", size = 9622800, upload-time = "2026-04-24T00:13:42.296Z" }, + { url = "https://files.pythonhosted.org/packages/95/57/da7d1f10a85624b9e7db68e069dd94e58dc41dbf9463c5921632ecbe3661/matplotlib-3.10.9-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6be157fe17fc37cb95ac1d7374cf717ce9259616edec911a78d9d26dae8522d4", size = 9888561, upload-time = "2026-04-24T00:13:45.026Z" }, + { url = "https://files.pythonhosted.org/packages/67/b2/ef8d6bb59b0edb6c16c968b70f548aa13b54348972def5aa6ac85df67145/matplotlib-3.10.9-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:4e42042d54db34fda4e95a7bd3e5789c2a995d2dad3eb8850232ee534092fbbf", size = 9680884, upload-time = "2026-04-24T00:13:48.066Z" }, + { url = "https://files.pythonhosted.org/packages/61/1c/d21bfeb9931881ebe96bcfcff27c7ae4b160ae0ec291a714c42641a56d75/matplotlib-3.10.9-cp314-cp314t-win_amd64.whl", hash = "sha256:c27df8b3848f32a83d1767566595e43cfaa4460380974da06f4279a7ec143c39", size = 8432333, upload-time = "2026-04-24T00:13:51.008Z" }, + { url = "https://files.pythonhosted.org/packages/78/23/92493c3e6e1b635ccfff146f7b99e674808787915420373ac399283764c2/matplotlib-3.10.9-cp314-cp314t-win_arm64.whl", hash = "sha256:a49f1eadc84ca85fd72fa4e89e70e61bf86452df6f971af04b12c60761a0772c", size = 8324785, upload-time = "2026-04-24T00:13:53.633Z" }, +] + +[[package]] +name = "mpmath" +version = "1.3.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/e0/47/dd32fa426cc72114383ac549964eecb20ecfd886d1e5ccf5340b55b02f57/mpmath-1.3.0.tar.gz", hash = "sha256:7a28eb2a9774d00c7bc92411c19a89209d5da7c4c9a9e227be8330a23a25b91f", size = 508106, upload-time = "2023-03-07T16:47:11.061Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/43/e3/7d92a15f894aa0c9c4b49b8ee9ac9850d6e63b03c9c32c0367a13ae62209/mpmath-1.3.0-py3-none-any.whl", hash = "sha256:a0b2b9fe80bbcd81a6647ff13108738cfb482d481d826cc0e02f5b35e5c88d2c", size = 536198, upload-time = "2023-03-07T16:47:09.197Z" }, +] + +[[package]] +name = "numba" +version = "0.65.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "llvmlite" }, + { name = "numpy" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/f6/c5/db2ac3685833d626c0dcae6bd2330cd68433e1fd248d15f70998160d3ad7/numba-0.65.1.tar.gz", hash = "sha256:19357146c32fe9ed25059ab915e8465fb13951cf6b0aace3826b76886373ab23", size = 2765600, upload-time = "2026-04-24T02:02:56.551Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/4f/2e/8aed9b726d9ba5f11ad287645fd479e88278db3060a25cb1225d730eb2b7/numba-0.65.1-cp314-cp314-macosx_12_0_arm64.whl", hash = "sha256:33f5eb68eb1c843511615d14663ce60258525d6a4c65ab040e2c2b0c4cf17450", size = 2681554, upload-time = "2026-04-24T02:02:41.812Z" }, + { url = "https://files.pythonhosted.org/packages/87/96/f3eb235fafa82a34e2ab5dd7dc9ffff998ebf5f0bbc23fa56a96aeb44da6/numba-0.65.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:71e73029bf53a62cc6afcf96be4bd942290d8b4c55f0a454fb536158115790f7", size = 3779602, upload-time = "2026-04-24T02:02:43.726Z" }, + { url = "https://files.pythonhosted.org/packages/09/90/b0f09b48752d23640b8284f22aa597737e8adaddc7fbfacc4708b7f73a4c/numba-0.65.1-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3a07635e0be926b9bdbffb09137c230fb13f6ec0e564914ba937cee12ce3eb35", size = 3479532, upload-time = "2026-04-24T02:02:45.427Z" }, + { url = "https://files.pythonhosted.org/packages/56/46/3f7fc04fb853559e74b210e0b62c19974ec844cefec611f9e535f4da3761/numba-0.65.1-cp314-cp314-win_amd64.whl", hash = "sha256:2a20fcdabdefbdacf88d85caf70c3b18c4bcb7ebb8f82e6a19486383dd26ab63", size = 2752637, upload-time = "2026-04-24T02:02:47.664Z" }, + { url = "https://files.pythonhosted.org/packages/81/7b/c1a341a9067367778f4152a5f01061cf281fb09582c92c510ec4918cabf6/numba-0.65.1-cp314-cp314t-macosx_12_0_arm64.whl", hash = "sha256:548dd4b3a4508d5062768d1514b2cd7b015f9a25ec7af651c50dee243965e652", size = 2684600, upload-time = "2026-04-24T02:02:49.653Z" }, + { url = "https://files.pythonhosted.org/packages/03/36/98ddbcf3e4f04a6dd07e1c67249955920579ba4af6bb6868e3088f4ed282/numba-0.65.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:78abc28feff2c2ff8307fff3975b6438352759c9acb797ecd6b1fb6e7e39e31d", size = 3817198, upload-time = "2026-04-24T02:02:51.266Z" }, + { url = "https://files.pythonhosted.org/packages/a3/83/0dad21057ece5a835599f5d24099b091703995e23dbbf894f259e91c010b/numba-0.65.1-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ee7676cb389555805f9b9a1840cbcd1ea6c8bd5376ab6918e3a29c5ea1dbda20", size = 3533862, upload-time = "2026-04-24T02:02:52.987Z" }, + { url = "https://files.pythonhosted.org/packages/32/36/8be7118ffd4c8440881046eac3d0982cc5ab42909508cf5d67024d62a2e4/numba-0.65.1-cp314-cp314t-win_amd64.whl", hash = "sha256:20609346e3bd75204950dcbbfe383a8d7dbf4902f442aedbf00f97fef4aa8f38", size = 2758237, upload-time = "2026-04-24T02:02:54.612Z" }, +] + +[[package]] +name = "numpy" +version = "2.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d0/ad/fed0499ce6a338d2a03ebae59cd15093910c8875328855781952abf6c2fe/numpy-2.4.6.tar.gz", hash = "sha256:f3a3570c4a2a16746ac2c31a7c7c7b0c186b95ce902e33db6f28094ed7387dda", size = 20735807, upload-time = "2026-05-18T23:37:14.07Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f8/91/3ab2044d05fd16d343c5ac2e69b127f1b2854040dd20b193257c78028bd3/numpy-2.4.6-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:06ca2f61ec4385a07a6977c55ba998a4466c123642b4a32694d3128fce18c079", size = 16683458, upload-time = "2026-05-18T23:35:38.353Z" }, + { url = "https://files.pythonhosted.org/packages/8e/62/764ce66fa4147ae6d73071a3abf804ffe606f174618697c571acdf26a7c9/numpy-2.4.6-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:38efbc8de75c7a0fc1ac190162d892787f3f47b57cc291231aafee36b80982b7", size = 14704559, upload-time = "2026-05-18T23:35:42.14Z" }, + { url = "https://files.pythonhosted.org/packages/60/61/23f27c172f022e04025b7dc2367f4d63c1a398120607ec896228649a6f48/numpy-2.4.6-cp314-cp314-macosx_14_0_arm64.whl", hash = "sha256:d581b735e177fdcdce6fed8e7e8880a3fb6ee4e3653a3ac6af01c6f4c03effc5", size = 5209716, upload-time = "2026-05-18T23:35:45.377Z" }, + { url = "https://files.pythonhosted.org/packages/03/71/21cf70dc6ea3e3acb95fc53a265b2fc248b981f0194ceb5b475271b8809d/numpy-2.4.6-cp314-cp314-macosx_14_0_x86_64.whl", hash = "sha256:0a041d3d761dc3c35cc56ce0351506a02bcbc25f7b169f652435141a17db9096", size = 6543947, upload-time = "2026-05-18T23:35:47.926Z" }, + { url = "https://files.pythonhosted.org/packages/d5/91/64288395ee1799bd2e0b04a305dce9666da90c961e1f3fe982a05ee1c036/numpy-2.4.6-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:40fdc1ae7125e518ea98e53e69a4ebc27e1fd50510c47b7ea130cf21e5e1d42b", size = 15685197, upload-time = "2026-05-18T23:35:50.863Z" }, + { url = "https://files.pythonhosted.org/packages/f3/eb/ebffaa97dc55502df69584a8f0dcf07f69a3e0b3e2323670a2722db9aa39/numpy-2.4.6-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a2c306dea656c12c68f51f4cea133cbe78ca7435eb28c735eac1d3ebe73be6e8", size = 16638245, upload-time = "2026-05-18T23:35:54.752Z" }, + { url = "https://files.pythonhosted.org/packages/b8/0b/54f9da33128d7e350fab89c7455902eeae70349ee52bddb448dc4a576f45/numpy-2.4.6-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:33111801a01c12a8a1e3721f0a9232f8cfc8ae2c6b7098167e6f623c6073f402", size = 17036587, upload-time = "2026-05-18T23:35:58.355Z" }, + { url = "https://files.pythonhosted.org/packages/b6/f0/fdebc1052db1cc37c64beb22072d67cd6d1c71adca1299f53dec2b5e20d3/numpy-2.4.6-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:ae506e6902902557576a26ff33eda8695e7ecb3cb36c3b573a0765dee114ebdb", size = 18363226, upload-time = "2026-05-18T23:36:02.845Z" }, + { url = "https://files.pythonhosted.org/packages/aa/b4/298628d98c72b57e57f7165ae6a481a1deaf6f3c28262a6e4c739c275930/numpy-2.4.6-cp314-cp314-win32.whl", hash = "sha256:aaf159caa35993cb1f56fb9b8e4610d35758e7ca005412eb1daa856a78c9c4b1", size = 6010196, upload-time = "2026-05-18T23:36:05.92Z" }, + { url = "https://files.pythonhosted.org/packages/df/ac/46de6dda46478f7942f839e094970be2d4a861e005c4b3bf07c92e291a09/numpy-2.4.6-cp314-cp314-win_amd64.whl", hash = "sha256:b507f5c4c1d508876d1819b6bf9a49d365b96320b5d4993426b33a23ca4b8261", size = 12450334, upload-time = "2026-05-18T23:36:09.107Z" }, + { url = "https://files.pythonhosted.org/packages/78/92/b8b798ac784102c0da830d2257d59358e3d3d90d1e2b3f2575dad976c5cf/numpy-2.4.6-cp314-cp314-win_arm64.whl", hash = "sha256:6f41ae150c4e32db4f3310cdaf64b1593a03dbabe29eec77fc9b50fe64061df6", size = 10495678, upload-time = "2026-05-18T23:36:12.766Z" }, + { url = "https://files.pythonhosted.org/packages/30/34/ec28d1aa8115971537c01469ab2011ee96827930f0a124de1000cc2a7ed7/numpy-2.4.6-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:ece3d2cfe132e7d51f44a832b303895e6f2d499c5e74dfbdb06ee246147a304a", size = 14823672, upload-time = "2026-05-18T23:36:16.473Z" }, + { url = "https://files.pythonhosted.org/packages/16/bd/f6d1fede4e54e8042a7ff97bb495510f3c220f94bcd9e8b228e87c92cc0d/numpy-2.4.6-cp314-cp314t-macosx_14_0_arm64.whl", hash = "sha256:e3e5193ef5a3dc73bceee50f7fdc2c90dbb76c42df8d8fae3d1067a583df579e", size = 5328731, upload-time = "2026-05-18T23:36:19.767Z" }, + { url = "https://files.pythonhosted.org/packages/f4/f0/e105b9e2fd728a9910103884decd6951d9dd73896b914a98d9a231de02ee/numpy-2.4.6-cp314-cp314t-macosx_14_0_x86_64.whl", hash = "sha256:17f9ade344e7d9b464a084d69bcf18fc691cb1db67c62ed80820bf4926d78f0e", size = 6649805, upload-time = "2026-05-18T23:36:22.266Z" }, + { url = "https://files.pythonhosted.org/packages/82/dd/1206a7ca6ab15e3f02069707ca96222e202af681bb73756da7527f3cb837/numpy-2.4.6-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9cd5ffd25db4e7ba6a375693b3fc0fc1791ec636c17db3720da19bde7180ec43", size = 15730496, upload-time = "2026-05-18T23:36:25.713Z" }, + { url = "https://files.pythonhosted.org/packages/51/e7/38d3ea825dcab85a591734decb2f6c67caa7c8367d374df1a1c3842f9b07/numpy-2.4.6-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7d92c3819208a60205a12a245c91ad70cb0a85336659b19b834205573ac8456e", size = 16679616, upload-time = "2026-05-18T23:36:29.652Z" }, + { url = "https://files.pythonhosted.org/packages/93/b7/caabfdf53edf663e0b4eb74d7d405d83baef09eb5e83bcd32d601d72b93e/numpy-2.4.6-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:e85b752a1e912b70eaad4fafbd4d1238007ab221de2009b9a2f5ae7461239895", size = 17085145, upload-time = "2026-05-18T23:36:33.449Z" }, + { url = "https://files.pythonhosted.org/packages/f9/45/68d7c33a6bcf3e5aa3bdbd57a367e6f615286dfd6482f97e8ffeb734306e/numpy-2.4.6-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:29cb7f67d10b479ff07c17d33e39f78c07f71c40ef30d63c153d340e96cd3fb4", size = 18403813, upload-time = "2026-05-18T23:36:37.369Z" }, + { url = "https://files.pythonhosted.org/packages/9c/50/0753655aa844c99cd9e018aacf76f130f1bd81d881bb74bc0aef5d73a8ba/numpy-2.4.6-cp314-cp314t-win32.whl", hash = "sha256:260a5d70215b61ab4fadf5c7baacd64821842975eea312125ed3c39a6391b063", size = 6156982, upload-time = "2026-05-18T23:36:40.817Z" }, + { url = "https://files.pythonhosted.org/packages/b2/d4/7c67becf668f973cb490cec3e98dfd799d866f9c989a54d355672cfa0db6/numpy-2.4.6-cp314-cp314t-win_amd64.whl", hash = "sha256:81a1cca95ed5bb92aa8b10dd2cdc9a0d3853a50fad926c28b5d7e8ea54389627", size = 12638908, upload-time = "2026-05-18T23:36:43.996Z" }, + { url = "https://files.pythonhosted.org/packages/43/bb/e1c71a4295b1b1d1393d50dbb4f2a36283c6859d9d3892e84f00ec5a91d5/numpy-2.4.6-cp314-cp314t-win_arm64.whl", hash = "sha256:0c9136e14ed34a9e343a31c533d78a9813a69a3148332bce5e9821cb2f996e66", size = 10565867, upload-time = "2026-05-18T23:36:47.114Z" }, +] + +[[package]] +name = "packaging" +version = "26.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d7/f1/e7a6dd94a8d4a5626c03e4e99c87f241ba9e350cd9e6d75123f992427270/packaging-26.2.tar.gz", hash = "sha256:ff452ff5a3e828ce110190feff1178bb1f2ea2281fa2075aadb987c2fb221661", size = 228134, upload-time = "2026-04-24T20:15:23.917Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/df/b2/87e62e8c3e2f4b32e5fe99e0b86d576da1312593b39f47d8ceef365e95ed/packaging-26.2-py3-none-any.whl", hash = "sha256:5fc45236b9446107ff2415ce77c807cee2862cb6fac22b8a73826d0693b0980e", size = 100195, upload-time = "2026-04-24T20:15:22.081Z" }, +] + +[[package]] +name = "pillow" +version = "12.2.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/8c/21/c2bcdd5906101a30244eaffc1b6e6ce71a31bd0742a01eb89e660ebfac2d/pillow-12.2.0.tar.gz", hash = "sha256:a830b1a40919539d07806aa58e1b114df53ddd43213d9c8b75847eee6c0182b5", size = 46987819, upload-time = "2026-04-01T14:46:17.687Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/bf/98/4595daa2365416a86cb0d495248a393dfc84e96d62ad080c8546256cb9c0/pillow-12.2.0-cp314-cp314-ios_13_0_arm64_iphoneos.whl", hash = "sha256:3adc9215e8be0448ed6e814966ecf3d9952f0ea40eb14e89a102b87f450660d8", size = 4100848, upload-time = "2026-04-01T14:44:48.48Z" }, + { url = "https://files.pythonhosted.org/packages/0b/79/40184d464cf89f6663e18dfcf7ca21aae2491fff1a16127681bf1fa9b8cf/pillow-12.2.0-cp314-cp314-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:6a9adfc6d24b10f89588096364cc726174118c62130c817c2837c60cf08a392b", size = 4176515, upload-time = "2026-04-01T14:44:51.353Z" }, + { url = "https://files.pythonhosted.org/packages/b0/63/703f86fd4c422a9cf722833670f4f71418fb116b2853ff7da722ea43f184/pillow-12.2.0-cp314-cp314-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:6a6e67ea2e6feda684ed370f9a1c52e7a243631c025ba42149a2cc5934dec295", size = 3640159, upload-time = "2026-04-01T14:44:53.588Z" }, + { url = "https://files.pythonhosted.org/packages/71/e0/fb22f797187d0be2270f83500aab851536101b254bfa1eae10795709d283/pillow-12.2.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:2bb4a8d594eacdfc59d9e5ad972aa8afdd48d584ffd5f13a937a664c3e7db0ed", size = 5312185, upload-time = "2026-04-01T14:44:56.039Z" }, + { url = "https://files.pythonhosted.org/packages/ba/8c/1a9e46228571de18f8e28f16fabdfc20212a5d019f3e3303452b3f0a580d/pillow-12.2.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:80b2da48193b2f33ed0c32c38140f9d3186583ce7d516526d462645fd98660ae", size = 4695386, upload-time = "2026-04-01T14:44:58.663Z" }, + { url = "https://files.pythonhosted.org/packages/70/62/98f6b7f0c88b9addd0e87c217ded307b36be024d4ff8869a812b241d1345/pillow-12.2.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:22db17c68434de69d8ecfc2fe821569195c0c373b25cccb9cbdacf2c6e53c601", size = 6280384, upload-time = "2026-04-01T14:45:01.5Z" }, + { url = "https://files.pythonhosted.org/packages/5e/03/688747d2e91cfbe0e64f316cd2e8005698f76ada3130d0194664174fa5de/pillow-12.2.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:7b14cc0106cd9aecda615dd6903840a058b4700fcb817687d0ee4fc8b6e389be", size = 8091599, upload-time = "2026-04-01T14:45:04.5Z" }, + { url = "https://files.pythonhosted.org/packages/f6/35/577e22b936fcdd66537329b33af0b4ccfefaeabd8aec04b266528cddb33c/pillow-12.2.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8cbeb542b2ebc6fcdacabf8aca8c1a97c9b3ad3927d46b8723f9d4f033288a0f", size = 6396021, upload-time = "2026-04-01T14:45:07.117Z" }, + { url = "https://files.pythonhosted.org/packages/11/8d/d2532ad2a603ca2b93ad9f5135732124e57811d0168155852f37fbce2458/pillow-12.2.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4bfd07bc812fbd20395212969e41931001fd59eb55a60658b0e5710872e95286", size = 7083360, upload-time = "2026-04-01T14:45:09.763Z" }, + { url = "https://files.pythonhosted.org/packages/5e/26/d325f9f56c7e039034897e7380e9cc202b1e368bfd04d4cbe6a441f02885/pillow-12.2.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:9aba9a17b623ef750a4d11b742cbafffeb48a869821252b30ee21b5e91392c50", size = 6507628, upload-time = "2026-04-01T14:45:12.378Z" }, + { url = "https://files.pythonhosted.org/packages/5f/f7/769d5632ffb0988f1c5e7660b3e731e30f7f8ec4318e94d0a5d674eb65a4/pillow-12.2.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:deede7c263feb25dba4e82ea23058a235dcc2fe1f6021025dc71f2b618e26104", size = 7209321, upload-time = "2026-04-01T14:45:15.122Z" }, + { url = "https://files.pythonhosted.org/packages/6a/7a/c253e3c645cd47f1aceea6a8bacdba9991bf45bb7dfe927f7c893e89c93c/pillow-12.2.0-cp314-cp314-win32.whl", hash = "sha256:632ff19b2778e43162304d50da0181ce24ac5bb8180122cbe1bf4673428328c7", size = 6479723, upload-time = "2026-04-01T14:45:17.797Z" }, + { url = "https://files.pythonhosted.org/packages/cd/8b/601e6566b957ca50e28725cb6c355c59c2c8609751efbecd980db44e0349/pillow-12.2.0-cp314-cp314-win_amd64.whl", hash = "sha256:4e6c62e9d237e9b65fac06857d511e90d8461a32adcc1b9065ea0c0fa3a28150", size = 7217400, upload-time = "2026-04-01T14:45:20.529Z" }, + { url = "https://files.pythonhosted.org/packages/d6/94/220e46c73065c3e2951bb91c11a1fb636c8c9ad427ac3ce7d7f3359b9b2f/pillow-12.2.0-cp314-cp314-win_arm64.whl", hash = "sha256:b1c1fbd8a5a1af3412a0810d060a78b5136ec0836c8a4ef9aa11807f2a22f4e1", size = 2554835, upload-time = "2026-04-01T14:45:23.162Z" }, + { url = "https://files.pythonhosted.org/packages/b6/ab/1b426a3974cb0e7da5c29ccff4807871d48110933a57207b5a676cccc155/pillow-12.2.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:57850958fe9c751670e49b2cecf6294acc99e562531f4bd317fa5ddee2068463", size = 5314225, upload-time = "2026-04-01T14:45:25.637Z" }, + { url = "https://files.pythonhosted.org/packages/19/1e/dce46f371be2438eecfee2a1960ee2a243bbe5e961890146d2dee1ff0f12/pillow-12.2.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:d5d38f1411c0ed9f97bcb49b7bd59b6b7c314e0e27420e34d99d844b9ce3b6f3", size = 4698541, upload-time = "2026-04-01T14:45:28.355Z" }, + { url = "https://files.pythonhosted.org/packages/55/c3/7fbecf70adb3a0c33b77a300dc52e424dc22ad8cdc06557a2e49523b703d/pillow-12.2.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:5c0a9f29ca8e79f09de89293f82fc9b0270bb4af1d58bc98f540cc4aedf03166", size = 6322251, upload-time = "2026-04-01T14:45:30.924Z" }, + { url = "https://files.pythonhosted.org/packages/1c/3c/7fbc17cfb7e4fe0ef1642e0abc17fc6c94c9f7a16be41498e12e2ba60408/pillow-12.2.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:1610dd6c61621ae1cf811bef44d77e149ce3f7b95afe66a4512f8c59f25d9ebe", size = 8127807, upload-time = "2026-04-01T14:45:33.908Z" }, + { url = "https://files.pythonhosted.org/packages/ff/c3/a8ae14d6defd2e448493ff512fae903b1e9bd40b72efb6ec55ce0048c8ce/pillow-12.2.0-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0a34329707af4f73cf1782a36cd2289c0368880654a2c11f027bcee9052d35dd", size = 6433935, upload-time = "2026-04-01T14:45:36.623Z" }, + { url = "https://files.pythonhosted.org/packages/6e/32/2880fb3a074847ac159d8f902cb43278a61e85f681661e7419e6596803ed/pillow-12.2.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8e9c4f5b3c546fa3458a29ab22646c1c6c787ea8f5ef51300e5a60300736905e", size = 7116720, upload-time = "2026-04-01T14:45:39.258Z" }, + { url = "https://files.pythonhosted.org/packages/46/87/495cc9c30e0129501643f24d320076f4cc54f718341df18cc70ec94c44e1/pillow-12.2.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:fb043ee2f06b41473269765c2feae53fc2e2fbf96e5e22ca94fb5ad677856f06", size = 6540498, upload-time = "2026-04-01T14:45:41.879Z" }, + { url = "https://files.pythonhosted.org/packages/18/53/773f5edca692009d883a72211b60fdaf8871cbef075eaa9d577f0a2f989e/pillow-12.2.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:f278f034eb75b4e8a13a54a876cc4a5ab39173d2cdd93a638e1b467fc545ac43", size = 7239413, upload-time = "2026-04-01T14:45:44.705Z" }, + { url = "https://files.pythonhosted.org/packages/c9/e4/4b64a97d71b2a83158134abbb2f5bd3f8a2ea691361282f010998f339ec7/pillow-12.2.0-cp314-cp314t-win32.whl", hash = "sha256:6bb77b2dcb06b20f9f4b4a8454caa581cd4dd0643a08bacf821216a16d9c8354", size = 6482084, upload-time = "2026-04-01T14:45:47.568Z" }, + { url = "https://files.pythonhosted.org/packages/ba/13/306d275efd3a3453f72114b7431c877d10b1154014c1ebbedd067770d629/pillow-12.2.0-cp314-cp314t-win_amd64.whl", hash = "sha256:6562ace0d3fb5f20ed7290f1f929cae41b25ae29528f2af1722966a0a02e2aa1", size = 7225152, upload-time = "2026-04-01T14:45:50.032Z" }, + { url = "https://files.pythonhosted.org/packages/ff/6e/cf826fae916b8658848d7b9f38d88da6396895c676e8086fc0988073aaf8/pillow-12.2.0-cp314-cp314t-win_arm64.whl", hash = "sha256:aa88ccfe4e32d362816319ed727a004423aab09c5cea43c01a4b435643fa34eb", size = 2556579, upload-time = "2026-04-01T14:45:52.529Z" }, +] + +[[package]] +name = "pluggy" +version = "1.6.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f9/e2/3e91f31a7d2b083fe6ef3fa267035b518369d9511ffab804f839851d2779/pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3", size = 69412, upload-time = "2025-05-15T12:30:07.975Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538, upload-time = "2025-05-15T12:30:06.134Z" }, +] + +[[package]] +name = "pygments" +version = "2.20.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/c3/b2/bc9c9196916376152d655522fdcebac55e66de6603a76a02bca1b6414f6c/pygments-2.20.0.tar.gz", hash = "sha256:6757cd03768053ff99f3039c1a36d6c0aa0b263438fcab17520b30a303a82b5f", size = 4955991, upload-time = "2026-03-29T13:29:33.898Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f4/7e/a72dd26f3b0f4f2bf1dd8923c85f7ceb43172af56d63c7383eb62b332364/pygments-2.20.0-py3-none-any.whl", hash = "sha256:81a9e26dd42fd28a23a2d169d86d7ac03b46e2f8b59ed4698fb4785f946d0176", size = 1231151, upload-time = "2026-03-29T13:29:30.038Z" }, +] + +[[package]] +name = "pyparsing" +version = "3.3.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f3/91/9c6ee907786a473bf81c5f53cf703ba0957b23ab84c264080fb5a450416f/pyparsing-3.3.2.tar.gz", hash = "sha256:c777f4d763f140633dcb6d8a3eda953bf7a214dc4eff598413c070bcdc117cbc", size = 6851574, upload-time = "2026-01-21T03:57:59.36Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/10/bd/c038d7cc38edc1aa5bf91ab8068b63d4308c66c4c8bb3cbba7dfbc049f9c/pyparsing-3.3.2-py3-none-any.whl", hash = "sha256:850ba148bd908d7e2411587e247a1e4f0327839c40e2e5e6d05a007ecc69911d", size = 122781, upload-time = "2026-01-21T03:57:55.912Z" }, +] + +[[package]] +name = "pytest" +version = "9.0.3" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "iniconfig" }, + { name = "packaging" }, + { name = "pluggy" }, + { name = "pygments" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/7d/0d/549bd94f1a0a402dc8cf64563a117c0f3765662e2e668477624baeec44d5/pytest-9.0.3.tar.gz", hash = "sha256:b86ada508af81d19edeb213c681b1d48246c1a91d304c6c81a427674c17eb91c", size = 1572165, upload-time = "2026-04-07T17:16:18.027Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d4/24/a372aaf5c9b7208e7112038812994107bc65a84cd00e0354a88c2c77a617/pytest-9.0.3-py3-none-any.whl", hash = "sha256:2c5efc453d45394fdd706ade797c0a81091eccd1d6e4bccfcd476e2b8e0ab5d9", size = 375249, upload-time = "2026-04-07T17:16:16.13Z" }, +] + +[[package]] +name = "python-dateutil" +version = "2.9.0.post0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "six" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/66/c0/0c8b6ad9f17a802ee498c46e004a0eb49bc148f2fd230864601a86dcf6db/python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3", size = 342432, upload-time = "2024-03-01T18:36:20.211Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ec/57/56b9bcc3c9c6a792fcbaf139543cee77261f3651ca9da0c93f5c1221264b/python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427", size = 229892, upload-time = "2024-03-01T18:36:18.57Z" }, +] + +[[package]] +name = "rootfinding" +version = "0.1.0" +source = { virtual = "." } +dependencies = [ + { name = "matplotlib" }, + { name = "mpmath" }, + { name = "numba" }, + { name = "numpy" }, + { name = "scipy" }, + { name = "sympy" }, +] + +[package.dev-dependencies] +dev = [ + { name = "pytest" }, +] + +[package.metadata] +requires-dist = [ + { name = "matplotlib", specifier = ">=3.10.9" }, + { name = "mpmath", specifier = ">=1.3.0" }, + { name = "numba", specifier = ">=0.65.1" }, + { name = "numpy", specifier = ">=2.4.6" }, + { name = "scipy", specifier = ">=1.17.1" }, + { name = "sympy", specifier = ">=1.14.0" }, +] + +[package.metadata.requires-dev] +dev = [{ name = "pytest", specifier = ">=9.0.3" }] + +[[package]] +name = "scipy" +version = "1.17.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "numpy" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/7a/97/5a3609c4f8d58b039179648e62dd220f89864f56f7357f5d4f45c29eb2cc/scipy-1.17.1.tar.gz", hash = "sha256:95d8e012d8cb8816c226aef832200b1d45109ed4464303e997c5b13122b297c0", size = 30573822, upload-time = "2026-02-23T00:26:24.851Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/cf/83/333afb452af6f0fd70414dc04f898647ee1423979ce02efa75c3b0f2c28e/scipy-1.17.1-cp314-cp314-macosx_10_14_x86_64.whl", hash = "sha256:a48a72c77a310327f6a3a920092fa2b8fd03d7deaa60f093038f22d98e096717", size = 31584510, upload-time = "2026-02-23T00:21:01.015Z" }, + { url = "https://files.pythonhosted.org/packages/ed/a6/d05a85fd51daeb2e4ea71d102f15b34fedca8e931af02594193ae4fd25f7/scipy-1.17.1-cp314-cp314-macosx_12_0_arm64.whl", hash = "sha256:45abad819184f07240d8a696117a7aacd39787af9e0b719d00285549ed19a1e9", size = 28170131, upload-time = "2026-02-23T00:21:05.888Z" }, + { url = "https://files.pythonhosted.org/packages/db/7b/8624a203326675d7746a254083a187398090a179335b2e4a20e2ddc46e83/scipy-1.17.1-cp314-cp314-macosx_14_0_arm64.whl", hash = "sha256:3fd1fcdab3ea951b610dc4cef356d416d5802991e7e32b5254828d342f7b7e0b", size = 20342032, upload-time = "2026-02-23T00:21:09.904Z" }, + { url = "https://files.pythonhosted.org/packages/c9/35/2c342897c00775d688d8ff3987aced3426858fd89d5a0e26e020b660b301/scipy-1.17.1-cp314-cp314-macosx_14_0_x86_64.whl", hash = "sha256:7bdf2da170b67fdf10bca777614b1c7d96ae3ca5794fd9587dce41eb2966e866", size = 22678766, upload-time = "2026-02-23T00:21:14.313Z" }, + { url = "https://files.pythonhosted.org/packages/ef/f2/7cdb8eb308a1a6ae1e19f945913c82c23c0c442a462a46480ce487fdc0ac/scipy-1.17.1-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:adb2642e060a6549c343603a3851ba76ef0b74cc8c079a9a58121c7ec9fe2350", size = 32957007, upload-time = "2026-02-23T00:21:19.663Z" }, + { url = "https://files.pythonhosted.org/packages/0b/2e/7eea398450457ecb54e18e9d10110993fa65561c4f3add5e8eccd2b9cd41/scipy-1.17.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:eee2cfda04c00a857206a4330f0c5e3e56535494e30ca445eb19ec624ae75118", size = 35221333, upload-time = "2026-02-23T00:21:25.278Z" }, + { url = "https://files.pythonhosted.org/packages/d9/77/5b8509d03b77f093a0d52e606d3c4f79e8b06d1d38c441dacb1e26cacf46/scipy-1.17.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:d2650c1fb97e184d12d8ba010493ee7b322864f7d3d00d3f9bb97d9c21de4068", size = 35042066, upload-time = "2026-02-23T00:21:31.358Z" }, + { url = "https://files.pythonhosted.org/packages/f9/df/18f80fb99df40b4070328d5ae5c596f2f00fffb50167e31439e932f29e7d/scipy-1.17.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:08b900519463543aa604a06bec02461558a6e1cef8fdbb8098f77a48a83c8118", size = 37612763, upload-time = "2026-02-23T00:21:37.247Z" }, + { url = "https://files.pythonhosted.org/packages/4b/39/f0e8ea762a764a9dc52aa7dabcfad51a354819de1f0d4652b6a1122424d6/scipy-1.17.1-cp314-cp314-win_amd64.whl", hash = "sha256:3877ac408e14da24a6196de0ddcace62092bfc12a83823e92e49e40747e52c19", size = 37290984, upload-time = "2026-02-23T00:22:35.023Z" }, + { url = "https://files.pythonhosted.org/packages/7c/56/fe201e3b0f93d1a8bcf75d3379affd228a63d7e2d80ab45467a74b494947/scipy-1.17.1-cp314-cp314-win_arm64.whl", hash = "sha256:f8885db0bc2bffa59d5c1b72fad7a6a92d3e80e7257f967dd81abb553a90d293", size = 25192877, upload-time = "2026-02-23T00:22:39.798Z" }, + { url = "https://files.pythonhosted.org/packages/96/ad/f8c414e121f82e02d76f310f16db9899c4fcde36710329502a6b2a3c0392/scipy-1.17.1-cp314-cp314t-macosx_10_14_x86_64.whl", hash = "sha256:1cc682cea2ae55524432f3cdff9e9a3be743d52a7443d0cba9017c23c87ae2f6", size = 31949750, upload-time = "2026-02-23T00:21:42.289Z" }, + { url = "https://files.pythonhosted.org/packages/7c/b0/c741e8865d61b67c81e255f4f0a832846c064e426636cd7de84e74d209be/scipy-1.17.1-cp314-cp314t-macosx_12_0_arm64.whl", hash = "sha256:2040ad4d1795a0ae89bfc7e8429677f365d45aa9fd5e4587cf1ea737f927b4a1", size = 28585858, upload-time = "2026-02-23T00:21:47.706Z" }, + { url = "https://files.pythonhosted.org/packages/ed/1b/3985219c6177866628fa7c2595bfd23f193ceebbe472c98a08824b9466ff/scipy-1.17.1-cp314-cp314t-macosx_14_0_arm64.whl", hash = "sha256:131f5aaea57602008f9822e2115029b55d4b5f7c070287699fe45c661d051e39", size = 20757723, upload-time = "2026-02-23T00:21:52.039Z" }, + { url = "https://files.pythonhosted.org/packages/c0/19/2a04aa25050d656d6f7b9e7b685cc83d6957fb101665bfd9369ca6534563/scipy-1.17.1-cp314-cp314t-macosx_14_0_x86_64.whl", hash = "sha256:9cdc1a2fcfd5c52cfb3045feb399f7b3ce822abdde3a193a6b9a60b3cb5854ca", size = 23043098, upload-time = "2026-02-23T00:21:56.185Z" }, + { url = "https://files.pythonhosted.org/packages/86/f1/3383beb9b5d0dbddd030335bf8a8b32d4317185efe495374f134d8be6cce/scipy-1.17.1-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6e3dcd57ab780c741fde8dc68619de988b966db759a3c3152e8e9142c26295ad", size = 33030397, upload-time = "2026-02-23T00:22:01.404Z" }, + { url = "https://files.pythonhosted.org/packages/41/68/8f21e8a65a5a03f25a79165ec9d2b28c00e66dc80546cf5eb803aeeff35b/scipy-1.17.1-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a9956e4d4f4a301ebf6cde39850333a6b6110799d470dbbb1e25326ac447f52a", size = 35281163, upload-time = "2026-02-23T00:22:07.024Z" }, + { url = "https://files.pythonhosted.org/packages/84/8d/c8a5e19479554007a5632ed7529e665c315ae7492b4f946b0deb39870e39/scipy-1.17.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:a4328d245944d09fd639771de275701ccadf5f781ba0ff092ad141e017eccda4", size = 35116291, upload-time = "2026-02-23T00:22:12.585Z" }, + { url = "https://files.pythonhosted.org/packages/52/52/e57eceff0e342a1f50e274264ed47497b59e6a4e3118808ee58ddda7b74a/scipy-1.17.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:a77cbd07b940d326d39a1d1b37817e2ee4d79cb30e7338f3d0cddffae70fcaa2", size = 37682317, upload-time = "2026-02-23T00:22:18.513Z" }, + { url = "https://files.pythonhosted.org/packages/11/2f/b29eafe4a3fbc3d6de9662b36e028d5f039e72d345e05c250e121a230dd4/scipy-1.17.1-cp314-cp314t-win_amd64.whl", hash = "sha256:eb092099205ef62cd1782b006658db09e2fed75bffcae7cc0d44052d8aa0f484", size = 37345327, upload-time = "2026-02-23T00:22:24.442Z" }, + { url = "https://files.pythonhosted.org/packages/07/39/338d9219c4e87f3e708f18857ecd24d22a0c3094752393319553096b98af/scipy-1.17.1-cp314-cp314t-win_arm64.whl", hash = "sha256:200e1050faffacc162be6a486a984a0497866ec54149a01270adc8a59b7c7d21", size = 25489165, upload-time = "2026-02-23T00:22:29.563Z" }, +] + +[[package]] +name = "six" +version = "1.17.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/94/e7/b2c673351809dca68a0e064b6af791aa332cf192da575fd474ed7d6f16a2/six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81", size = 34031, upload-time = "2024-12-04T17:35:28.174Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b7/ce/149a00dd41f10bc29e5921b496af8b574d8413afcd5e30dfa0ed46c2cc5e/six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274", size = 11050, upload-time = "2024-12-04T17:35:26.475Z" }, +] + +[[package]] +name = "sympy" +version = "1.14.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "mpmath" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/83/d3/803453b36afefb7c2bb238361cd4ae6125a569b4db67cd9e79846ba2d68c/sympy-1.14.0.tar.gz", hash = "sha256:d3d3fe8df1e5a0b42f0e7bdf50541697dbe7d23746e894990c030e2b05e72517", size = 7793921, upload-time = "2025-04-27T18:05:01.611Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a2/09/77d55d46fd61b4a135c444fc97158ef34a095e5681d0a6c10b75bf356191/sympy-1.14.0-py3-none-any.whl", hash = "sha256:e091cc3e99d2141a0ba2847328f5479b05d94a6635cb96148ccb3f34671bd8f5", size = 6299353, upload-time = "2025-04-27T18:04:59.103Z" }, +] From 444493f21f4d45e17bc78886f2d6177ad7e752bb Mon Sep 17 00:00:00 2001 From: JarvisRAs Date: Tue, 26 May 2026 12:46:52 -0600 Subject: [PATCH 11/36] Update pyproject --- pyproject.toml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 0eef05e3..3c0a08be 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,16 +1,16 @@ [project] -name = "rootfinding" +name = "yroots" version = "0.1.0" description = "Add your description here" readme = "README.md" -requires-python = ">=3.14" +requires-python = ">=3.14t" dependencies = [ - "matplotlib>=3.10.9", - "mpmath>=1.3.0", - "numba>=0.65.1", - "numpy>=2.4.6", - "scipy>=1.17.1", - "sympy>=1.14.0", + "matplotlib, + "mpmath", + "numba", + "numpy", + "scipy", + "sympy", ] [dependency-groups] From 3b28cd7845b3d3ec7b50c52e71184548b67f1c72 Mon Sep 17 00:00:00 2001 From: JarvisRAs Date: Tue, 26 May 2026 12:57:06 -0600 Subject: [PATCH 12/36] Updating for uv --- README.md | 12 ++++++------ pyproject.toml | 14 +++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 291256f9..e7c6bace 100644 --- a/README.md +++ b/README.md @@ -20,12 +20,12 @@ This project was supported in part by the National Science Foundation, grant num ### Requirements At least: -* Python 3.10 -* Pip 21.1 -* Numpy 1.22.0 -* Numba 0.37.0 -* Scipy 1.10.0 -* Sympy 1.5.1 +* Python 3.14t +* Pip 26.1 +* Numpy 2.4.4 +* Numba 0.65.1 +* Scipy 1.17.1 +* Sympy 1.12 ## Installation diff --git a/pyproject.toml b/pyproject.toml index 3c0a08be..cafea014 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,19 +1,19 @@ [project] name = "yroots" version = "0.1.0" -description = "Add your description here" +description = "Numerical rootfinding for multivariate systems of equations" readme = "README.md" requires-python = ">=3.14t" dependencies = [ - "matplotlib, + "matplotlib", "mpmath", - "numba", - "numpy", - "scipy", - "sympy", + "numba>=0.65.1", + "numpy>=2.4.4", + "scipy>=1.17.1", + "sympy>=1.12", ] [dependency-groups] dev = [ "pytest>=9.0.3", -] +] \ No newline at end of file From d85c5e19dd8eee9b877c2fcfdaf1d1dfe950b4cb Mon Sep 17 00:00:00 2001 From: JarvisRAs Date: Tue, 26 May 2026 13:03:42 -0600 Subject: [PATCH 13/36] Fixed python version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index cafea014..62c54d13 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "yroots" version = "0.1.0" description = "Numerical rootfinding for multivariate systems of equations" readme = "README.md" -requires-python = ">=3.14t" +requires-python = ">=3.14" dependencies = [ "matplotlib", "mpmath", From 794489ec077be9412b8246abdc907c8f8dc9c626 Mon Sep 17 00:00:00 2001 From: JarvisRAs Date: Tue, 26 May 2026 13:07:09 -0600 Subject: [PATCH 14/36] Fix for uv project --- .python-version | 1 + 1 file changed, 1 insertion(+) create mode 100644 .python-version diff --git a/.python-version b/.python-version new file mode 100644 index 00000000..a469d8fe --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.14t From 62bb602b3533cd9dc8821cb0fc9449ed923a68e3 Mon Sep 17 00:00:00 2001 From: JarvisRAs Date: Tue, 26 May 2026 13:08:47 -0600 Subject: [PATCH 15/36] Allow build for UV --- pyproject.toml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 62c54d13..fbc019f7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,7 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + [project] name = "yroots" version = "0.1.0" @@ -16,4 +20,7 @@ dependencies = [ [dependency-groups] dev = [ "pytest>=9.0.3", -] \ No newline at end of file +] + +[tool.hatch.build.targets.wheel] +packages = ["yroots"] \ No newline at end of file From 4cffc11a35601d9816cee88e4fdd3e6d4bbd0ee6 Mon Sep 17 00:00:00 2001 From: JarvisRAs Date: Tue, 26 May 2026 13:10:33 -0600 Subject: [PATCH 16/36] Regenerate uv.lock after adding build backend --- uv.lock | 62 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/uv.lock b/uv.lock index 8040749f..b803cca3 100644 --- a/uv.lock +++ b/uv.lock @@ -329,37 +329,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/ec/57/56b9bcc3c9c6a792fcbaf139543cee77261f3651ca9da0c93f5c1221264b/python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427", size = 229892, upload-time = "2024-03-01T18:36:18.57Z" }, ] -[[package]] -name = "rootfinding" -version = "0.1.0" -source = { virtual = "." } -dependencies = [ - { name = "matplotlib" }, - { name = "mpmath" }, - { name = "numba" }, - { name = "numpy" }, - { name = "scipy" }, - { name = "sympy" }, -] - -[package.dev-dependencies] -dev = [ - { name = "pytest" }, -] - -[package.metadata] -requires-dist = [ - { name = "matplotlib", specifier = ">=3.10.9" }, - { name = "mpmath", specifier = ">=1.3.0" }, - { name = "numba", specifier = ">=0.65.1" }, - { name = "numpy", specifier = ">=2.4.6" }, - { name = "scipy", specifier = ">=1.17.1" }, - { name = "sympy", specifier = ">=1.14.0" }, -] - -[package.metadata.requires-dev] -dev = [{ name = "pytest", specifier = ">=9.0.3" }] - [[package]] name = "scipy" version = "1.17.1" @@ -411,3 +380,34 @@ sdist = { url = "https://files.pythonhosted.org/packages/83/d3/803453b36afefb7c2 wheels = [ { url = "https://files.pythonhosted.org/packages/a2/09/77d55d46fd61b4a135c444fc97158ef34a095e5681d0a6c10b75bf356191/sympy-1.14.0-py3-none-any.whl", hash = "sha256:e091cc3e99d2141a0ba2847328f5479b05d94a6635cb96148ccb3f34671bd8f5", size = 6299353, upload-time = "2025-04-27T18:04:59.103Z" }, ] + +[[package]] +name = "yroots" +version = "0.1.0" +source = { editable = "." } +dependencies = [ + { name = "matplotlib" }, + { name = "mpmath" }, + { name = "numba" }, + { name = "numpy" }, + { name = "scipy" }, + { name = "sympy" }, +] + +[package.dev-dependencies] +dev = [ + { name = "pytest" }, +] + +[package.metadata] +requires-dist = [ + { name = "matplotlib" }, + { name = "mpmath" }, + { name = "numba", specifier = ">=0.65.1" }, + { name = "numpy", specifier = ">=2.4.4" }, + { name = "scipy", specifier = ">=1.17.1" }, + { name = "sympy", specifier = ">=1.12" }, +] + +[package.metadata.requires-dev] +dev = [{ name = "pytest", specifier = ">=9.0.3" }] From d0c450779235fd45b62fd1ecf537dcc98ae35655 Mon Sep 17 00:00:00 2001 From: JarvisRAs Date: Tue, 26 May 2026 13:20:04 -0600 Subject: [PATCH 17/36] Remove legacy packaging --- .travis.yml | 27 --------------------------- requirements_dev.txt | 20 -------------------- setup.cfg | 25 ------------------------- setup.py | 39 --------------------------------------- tox.ini | 25 ------------------------- 5 files changed, 136 deletions(-) delete mode 100644 .travis.yml delete mode 100644 requirements_dev.txt delete mode 100644 setup.cfg delete mode 100644 setup.py delete mode 100644 tox.ini diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e7cbf472..00000000 --- a/.travis.yml +++ /dev/null @@ -1,27 +0,0 @@ -language: python -python: - - 3.5 - - 3.6 - -# Command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors -install: pip install -U tox-travis - -# Command to run tests, e.g. python setup.py test -script: tox - -after_success: - - codecov -# Assuming you have installed the travis-ci CLI tool, after you -# create the Github repo and add it to Travis, run the -# following command to finish PyPI deployment setup: -# $ travis encrypt --add deploy.password -#deploy: -# provider: pypi -# distributions: sdist bdist_wheel -# user: tylerjarvis -# password: -# secure: PLEASE_REPLACE_ME -# on: -# tags: true -# repo: tylerjarvis/RootFinding -# python: 3.6 diff --git a/requirements_dev.txt b/requirements_dev.txt deleted file mode 100644 index 0bf47a20..00000000 --- a/requirements_dev.txt +++ /dev/null @@ -1,20 +0,0 @@ -pip==23.3 -bumpversion==0.5.3 -wheel==0.38.1 -watchdog==0.8.3 -flake8==3.5.0 -tox==2.9.1 -coverage==4.5.1 -Sphinx==1.7.1 -twine==1.10.0 -numpy==1.22.0 -scipy==1.10.0 -llvmlite==0.31.0 -numba==0.47.0 -sympy==1.5.1 -matplotlib==2.2.2 - -pytest==5.4.1 -pytest-cov==2.7.1 -pytest-runner==2.11.1 -codecov==2.0.15 diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index af164d75..00000000 --- a/setup.cfg +++ /dev/null @@ -1,25 +0,0 @@ -[bumpversion] -current_version = 0.1.0 -commit = True -tag = True - -[bumpversion:file:setup.py] -search = version='{current_version}' -replace = version='{new_version}' - -[bumpversion:file:RootFinding/__init__.py] -search = __version__ = '{current_version}' -replace = __version__ = '{new_version}' - -[bdist_wheel] -universal = 1 - -[flake8] -exclude = docs - -[aliases] -# Define setup.py command aliases here -test = pytest - -[tool:pytest] -collect_ignore = ['setup.py'] diff --git a/setup.py b/setup.py deleted file mode 100644 index 4554303c..00000000 --- a/setup.py +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -"""The setup script.""" - -from setuptools import setup, find_packages - -with open('README.md') as readme_file: - readme = readme_file.read() - -setup_requirements = ['pytest-runner', ] - -test_requirements = ['pytest', ] - -setup( - author="Tyler Jarvis", - author_email='jarvis@math.byu.edu', - classifiers=[ - 'Development Status :: 2 - Pre-Alpha', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: MIT License', - 'Natural Language :: English', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - ], - description="A package for numerical root finding.", - license="MIT license", - long_description=readme + '\n\n', # + history, - include_package_data=True, - keywords='RootFinding', - name='yroots', - packages=find_packages(include=['yroots']), - setup_requires=setup_requirements, - test_suite='tests', - tests_require=test_requirements, - url='https://github.com/tylerjarvis/RootFinding', - version='0.1.0', - zip_safe=False, -) diff --git a/tox.ini b/tox.ini deleted file mode 100644 index d240a9e1..00000000 --- a/tox.ini +++ /dev/null @@ -1,25 +0,0 @@ -[tox] -envlist = py35, py36, flake8 - -[travis] -python = - 3.5: py35 - 3.6: py36 - -[testenv:flake8] -basepython = python -deps = flake8 -commands = flake8 RootFinding - -[testenv] -setenv = - PYTHONPATH = {toxinidir} -deps = - -r{toxinidir}/requirements_dev.txt -; If you want to make tox run the tests with the same versions, create a -; requirements.txt with the pinned versions and uncomment the following line: -; -r{toxinidir}/requirements.txt -commands = - pip install -U pip - py.test --cov yroots --cov tests -; codecov --token=a3abdaf4-6e48-4c09-af4c-818dd740ed31 From 8590a74b66fd7fde40af8af48b7e076f375a5815 Mon Sep 17 00:00:00 2001 From: JarvisRAs Date: Tue, 26 May 2026 13:25:36 -0600 Subject: [PATCH 18/36] Clean up source files --- docs/_sources/MultiCheb.rst.txt | 12 ---------- docs/_sources/MultiPower.rst.txt | 12 ---------- docs/_sources/index.rst.txt | 24 ------------------- docs/_sources/modules.rst.txt | 15 ------------ .../ChebyshevApproximator.rst} | 0 .../ChebyshevSubdivisionSolver.rst} | 0 .../CombinedSolver.rst} | 0 MultiCheb.rst => docs/source/MultiCheb.rst | 0 MultiPower.rst => docs/source/MultiPower.rst | 0 .../QuadraticCheck.rst} | 0 conf.py => docs/source/conf.py | 0 index.rst => docs/source/index.rst | 0 make.bat => docs/source/make.bat | 0 modules.rst => docs/source/modules.rst | 0 docs/{_sources => source}/polynomial.rst.txt | 0 15 files changed, 63 deletions(-) delete mode 100644 docs/_sources/MultiCheb.rst.txt delete mode 100644 docs/_sources/MultiPower.rst.txt delete mode 100644 docs/_sources/index.rst.txt delete mode 100644 docs/_sources/modules.rst.txt rename docs/{_sources/ChebyshevApproximator.rst.txt => source/ChebyshevApproximator.rst} (100%) rename docs/{_sources/ChebyshevSubdivisionSolver.rst.txt => source/ChebyshevSubdivisionSolver.rst} (100%) rename docs/{_sources/CombinedSolver.rst.txt => source/CombinedSolver.rst} (100%) rename MultiCheb.rst => docs/source/MultiCheb.rst (100%) rename MultiPower.rst => docs/source/MultiPower.rst (100%) rename docs/{_sources/QuadraticCheck.rst.txt => source/QuadraticCheck.rst} (100%) rename conf.py => docs/source/conf.py (100%) rename index.rst => docs/source/index.rst (100%) rename make.bat => docs/source/make.bat (100%) rename modules.rst => docs/source/modules.rst (100%) rename docs/{_sources => source}/polynomial.rst.txt (100%) diff --git a/docs/_sources/MultiCheb.rst.txt b/docs/_sources/MultiCheb.rst.txt deleted file mode 100644 index 6faa691c..00000000 --- a/docs/_sources/MultiCheb.rst.txt +++ /dev/null @@ -1,12 +0,0 @@ -.. _MultiCheb: - -========== -MultiCheb -========== - --------------------------------------------------------------------------------- - -MultiCheb Class --------------------------------------------------------------------------------- -.. currentmodule:: yroots.polynomial -.. autoclass:: MultiCheb diff --git a/docs/_sources/MultiPower.rst.txt b/docs/_sources/MultiPower.rst.txt deleted file mode 100644 index 8eacf4a6..00000000 --- a/docs/_sources/MultiPower.rst.txt +++ /dev/null @@ -1,12 +0,0 @@ -.. _MultiPower: - -=========== -MultiPower -=========== - --------------------------------------------------------------------------------- - -MultiPower Class --------------------------------------------------------------------------------- -.. currentmodule:: yroots.polynomial -.. autoclass:: MultiPower diff --git a/docs/_sources/index.rst.txt b/docs/_sources/index.rst.txt deleted file mode 100644 index a675cb3c..00000000 --- a/docs/_sources/index.rst.txt +++ /dev/null @@ -1,24 +0,0 @@ -YRoots -================================================================================ - -*A fast-working package for finding the roots of multivariate systems of equations.* - -How YRoots Works --------------------------------------------------------------------------------- - -YRoots harnesses the properties of Chebyshev polynomial approximation to quickly and precisely find and -return the roots of various systems of functions. - -Given a list of smooth, continuous functions and a compact search interval, YRoots generates an accurate -approximation for each function on the interval and recursively uses numerical methods to zero in on any -roots contained in the interval. - -Getting Started with YRoots --------------------------------------------------------------------------------- - -Getting started with YRoots is quick and simple. To learn how to use the solver, navigate to the -yroots.solve() page for the documentation and examples. - -Some users may wish to use two special YRoots class objects, MultiCheb and MultiPower, built for faster -function evaluations of Chebyshev-based or power-based polynomials. To learn how to use these, see the -corresponding documentation. \ No newline at end of file diff --git a/docs/_sources/modules.rst.txt b/docs/_sources/modules.rst.txt deleted file mode 100644 index a6e92878..00000000 --- a/docs/_sources/modules.rst.txt +++ /dev/null @@ -1,15 +0,0 @@ -.. _modules: - -========== -Modules -========== - -.. toctree:: - :maxdepth: 2 - :caption: Contents: - - Home - yroots.solve() - yroots.approximate() - yroots.MultiCheb - yroots.MultiPower \ No newline at end of file diff --git a/docs/_sources/ChebyshevApproximator.rst.txt b/docs/source/ChebyshevApproximator.rst similarity index 100% rename from docs/_sources/ChebyshevApproximator.rst.txt rename to docs/source/ChebyshevApproximator.rst diff --git a/docs/_sources/ChebyshevSubdivisionSolver.rst.txt b/docs/source/ChebyshevSubdivisionSolver.rst similarity index 100% rename from docs/_sources/ChebyshevSubdivisionSolver.rst.txt rename to docs/source/ChebyshevSubdivisionSolver.rst diff --git a/docs/_sources/CombinedSolver.rst.txt b/docs/source/CombinedSolver.rst similarity index 100% rename from docs/_sources/CombinedSolver.rst.txt rename to docs/source/CombinedSolver.rst diff --git a/MultiCheb.rst b/docs/source/MultiCheb.rst similarity index 100% rename from MultiCheb.rst rename to docs/source/MultiCheb.rst diff --git a/MultiPower.rst b/docs/source/MultiPower.rst similarity index 100% rename from MultiPower.rst rename to docs/source/MultiPower.rst diff --git a/docs/_sources/QuadraticCheck.rst.txt b/docs/source/QuadraticCheck.rst similarity index 100% rename from docs/_sources/QuadraticCheck.rst.txt rename to docs/source/QuadraticCheck.rst diff --git a/conf.py b/docs/source/conf.py similarity index 100% rename from conf.py rename to docs/source/conf.py diff --git a/index.rst b/docs/source/index.rst similarity index 100% rename from index.rst rename to docs/source/index.rst diff --git a/make.bat b/docs/source/make.bat similarity index 100% rename from make.bat rename to docs/source/make.bat diff --git a/modules.rst b/docs/source/modules.rst similarity index 100% rename from modules.rst rename to docs/source/modules.rst diff --git a/docs/_sources/polynomial.rst.txt b/docs/source/polynomial.rst.txt similarity index 100% rename from docs/_sources/polynomial.rst.txt rename to docs/source/polynomial.rst.txt From ac64a8b23b8ec942fc0f5f704beb7228a26a0ab9 Mon Sep 17 00:00:00 2001 From: JarvisRAs Date: Tue, 26 May 2026 13:27:48 -0600 Subject: [PATCH 19/36] Source file clean up --- ChebyshevApproximator.rst | 10 ---------- CombinedSolver.rst | 10 ---------- 2 files changed, 20 deletions(-) delete mode 100644 ChebyshevApproximator.rst delete mode 100644 CombinedSolver.rst diff --git a/ChebyshevApproximator.rst b/ChebyshevApproximator.rst deleted file mode 100644 index 4ae35303..00000000 --- a/ChebyshevApproximator.rst +++ /dev/null @@ -1,10 +0,0 @@ -.. _ChebyshevApproximator: - -==================== -yroots.approximate -==================== - -Approximator --------------------------------------------------------------------------------- -.. currentmodule:: yroots.ChebyshevApproximator -.. autofunction:: chebApproximate \ No newline at end of file diff --git a/CombinedSolver.rst b/CombinedSolver.rst deleted file mode 100644 index df891f3c..00000000 --- a/CombinedSolver.rst +++ /dev/null @@ -1,10 +0,0 @@ -.. _CombinedSolver: - -============== -yroots.solve() -============== - -Solver --------------------------------------------------------------------------------- -.. currentmodule:: yroots.Combined_Solver -.. autofunction:: solve \ No newline at end of file From 64c5516b32e3e1a7525edb1c5297ccb6e67e2289 Mon Sep 17 00:00:00 2001 From: JarvisRAs Date: Tue, 26 May 2026 13:29:38 -0600 Subject: [PATCH 20/36] Add back requirements_dev --- requirements_dev.txt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 requirements_dev.txt diff --git a/requirements_dev.txt b/requirements_dev.txt new file mode 100644 index 00000000..6dad43d4 --- /dev/null +++ b/requirements_dev.txt @@ -0,0 +1,20 @@ +pip==26.0 +bumpversion==0.5.3 +wheel==0.46.2 +watchdog==0.8.3 +flake8==3.5.0 +tox==2.9.1 +coverage==4.5.1 +Sphinx==1.7.1 +twine==1.10.0 +numpy==1.22.0 +scipy==1.10.0 +llvmlite==0.31.0 +numba==0.47.0 +sympy==1.5.1 +matplotlib==2.2.2 + +pytest==5.4.1 +pytest-cov==2.7.1 +pytest-runner==2.11.1 +codecov==2.0.15 From 46cbeb83dbd93fd0072698130b6242d8cb422237 Mon Sep 17 00:00:00 2001 From: JarvisRAs Date: Tue, 26 May 2026 13:48:49 -0600 Subject: [PATCH 21/36] Add dependabot auto update for uv --- .github/dependabot.yml | 11 +++++++++++ docs/source/polynomial.rst | 20 ++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 docs/source/polynomial.rst diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..f647a55b --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +version: 2 +updates: + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "weekly" + + - package-ecosystem: "uv" + directory: "/" + schedule: + interval: "weekly" \ No newline at end of file diff --git a/docs/source/polynomial.rst b/docs/source/polynomial.rst new file mode 100644 index 00000000..d97af2d5 --- /dev/null +++ b/docs/source/polynomial.rst @@ -0,0 +1,20 @@ +.. _polynomial: + +========== +Polynomial +========== + +-------------------------------------------------------------------------------- + +Polynomial Class +-------------------------------------------------------------------------------- +.. currentmodule:: yroots.polynomial +.. autoclass:: Polynomial + +MultiCheb Class +-------------------------------------------------------------------------------- +.. autoclass:: MultiCheb + +MultiPower Class +-------------------------------------------------------------------------------- +.. autoclass:: MultiPower \ No newline at end of file From f4b536950bb559b4a4d1c7d1942c93eef6a40b53 Mon Sep 17 00:00:00 2001 From: JarvisRAs Date: Tue, 26 May 2026 13:51:52 -0600 Subject: [PATCH 22/36] Clean up source files --- docs/source/polynomial.rst.txt | 20 -------------------- requirements_dev.txt | 19 ++----------------- 2 files changed, 2 insertions(+), 37 deletions(-) delete mode 100644 docs/source/polynomial.rst.txt diff --git a/docs/source/polynomial.rst.txt b/docs/source/polynomial.rst.txt deleted file mode 100644 index d97af2d5..00000000 --- a/docs/source/polynomial.rst.txt +++ /dev/null @@ -1,20 +0,0 @@ -.. _polynomial: - -========== -Polynomial -========== - --------------------------------------------------------------------------------- - -Polynomial Class --------------------------------------------------------------------------------- -.. currentmodule:: yroots.polynomial -.. autoclass:: Polynomial - -MultiCheb Class --------------------------------------------------------------------------------- -.. autoclass:: MultiCheb - -MultiPower Class --------------------------------------------------------------------------------- -.. autoclass:: MultiPower \ No newline at end of file diff --git a/requirements_dev.txt b/requirements_dev.txt index 6dad43d4..8da8ea9b 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -1,20 +1,5 @@ pip==26.0 -bumpversion==0.5.3 wheel==0.46.2 -watchdog==0.8.3 -flake8==3.5.0 -tox==2.9.1 -coverage==4.5.1 -Sphinx==1.7.1 -twine==1.10.0 -numpy==1.22.0 -scipy==1.10.0 -llvmlite==0.31.0 -numba==0.47.0 -sympy==1.5.1 -matplotlib==2.2.2 - -pytest==5.4.1 +pytest==9.0.3 pytest-cov==2.7.1 -pytest-runner==2.11.1 -codecov==2.0.15 +codecov==2.0.15 \ No newline at end of file From b97e4bfba0a90ff446da0df51c7d48607dbaeed0 Mon Sep 17 00:00:00 2001 From: JarvisRAs Date: Tue, 26 May 2026 13:55:23 -0600 Subject: [PATCH 23/36] Cleaning up source files --- docs/{source => }/make.bat | 0 docs/source/conf.py | 2 +- docs/source/modules.rst | 4 +++- 3 files changed, 4 insertions(+), 2 deletions(-) rename docs/{source => }/make.bat (100%) diff --git a/docs/source/make.bat b/docs/make.bat similarity index 100% rename from docs/source/make.bat rename to docs/make.bat diff --git a/docs/source/conf.py b/docs/source/conf.py index af84d4af..a888b488 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -12,7 +12,7 @@ # import os import sys -sys.path.insert(0, os.path.abspath('.')) +sys.path.insert(0, os.path.abspath('../..')) # points at repo root # -- Project information ----------------------------------------------------- diff --git a/docs/source/modules.rst b/docs/source/modules.rst index a6e92878..5fff73db 100644 --- a/docs/source/modules.rst +++ b/docs/source/modules.rst @@ -12,4 +12,6 @@ Modules yroots.solve() yroots.approximate() yroots.MultiCheb - yroots.MultiPower \ No newline at end of file + yroots.MultiPower + ChebyshevSubdivisionSolver + QuadraticCheck \ No newline at end of file From 22e388f2d0bc1a0982b4f595109a1518b075809d Mon Sep 17 00:00:00 2001 From: JarvisRAs Date: Tue, 26 May 2026 14:06:19 -0600 Subject: [PATCH 24/36] Cleaning up docs --- .github/{ => workflows}/dependabot.yml | 0 .github/workflows/docs.yml | 20 + docs/.buildinfo | 4 - docs/.doctrees/ChebyshevApproximator.doctree | Bin 17421 -> 0 bytes .../ChebyshevSubdivisionSolver.doctree | Bin 18413 -> 0 bytes docs/.doctrees/CombinedSolver.doctree | Bin 21008 -> 0 bytes docs/.doctrees/MultiCheb.doctree | Bin 9806 -> 0 bytes docs/.doctrees/MultiPower.doctree | Bin 10506 -> 0 bytes docs/.doctrees/QuadraticCheck.doctree | Bin 19518 -> 0 bytes docs/.doctrees/environment.pickle | Bin 19884 -> 0 bytes docs/.doctrees/index.doctree | Bin 5162 -> 0 bytes docs/.doctrees/modules.doctree | Bin 3658 -> 0 bytes docs/.doctrees/polynomial.doctree | Bin 53303 -> 0 bytes docs/.nojekyll | 1 - docs/ChebyshevApproximator.html | 184 - docs/ChebyshevSubdivisionSolver.html | 145 - docs/CombinedSolver.html | 186 - docs/MultiCheb.html | 145 - docs/MultiPower.html | 153 - .../_sphinx_javascript_frameworks_compat.js | 134 - docs/_static/alabaster.css | 701 - docs/_static/basic.css | 930 -- docs/_static/custom.css | 1 - docs/_static/doctools.js | 264 - docs/_static/documentation_options.js | 14 - docs/_static/file.png | Bin 286 -> 0 bytes docs/_static/jquery-3.6.0.js | 10881 ---------------- docs/_static/jquery.js | 2 - docs/_static/language_data.js | 199 - docs/_static/minus.png | Bin 90 -> 0 bytes docs/_static/plus.png | Bin 90 -> 0 bytes docs/_static/pygments.css | 82 - docs/_static/searchtools.js | 531 - docs/_static/underscore-1.13.1.js | 2042 --- docs/_static/underscore.js | 6 - docs/genindex.html | 140 - docs/index.html | 138 - docs/modules.html | 138 - docs/objects.inv | Bin 435 -> 0 bytes docs/py-modindex.html | 126 - docs/search.html | 128 - docs/searchindex.js | 1 - pyproject.toml | 3 + 43 files changed, 23 insertions(+), 17276 deletions(-) rename .github/{ => workflows}/dependabot.yml (100%) create mode 100644 .github/workflows/docs.yml delete mode 100644 docs/.buildinfo delete mode 100644 docs/.doctrees/ChebyshevApproximator.doctree delete mode 100644 docs/.doctrees/ChebyshevSubdivisionSolver.doctree delete mode 100644 docs/.doctrees/CombinedSolver.doctree delete mode 100644 docs/.doctrees/MultiCheb.doctree delete mode 100644 docs/.doctrees/MultiPower.doctree delete mode 100644 docs/.doctrees/QuadraticCheck.doctree delete mode 100644 docs/.doctrees/environment.pickle delete mode 100644 docs/.doctrees/index.doctree delete mode 100644 docs/.doctrees/modules.doctree delete mode 100644 docs/.doctrees/polynomial.doctree delete mode 100644 docs/.nojekyll delete mode 100644 docs/ChebyshevApproximator.html delete mode 100644 docs/ChebyshevSubdivisionSolver.html delete mode 100644 docs/CombinedSolver.html delete mode 100644 docs/MultiCheb.html delete mode 100644 docs/MultiPower.html delete mode 100644 docs/_static/_sphinx_javascript_frameworks_compat.js delete mode 100644 docs/_static/alabaster.css delete mode 100644 docs/_static/basic.css delete mode 100644 docs/_static/custom.css delete mode 100644 docs/_static/doctools.js delete mode 100644 docs/_static/documentation_options.js delete mode 100644 docs/_static/file.png delete mode 100644 docs/_static/jquery-3.6.0.js delete mode 100644 docs/_static/jquery.js delete mode 100644 docs/_static/language_data.js delete mode 100644 docs/_static/minus.png delete mode 100644 docs/_static/plus.png delete mode 100644 docs/_static/pygments.css delete mode 100644 docs/_static/searchtools.js delete mode 100644 docs/_static/underscore-1.13.1.js delete mode 100644 docs/_static/underscore.js delete mode 100644 docs/genindex.html delete mode 100644 docs/index.html delete mode 100644 docs/modules.html delete mode 100644 docs/objects.inv delete mode 100644 docs/py-modindex.html delete mode 100644 docs/search.html delete mode 100644 docs/searchindex.js diff --git a/.github/dependabot.yml b/.github/workflows/dependabot.yml similarity index 100% rename from .github/dependabot.yml rename to .github/workflows/dependabot.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..c9668a28 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,20 @@ +name: Docs +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install uv + uses: astral-sh/setup-uv@v5 + with: + enable-cache: true + python-version: "3.14t" + - name: Install dependencies + run: uv sync --frozen --group docs + - name: Build docs + run: uv run sphinx-build docs/source docs/_build/html \ No newline at end of file diff --git a/docs/.buildinfo b/docs/.buildinfo deleted file mode 100644 index 3bbab7ab..00000000 --- a/docs/.buildinfo +++ /dev/null @@ -1,4 +0,0 @@ -# Sphinx build info version 1 -# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 664644670975784430ab8effd76667a6 -tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/docs/.doctrees/ChebyshevApproximator.doctree b/docs/.doctrees/ChebyshevApproximator.doctree deleted file mode 100644 index 45a703ac6bf647581d638de61f7d91a701a6435b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17421 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 auwPI?kECXMWGX8Ltq-v&CHE(4*8UIUqNdsa diff --git a/docs/.doctrees/ChebyshevSubdivisionSolver.doctree b/docs/.doctrees/ChebyshevSubdivisionSolver.doctree deleted file mode 100644 index d6f22675f90c1be276a4b1f9d6aa9c12059c0e8c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18413 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 diff --git a/docs/.doctrees/CombinedSolver.doctree b/docs/.doctrees/CombinedSolver.doctree deleted file mode 100644 index 2a9777ee5e9ee7a7bb5170a724a17d599e573935..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21008 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 y*?Q?UnuA0pMwrAXogu9fe<u(%a6}JZYh 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 diff --git a/docs/.doctrees/MultiPower.doctree b/docs/.doctrees/MultiPower.doctree deleted file mode 100644 index a43655fd89b5641908f3a920a0ce68ddb6f7a40d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10506 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 HQKSAJB$$NX diff --git a/docs/.doctrees/QuadraticCheck.doctree b/docs/.doctrees/QuadraticCheck.doctree deleted file mode 100644 index 6f9ec1ccc26e1387f25be28f8d787b880e8a67d7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 19518 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 diff --git a/docs/.doctrees/environment.pickle b/docs/.doctrees/environment.pickle deleted file mode 100644 index ceaf008e6711f1433fe0b99d893e01908c3eee04..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 19884 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 diff --git a/docs/.doctrees/index.doctree b/docs/.doctrees/index.doctree deleted file mode 100644 index 1e09547af007fed2158abfcebddd7e93d534cc2d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5162 zcmd^D-HIH?6_&NypPBuatR*0?T_!k|oZZ>ju_5>_C}6|lCCEyGVNFxhT{BhL?ygo< z_0Ehy;9MBIP~^rPNFa}3@QuMwlPAbso*>_;{+XFgtjLfHgAHp z`j^*Uz7hWOyS9)jpALAEh&^->+K{JEimPbGa(l7>9%=1tMJur2)?+cH zlRNq6RjtEX!EvIiH=-M?sKk=C>v77h zg%H12bDq_|Hj=WK4~9IxFk(b&O26*-n5HVZEAPoI`HEbThyLA%@1Ot93S-X`k@DgB zZyJ-?^GBl4_&=^RQhB2C@j3nx(}A&2{ngW(YT494_`Wo7ErB{zyY!R*XBkp;PUQgU*E9lX`rbwgx@F{|7BvX^XZH0Ot|>4ULMq1hdP7q z^uIMHOKx&O$O|4Uj4p(63PZT@p%lZJmEw{WI-TV@Q#@t7z@n+jf+LyJ>`AHOi*&|# zp0L7*SXqG);etecBV1|nWqc4cbZHl%F)H&Aopw+ojQNua>iMztRv&w4ACTySgdoW@{-Ke*(lhWV=6-^I%Wkov1BTD!d&w7s72LS`KgO%i5j6h(2-=z>NOZL2_oSX2&w|kdQ`?HSR2Jq~ zJ;#W}X>Nhu`YmHM3`SJ(9OkoTeDQavQ=4;iUE79S&G2P8SF;r1+D`=txhk6Ibu1#RAWkDm;-M6 zwfP2N`u+nX!6pL|rrW$({1?S%Q^NV|N*~B3xtB@3fiI>&hwf5P9Ruu1ZEAG=*QX^VGA89r)6(7B1gQm4P^IHa8 zh;dOWP)Ss$H+^67v>UGaeKA$AmE*3o?V?q`nuuXJ#&J6n&^7W7Rv5uENP5ojSkR@a zFZ_YFf!Pzr#zXqq)f6RDjfWQf5We!475( zf>4&_Jf#hHg9NtCEjfQKDy%3I9ZfR=)Sj54rxelRmjNTOi!PN_E&y~lN|fcplrGX} zx!#6@Jn~z(j72dKGAB0OZk9zOh3rY~@B#h8AxI|FJHo%TTLOn~qW$lN0O&r&6mXM| z0mD>f%2gljz3F!fQA99`KqSV&U|S@i#1K(v_@7AU3j6-a3B-0#%uvwg18v49mA^|X zg92C?p^t@o9Ne)1`SBaSco+8EF{Aj}_9U5a|Fd>`geoV%UI;T#!i~Zi2>KK0vJ{8) z93LWv5+|$E4SxtkW>FWM-320xqF+>3e$UQOT2CXX#xlhp(0eP@1pFOnIL_;gGvAR$W9Q<0_5t-h)g_FCky}{pQ66 zU`ongohc(*GX9azAwL(-^izOBEObjmA*$aZdO25dO7&^NJdXD`0{2!cnz^g0)>&>%S^=zoq4j5tS%h!b6>fX|h zz4p}b(e0)ELpmjzzk7YJX6A3g<)+Hxv`h#)V~YQNLZsL517+fJIQTao?6z(I diff --git a/docs/.doctrees/modules.doctree b/docs/.doctrees/modules.doctree deleted file mode 100644 index 3332bdc9abc3c4ed7863be934b5065e5a1880326..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3658 zcma)9TW=h<6_zaRO_$XrcA8$)Z0yFBT4?PAZBe)=+Co8*K(Nv{NfV?p2HY9$lG4m@ zN^+##hXC$F0t+~AVc*)9{(}Cd{E~j0+pacgS_5k>4-XH??|k3k*%z(9|E|AM{G%O{ z37JlZEQ(SUapR~PsW4A?YTZ}v=x^?GcSt?Wu8qod$Q`Y~BNQ@@G*8`gO!mFMm9ZIC z0os=737;<)E!r9m2SK8uJm%(!6P@RdHkh?qj&h4V{T^#FGKfc=FlNTUi0`eGCFQqn zlxOq7h=rG$k4qnXkrCEa;ayH0%O>90i49thWy;;@Dz!6)6I&#Hd~0>{lmG z&ObI>oAZdrY;^ukg@ZYN#xsTgm9k@*Mlzk8SDOvBu`VBp9(4>4tyF0PnrMl(zvv+* zTUOebFHBMAX$eMw1w7V2;!}^_2znE4<}XtmI|%ri>IsR{@X@kFbA7D zz*Ng3Nr$xlt^(@R0!V!7zI4=|X@F*iM#WeB@Cb$zm5h*)=tFPO-sf)R!?H}PsZ5wH zJnx+dKAIW9ul~?XsA9oxwcu$UTj{+V_2%CZac|M#PwE=`&_>}=4!(4pwqzQ{c?9l& zlAg!neeq0uEIt)~;nYpoG~$^R?(_}_$+9A|)H_kB#eG3xTA##fHB<|K@Gv&8jNN^p~%mjxDs22zW1#z&@mhi;IMec`eZfH8^wwT9-dX|hq?CJ z4k{&|(N=9K)PF`@!>xsGQQr2Nay8aPI#D~?e`awG8q@_(9Gy{b!c(r91?Mn`z)E9T zl3}n}ZWAE(C59W-FxN3g+ek;?>yw|wb}gUgnWOzNgpexB7bXGKwl5ptNiZENop|v2 z271Z@NY>Y2gOEQgEj;FhCAgMW1a+0fj@5#yY~u17Iogi$Bnuka0oKAGQ9yLcVjpm)umIcC_~g$`nc;b)f@$Ij zwF{*v!-K_@1xFyTD`{j&(48QXhK*u>k?NG4S`Oj?ZQ(Ko0$@cU17|9?pe}#(s{e*f z@cwxpSsKgE8bsb%UebaXZO;e*Mzm1 zdGhEH%x0L)tWfDt>B%EU_q=Cu0C)zLCrFP)I=ZkQzxntVz_YK%;Zk^SnTLN^hlf;| zC+sEHL&@#9*aM<}By196vz}!mXejd4y-NpRWD+#uY)V#OGS843+BLJ(vS}dXM8x=j zz3Z{^#NRRrgUtS#L)8XAy;6+JVGyg3l`jh&go5EbNPMX_pj<$R)t7mOEqn)6JP%bB zz*_=~Ovm6rT^9Czp+H$&^22ip^2UmlTJ+t{r2}X1@I(;s3`Yth8)NW{vr&kUy1$E0}0`-E5zWISTY*2Q1MgO&jLxEZrEg)!v z2i3Q8w13N5c5W~u+PE3Cy@b&8`I3(oW{Vl>_{qw4B@PVryur>g0PLTRmqzUS_U8ay zju8)Y+Fs0DvGaB)k$-;{gfA^#ptWCl=0!{ChnEhSPDUzj$WXZ6T{1S_y;~7`^{&OD z{af)-X|?sG{oZn{Y6jf_%14L}4IFW_8LBu2%D4j_kj_bE|H>oq@6%QDg?k1)pq+)X z&>kBw!0(DKvTtSv>Zz^s_pItg;nKr8HbJW(7G~*Z@8nr5Lx^r5AwG%Q49Xl2d;*>f z?pF=({bAX$KBnRSTJrUae^iUUe(}$tYx>!X&DE8a|GTBV=y~tKMH_#Xd!NNdM;Jz} z>cv~7bx#=x^}Vw{zVDx%^0x~LVfAyMg~s7xy@P+Bd6y7S&~f`_o3`pT+70@%hU~!~XyaD2g@! diff --git a/docs/.doctrees/polynomial.doctree b/docs/.doctrees/polynomial.doctree deleted file mode 100644 index dbfb145239e81ffc9968de40c5574614bac052c4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 53303 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 diff --git a/docs/.nojekyll b/docs/.nojekyll deleted file mode 100644 index 8b137891..00000000 --- a/docs/.nojekyll +++ /dev/null @@ -1 +0,0 @@ - diff --git a/docs/ChebyshevApproximator.html b/docs/ChebyshevApproximator.html deleted file mode 100644 index c3afff91..00000000 --- a/docs/ChebyshevApproximator.html +++ /dev/null @@ -1,184 +0,0 @@ - - - - - - - - - yroots.approximate — YRoots documentation - - - - - - - - - - - - - - - - - - - - -
-
-
- - -
- -
-

yroots.approximate

-
-

Approximator

-
-
-yroots.ChebyshevApproximator.chebApproximate(f, a, b, absApproxTol=1e-10, relApproxTol=1e-10)
-

Generate and return an approximation for the function f on the interval [a,b].

-

Uses properties of Chebyshev polynomials and the FFT to quickly generate a reliable -approximation. Examines approximation one dimension at a time to determine the degree at which -the coefficients geometrically converge to 0 in each dimension, then calculates and returns a -final approximation of these degree values along with the associated approximation error.

-

NOTE: The approximate function is only guaranteed to work well on functions that are continuous -and smooth on the approximation interval. If the input function is not continuous and smooth on -the interval, the approximation may get stuck in recursion.

-

Examples

-
>>> f = lambda x,y,z: x**2 - y**2 + 3*x*y
->>> approx, error = yroots.approximate(f,[-1,-1,-1],[1,1,1])
->>> print(approx)
-[[[ 0.00000000e+00]
-  [ 1.11022302e-16]
-  [-5.00000000e-01]]
- [[ 1.11022302e-16]
-  [ 3.00000000e+00]
-  [-1.11022302e-16]]
- [[ 5.00000000e-01]
-  [-1.11022302e-16]
-  [ 0.00000000e+00]]]
->>> print(error)
-2.8014584982224306e-24
-
-
-
>>> g = np.sqrt
->>> approx = yroots.approximate(g,[0],[5])[0]
->>> print(approx)
-[ 1.42352509e+00  9.49016725e-01 -1.89803345e-01 ... -1.24418041e-10
-  1.24418045e-10 -6.22090244e-11]
-
-
-
-
Parameters:
-
    -
  • f (function) – The function to be approximated. NOTE: Valid input is restricted to callable Python functions -(including user-created functions) and yroots Polynomial (MultiCheb and MultiPower) objects. -String representations of functions are not valid input.

  • -
  • a (list or numpy array) – An array containing the lower bound of the approximation interval in each dimension, listed in -dimension order

  • -
  • b (list or numpy array) – An array containing the upper bound of the approximation interval in each dimension, listed in -dimension order.

  • -
  • absApproxTol (float) – The absolute tolerance used to determine at what degree the Chebyshev coefficients have -converged to zero. If all coefficients after degree n are within absApproxTol from zero, -the coefficients will be considered to have converged at degree n. Defaults to 1e-10.

  • -
  • relApproxTol (float) – The relative tolerance used to determine at what degree the Chebyshev coefficients have -converged to zero. If all coefficients after degree n are within relApproxTol * supNorm -(the maximum function evaluation on the interval) of zero, the coefficients will be -considered to have converged at degree n. Defaults to 1e-10.

  • -
-
-
Returns:
-

    -
  • coefficient_matrix (numpy array) – The coefficient matrix of the Chebyshev approximation.

  • -
  • error (float) – The error associated with the approximation.

  • -
-

-
-
-
- -
-
- - -
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/ChebyshevSubdivisionSolver.html b/docs/ChebyshevSubdivisionSolver.html deleted file mode 100644 index a60d551c..00000000 --- a/docs/ChebyshevSubdivisionSolver.html +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - - - - ChebyshevSubdivisionSolver — YRoots documentation - - - - - - - - - - - - - - - - - - - - -
-
-
- - -
- -
-

ChebyshevSubdivisionSolver

-
-

High-level Process:

-
-
-yroots.ChebyshevSubdivisionSolver.solveChebyshevSubdivision(Ms, errors, returnBoundingBoxes=False, polish=False, exact=False, constant_check=True, low_dim_quadratic_check=True, all_dim_quadratic_check=False)
-

Initiates shrinking and subdivision recursion and returns the roots and bounding boxes.

-
-
Parameters:
-
    -
  • Ms (list of numpy arrays) – The chebyshev approximations of the functions on the interval given to CombinedSolver

  • -
  • errors (numpy array) – The max error of the chebyshev approximation from the function on the interval

  • -
  • returnBoundingBoxes (bool (Optional)) – Defaults to False. If True, returns the bounding boxes around each root as well as the roots.

  • -
  • polish (bool (Optional)) – Defaults to False. Whether or not to polish the roots at the end.

  • -
  • exact (bool) – Whether transformations should be done with higher precision to minimize error.

  • -
  • constant_check (bool) – Defaults to True. Whether or not to run constant term check after each subdivision.

  • -
  • low_dim_quadratic_check (bool) – Defaults to True. Whether or not to run quadratic check in dim 2, 3.

  • -
  • all_dim_quadratic_check (bool) – Defaults to False. Whether or not to run quadratic check in dim >= 4.

  • -
-
-
Returns:
-

    -
  • roots (list) – The roots of the system of functions on the interval given to Combined Solver

  • -
  • boundingBoxes (list of numpy arrays (optional)) – List of intervals for each root in which the root is bound to lie.

  • -
-

-
-
-
- -
-
- - -
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/CombinedSolver.html b/docs/CombinedSolver.html deleted file mode 100644 index 999b691c..00000000 --- a/docs/CombinedSolver.html +++ /dev/null @@ -1,186 +0,0 @@ - - - - - - - - - yroots.solve() — YRoots documentation - - - - - - - - - - - - - - - - - - - - -
-
-
- - -
- -
-

yroots.solve()

-
-

Solver

-
-
-yroots.Combined_Solver.solve(funcs, a=- 1, b=1, verbose=False, returnBoundingBoxes=False, exact=False)
-

Finds and returns the roots of a system of functions on the search interval [a,b].

-

Generates an approximation for each function using Chebyshev polynomials on the interval given, -then uses properties of the approximations to shrink the search interval. When the information -contained in the approximation is insufficient to shrink the interval further, the interval is -subdivided into subregions, and the searching function is recursively called until it zeros in -on each root. A specific point (and, optionally, a bounding box) is returned for each root found.

-

NOTE: YRoots uses just in time compiling, which means that part of the code will not be compiled until -a system of functions to solve is given (rather than compiling all the code upon importing the module). -As a result, the very first time the solver is given any system of equations of a particular dimension, -the module will take several seconds longer to solve due to compiling time. Once the first system of a -particular dimension has run, however, other systems of that dimension (or even the same system run -again) will be solved at the normal (faster) speed thereafter.

-

NOTE: The solve function is only guaranteed to work well on systems of equations where each function -is continuous and smooth and each root in the interval is a simple root. If a function is not -continuous and smooth on an interval or an infinite number of roots exist in the interval, the -solver may get stuck in recursion or the kernel may crash.

-

Examples

-
>>> f = lambda x,y,z: 2*x**2 / (x**4-4) - 2*x**2 + .5
->>> g = lambda x,y,z: 2*x**2*y / (y**2+4) - 2*y + 2*x*z
->>> h = lambda x,y,z: 2*z / (z**2-4) - 2*z
->>> roots = yroots.solve([f, g, h], np.array([-0.5,0,-2**-2.44]), np.array([0.5,np.exp(1.1376),.8]))
->>> print(roots)
-[[-4.46764373e-01  4.44089210e-16 -5.55111512e-17]
- [ 4.46764373e-01  4.44089210e-16 -5.55111512e-17]]
-
-
-
>>> M1 = yroots.MultiPower(np.array([[0,3,0,2],[1.5,0,7,0],[0,0,4,-2],[0,0,0,1]]))
->>> M2 = yroots.MultiCheb(np.array([[0.02,0.31],[-0.43,0.19],[0.06,0]]))
->>> roots = yroots.solve([M1,M2],-5,5)
->>> print(roots)
-[[-0.98956615 -4.12372817]
- [-0.06810064  0.03420242]]
-
-
-
-
Parameters:
-
    -
  • funcs (list) – List of functions for searching. NOTE: Valid input is restricted to callable Python functions -(including user-created functions) and yroots Polynomial (MultiCheb and MultiPower) objects. -String representations of functions are not valid input.

  • -
  • a (list or numpy array) – An array containing the lower bound of the search interval in each dimension, listed in -dimension order. If the lower bound is to be the same in each dimension, a single float input -is also accepted. Defaults to -1 in each dimension if no input is given.

  • -
  • b (list or numpy array) – An array containing the upper bound of the search interval in each dimension, listed in -dimension order. If the upper bound is to be the same in each dimension, a single float input -is also accepted. Defaults to 1 in each dimension if no input is given.

  • -
  • verbose (bool) – Defaults to False. Tracks progress of the approximation and rootfinding by outputting progress to -the terminal. Useful in tracking progress of systems of equations that take a long time to solve.

  • -
  • returnBoundingBoxes (bool) – Defaults to False. Whether or not to return a precise bounding box for each root.

  • -
  • exact (bool) – Defaults to False. Whether transformations performed on the approximation should be performed -with higher precision to minimize error.

  • -
-
-
Returns:
-

    -
  • yroots (numpy array) – A list of the roots of the system of functions on the interval.

  • -
  • boundingBoxes (numpy array (optional)) – The exact intervals (boxes) in which each root is bound to lie.

  • -
-

-
-
-
- -
-
- - -
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/MultiCheb.html b/docs/MultiCheb.html deleted file mode 100644 index d243efe9..00000000 --- a/docs/MultiCheb.html +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - - - - MultiCheb — YRoots documentation - - - - - - - - - - - - - - - - - - - - -
-
-
- - -
- -
-

MultiCheb

-
-
-

MultiCheb Class

-
-
-class yroots.polynomial.MultiCheb(coeff, clean_zeros=True)
-

Coefficient tensor representation of a Chebyshev basis polynomial.

-

Using this class instead of a Python callable function to represent a Chebyshev polynomial -can lead to faster function evaluations during approximation.

-

Examples

-

To represent 4*T_2(x) + 1T_3(x) (using Chebyshev polynomials of the first kind):

-
>>> f = yroots.MultiCheb([0,0,4,1])
->>> print(f)
-[-4.   0.   5.5  0.   0.   0.   3. ]
-
-
-
-
Parameters:
-
    -
  • coeff (list or numpy array) – An array containing the coefficients of the polynomial. If the polynomial is n-dimensional, -the (i,j,…,n) index represents the term having T_i(x)*T_j(y)*….

  • -
  • clean_zeros (bool) – Whether or not to remove all extra rows or columns containing only zeros. Defaults to True.

  • -
-
-
-
- -
-
- - -
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/MultiPower.html b/docs/MultiPower.html deleted file mode 100644 index fbd3fefb..00000000 --- a/docs/MultiPower.html +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - - - - MultiPower — YRoots documentation - - - - - - - - - - - - - - - - - - - -
-
-
- - -
- -
-

MultiPower

-
-
-

MultiPower Class

-
-
-class yroots.polynomial.MultiPower(coeff, clean_zeros=True)
-

Coefficient tensor representation of a power basis polynomial.

-

Using this class instead of a Python callable function to represent a power basis polynomial -can lead to faster function evaluations during approximation.

-

Examples

-

To represent 3x^6 + 5.5x^2 -4:

-
>>> f = yroots.MultiPower([-4,0,5.5,0,0,0,3])
->>> print(f)
-[-4.   0.   5.5  0.   0.   0.   3. ]
-
-
-

To represent 0.62x^3*y - 0.11x*y + 1.03y^2 - 0.58:

-
>>> f = yroots.MultiPower(np.array([[-0.58,0,1.03],[0,-0.11,0],[0,0,0],[0,0.62,0]]))
->>> print(f)
-[[-0.58  0.    1.03]
- [ 0.   -0.11  0.  ]
- [ 0.    0.    0.  ]
- [ 0.    0.62  0.  ]]
-
-
-
-
Parameters:
-
    -
  • coeff (list or numpy array) – An array containing the coefficients of the polynomial. If the polynomial is n-dimensional, -the (i,j,…,n) index represents the term of degree i in dimension 0, degree j in dimension 1, -and so forth.

  • -
  • clean_zeros (bool) – Whether or not to remove all extra rows or columns containing only zeros. Defaults to True.

  • -
-
-
-
- -
-
- - -
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/_static/_sphinx_javascript_frameworks_compat.js b/docs/_static/_sphinx_javascript_frameworks_compat.js deleted file mode 100644 index 8549469d..00000000 --- a/docs/_static/_sphinx_javascript_frameworks_compat.js +++ /dev/null @@ -1,134 +0,0 @@ -/* - * _sphinx_javascript_frameworks_compat.js - * ~~~~~~~~~~ - * - * Compatability shim for jQuery and underscores.js. - * - * WILL BE REMOVED IN Sphinx 6.0 - * xref RemovedInSphinx60Warning - * - */ - -/** - * select a different prefix for underscore - */ -$u = _.noConflict(); - - -/** - * small helper function to urldecode strings - * - * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#Decoding_query_parameters_from_a_URL - */ -jQuery.urldecode = function(x) { - if (!x) { - return x - } - return decodeURIComponent(x.replace(/\+/g, ' ')); -}; - -/** - * small helper function to urlencode strings - */ -jQuery.urlencode = encodeURIComponent; - -/** - * This function returns the parsed url parameters of the - * current request. Multiple values per key are supported, - * it will always return arrays of strings for the value parts. - */ -jQuery.getQueryParameters = function(s) { - if (typeof s === 'undefined') - s = document.location.search; - var parts = s.substr(s.indexOf('?') + 1).split('&'); - var result = {}; - for (var i = 0; i < parts.length; i++) { - var tmp = parts[i].split('=', 2); - var key = jQuery.urldecode(tmp[0]); - var value = jQuery.urldecode(tmp[1]); - if (key in result) - result[key].push(value); - else - result[key] = [value]; - } - return result; -}; - -/** - * highlight a given string on a jquery object by wrapping it in - * span elements with the given class name. - */ -jQuery.fn.highlightText = function(text, className) { - function highlight(node, addItems) { - if (node.nodeType === 3) { - var val = node.nodeValue; - var pos = val.toLowerCase().indexOf(text); - if (pos >= 0 && - !jQuery(node.parentNode).hasClass(className) && - !jQuery(node.parentNode).hasClass("nohighlight")) { - var span; - var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg"); - if (isInSVG) { - span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); - } else { - span = document.createElement("span"); - span.className = className; - } - span.appendChild(document.createTextNode(val.substr(pos, text.length))); - node.parentNode.insertBefore(span, node.parentNode.insertBefore( - document.createTextNode(val.substr(pos + text.length)), - node.nextSibling)); - node.nodeValue = val.substr(0, pos); - if (isInSVG) { - var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect"); - var bbox = node.parentElement.getBBox(); - rect.x.baseVal.value = bbox.x; - rect.y.baseVal.value = bbox.y; - rect.width.baseVal.value = bbox.width; - rect.height.baseVal.value = bbox.height; - rect.setAttribute('class', className); - addItems.push({ - "parent": node.parentNode, - "target": rect}); - } - } - } - else if (!jQuery(node).is("button, select, textarea")) { - jQuery.each(node.childNodes, function() { - highlight(this, addItems); - }); - } - } - var addItems = []; - var result = this.each(function() { - highlight(this, addItems); - }); - for (var i = 0; i < addItems.length; ++i) { - jQuery(addItems[i].parent).before(addItems[i].target); - } - return result; -}; - -/* - * backward compatibility for jQuery.browser - * This will be supported until firefox bug is fixed. - */ -if (!jQuery.browser) { - jQuery.uaMatch = function(ua) { - ua = ua.toLowerCase(); - - var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || - /(webkit)[ \/]([\w.]+)/.exec(ua) || - /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || - /(msie) ([\w.]+)/.exec(ua) || - ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || - []; - - return { - browser: match[ 1 ] || "", - version: match[ 2 ] || "0" - }; - }; - jQuery.browser = {}; - jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; -} diff --git a/docs/_static/alabaster.css b/docs/_static/alabaster.css deleted file mode 100644 index 0eddaeb0..00000000 --- a/docs/_static/alabaster.css +++ /dev/null @@ -1,701 +0,0 @@ -@import url("basic.css"); - -/* -- page layout ----------------------------------------------------------- */ - -body { - font-family: Georgia, serif; - font-size: 17px; - background-color: #fff; - color: #000; - margin: 0; - padding: 0; -} - - -div.document { - width: 940px; - margin: 30px auto 0 auto; -} - -div.documentwrapper { - float: left; - width: 100%; -} - -div.bodywrapper { - margin: 0 0 0 220px; -} - -div.sphinxsidebar { - width: 220px; - font-size: 14px; - line-height: 1.5; -} - -hr { - border: 1px solid #B1B4B6; -} - -div.body { - background-color: #fff; - color: #3E4349; - padding: 0 30px 0 30px; -} - -div.body > .section { - text-align: left; -} - -div.footer { - width: 940px; - margin: 20px auto 30px auto; - font-size: 14px; - color: #888; - text-align: right; -} - -div.footer a { - color: #888; -} - -p.caption { - font-family: inherit; - font-size: inherit; -} - - -div.relations { - display: none; -} - - -div.sphinxsidebar a { - color: #444; - text-decoration: none; - border-bottom: 1px dotted #999; -} - -div.sphinxsidebar a:hover { - border-bottom: 1px solid #999; -} - -div.sphinxsidebarwrapper { - padding: 18px 10px; -} - -div.sphinxsidebarwrapper p.logo { - padding: 0; - margin: -10px 0 0 0px; - text-align: center; -} - -div.sphinxsidebarwrapper h1.logo { - margin-top: -10px; - text-align: center; - margin-bottom: 5px; - text-align: left; -} - -div.sphinxsidebarwrapper h1.logo-name { - margin-top: 0px; -} - -div.sphinxsidebarwrapper p.blurb { - margin-top: 0; - font-style: normal; -} - -div.sphinxsidebar h3, -div.sphinxsidebar h4 { - font-family: Georgia, serif; - color: #444; - font-size: 24px; - font-weight: normal; - margin: 0 0 5px 0; - padding: 0; -} - -div.sphinxsidebar h4 { - font-size: 20px; -} - -div.sphinxsidebar h3 a { - color: #444; -} - -div.sphinxsidebar p.logo a, -div.sphinxsidebar h3 a, -div.sphinxsidebar p.logo a:hover, -div.sphinxsidebar h3 a:hover { - border: none; -} - -div.sphinxsidebar p { - color: #555; - margin: 10px 0; -} - -div.sphinxsidebar ul { - margin: 10px 0; - padding: 0; - color: #000; -} - -div.sphinxsidebar ul li.toctree-l1 > a { - font-size: 120%; -} - -div.sphinxsidebar ul li.toctree-l2 > a { - font-size: 110%; -} - -div.sphinxsidebar input { - border: 1px solid #CCC; - font-family: Georgia, serif; - font-size: 1em; -} - -div.sphinxsidebar hr { - border: none; - height: 1px; - color: #AAA; - background: #AAA; - - text-align: left; - margin-left: 0; - width: 50%; -} - -div.sphinxsidebar .badge { - border-bottom: none; -} - -div.sphinxsidebar .badge:hover { - border-bottom: none; -} - -/* To address an issue with donation coming after search */ -div.sphinxsidebar h3.donation { - margin-top: 10px; -} - -/* -- body styles ----------------------------------------------------------- */ - -a { - color: #004B6B; - text-decoration: underline; -} - -a:hover { - color: #6D4100; - text-decoration: underline; -} - -div.body h1, -div.body h2, -div.body h3, -div.body h4, -div.body h5, -div.body h6 { - font-family: Georgia, serif; - font-weight: normal; - margin: 30px 0px 10px 0px; - padding: 0; -} - -div.body h1 { margin-top: 0; padding-top: 0; font-size: 240%; } -div.body h2 { font-size: 180%; } -div.body h3 { font-size: 150%; } -div.body h4 { font-size: 130%; } -div.body h5 { font-size: 100%; } -div.body h6 { font-size: 100%; } - -a.headerlink { - color: #DDD; - padding: 0 4px; - text-decoration: none; -} - -a.headerlink:hover { - color: #444; - background: #EAEAEA; -} - -div.body p, div.body dd, div.body li { - line-height: 1.4em; -} - -div.admonition { - margin: 20px 0px; - padding: 10px 30px; - background-color: #EEE; - border: 1px solid #CCC; -} - -div.admonition tt.xref, div.admonition code.xref, div.admonition a tt { - background-color: #FBFBFB; - border-bottom: 1px solid #fafafa; -} - -div.admonition p.admonition-title { - font-family: Georgia, serif; - font-weight: normal; - font-size: 24px; - margin: 0 0 10px 0; - padding: 0; - line-height: 1; -} - -div.admonition p.last { - margin-bottom: 0; -} - -div.highlight { - background-color: #fff; -} - -dt:target, .highlight { - background: #FAF3E8; -} - -div.warning { - background-color: #FCC; - border: 1px solid #FAA; -} - -div.danger { - background-color: #FCC; - border: 1px solid #FAA; - -moz-box-shadow: 2px 2px 4px #D52C2C; - -webkit-box-shadow: 2px 2px 4px #D52C2C; - box-shadow: 2px 2px 4px #D52C2C; -} - -div.error { - background-color: #FCC; - border: 1px solid #FAA; - -moz-box-shadow: 2px 2px 4px #D52C2C; - -webkit-box-shadow: 2px 2px 4px #D52C2C; - box-shadow: 2px 2px 4px #D52C2C; -} - -div.caution { - background-color: #FCC; - border: 1px solid #FAA; -} - -div.attention { - background-color: #FCC; - border: 1px solid #FAA; -} - -div.important { - background-color: #EEE; - border: 1px solid #CCC; -} - -div.note { - background-color: #EEE; - border: 1px solid #CCC; -} - -div.tip { - background-color: #EEE; - border: 1px solid #CCC; -} - -div.hint { - background-color: #EEE; - border: 1px solid #CCC; -} - -div.seealso { - background-color: #EEE; - border: 1px solid #CCC; -} - -div.topic { - background-color: #EEE; -} - -p.admonition-title { - display: inline; -} - -p.admonition-title:after { - content: ":"; -} - -pre, tt, code { - font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace; - font-size: 0.9em; -} - -.hll { - background-color: #FFC; - margin: 0 -12px; - padding: 0 12px; - display: block; -} - -img.screenshot { -} - -tt.descname, tt.descclassname, code.descname, code.descclassname { - font-size: 0.95em; -} - -tt.descname, code.descname { - padding-right: 0.08em; -} - -img.screenshot { - -moz-box-shadow: 2px 2px 4px #EEE; - -webkit-box-shadow: 2px 2px 4px #EEE; - box-shadow: 2px 2px 4px #EEE; -} - -table.docutils { - border: 1px solid #888; - -moz-box-shadow: 2px 2px 4px #EEE; - -webkit-box-shadow: 2px 2px 4px #EEE; - box-shadow: 2px 2px 4px #EEE; -} - -table.docutils td, table.docutils th { - border: 1px solid #888; - padding: 0.25em 0.7em; -} - -table.field-list, table.footnote { - border: none; - -moz-box-shadow: none; - -webkit-box-shadow: none; - box-shadow: none; -} - -table.footnote { - margin: 15px 0; - width: 100%; - border: 1px solid #EEE; - background: #FDFDFD; - font-size: 0.9em; -} - -table.footnote + table.footnote { - margin-top: -15px; - border-top: none; -} - -table.field-list th { - padding: 0 0.8em 0 0; -} - -table.field-list td { - padding: 0; -} - -table.field-list p { - margin-bottom: 0.8em; -} - -/* Cloned from - * https://github.com/sphinx-doc/sphinx/commit/ef60dbfce09286b20b7385333d63a60321784e68 - */ -.field-name { - -moz-hyphens: manual; - -ms-hyphens: manual; - -webkit-hyphens: manual; - hyphens: manual; -} - -table.footnote td.label { - width: .1px; - padding: 0.3em 0 0.3em 0.5em; -} - -table.footnote td { - padding: 0.3em 0.5em; -} - -dl { - margin: 0; - padding: 0; -} - -dl dd { - margin-left: 30px; -} - -blockquote { - margin: 0 0 0 30px; - padding: 0; -} - -ul, ol { - /* Matches the 30px from the narrow-screen "li > ul" selector below */ - margin: 10px 0 10px 30px; - padding: 0; -} - -pre { - background: #EEE; - padding: 7px 30px; - margin: 15px 0px; - line-height: 1.3em; -} - -div.viewcode-block:target { - background: #ffd; -} - -dl pre, blockquote pre, li pre { - margin-left: 0; - padding-left: 30px; -} - -tt, code { - background-color: #ecf0f3; - color: #222; - /* padding: 1px 2px; */ -} - -tt.xref, code.xref, a tt { - background-color: #FBFBFB; - border-bottom: 1px solid #fff; -} - -a.reference { - text-decoration: none; - border-bottom: 1px dotted #004B6B; -} - -/* Don't put an underline on images */ -a.image-reference, a.image-reference:hover { - border-bottom: none; -} - -a.reference:hover { - border-bottom: 1px solid #6D4100; -} - -a.footnote-reference { - text-decoration: none; - font-size: 0.7em; - vertical-align: top; - border-bottom: 1px dotted #004B6B; -} - -a.footnote-reference:hover { - border-bottom: 1px solid #6D4100; -} - -a:hover tt, a:hover code { - background: #EEE; -} - - -@media screen and (max-width: 870px) { - - div.sphinxsidebar { - display: none; - } - - div.document { - width: 100%; - - } - - div.documentwrapper { - margin-left: 0; - margin-top: 0; - margin-right: 0; - margin-bottom: 0; - } - - div.bodywrapper { - margin-top: 0; - margin-right: 0; - margin-bottom: 0; - margin-left: 0; - } - - ul { - margin-left: 0; - } - - li > ul { - /* Matches the 30px from the "ul, ol" selector above */ - margin-left: 30px; - } - - .document { - width: auto; - } - - .footer { - width: auto; - } - - .bodywrapper { - margin: 0; - } - - .footer { - width: auto; - } - - .github { - display: none; - } - - - -} - - - -@media screen and (max-width: 875px) { - - body { - margin: 0; - padding: 20px 30px; - } - - div.documentwrapper { - float: none; - background: #fff; - } - - div.sphinxsidebar { - display: block; - float: none; - width: 102.5%; - margin: 50px -30px -20px -30px; - padding: 10px 20px; - background: #333; - color: #FFF; - } - - div.sphinxsidebar h3, div.sphinxsidebar h4, div.sphinxsidebar p, - div.sphinxsidebar h3 a { - color: #fff; - } - - div.sphinxsidebar a { - color: #AAA; - } - - div.sphinxsidebar p.logo { - display: none; - } - - div.document { - width: 100%; - margin: 0; - } - - div.footer { - display: none; - } - - div.bodywrapper { - margin: 0; - } - - div.body { - min-height: 0; - padding: 0; - } - - .rtd_doc_footer { - display: none; - } - - .document { - width: auto; - } - - .footer { - width: auto; - } - - .footer { - width: auto; - } - - .github { - display: none; - } -} - - -/* misc. */ - -.revsys-inline { - display: none!important; -} - -/* Make nested-list/multi-paragraph items look better in Releases changelog - * pages. Without this, docutils' magical list fuckery causes inconsistent - * formatting between different release sub-lists. - */ -div#changelog > div.section > ul > li > p:only-child { - margin-bottom: 0; -} - -/* Hide fugly table cell borders in ..bibliography:: directive output */ -table.docutils.citation, table.docutils.citation td, table.docutils.citation th { - border: none; - /* Below needed in some edge cases; if not applied, bottom shadows appear */ - -moz-box-shadow: none; - -webkit-box-shadow: none; - box-shadow: none; -} - - -/* relbar */ - -.related { - line-height: 30px; - width: 100%; - font-size: 0.9rem; -} - -.related.top { - border-bottom: 1px solid #EEE; - margin-bottom: 20px; -} - -.related.bottom { - border-top: 1px solid #EEE; -} - -.related ul { - padding: 0; - margin: 0; - list-style: none; -} - -.related li { - display: inline; -} - -nav#rellinks { - float: right; -} - -nav#rellinks li+li:before { - content: "|"; -} - -nav#breadcrumbs li+li:before { - content: "\00BB"; -} - -/* Hide certain items when printing */ -@media print { - div.related { - display: none; - } -} \ No newline at end of file diff --git a/docs/_static/basic.css b/docs/_static/basic.css deleted file mode 100644 index 08896771..00000000 --- a/docs/_static/basic.css +++ /dev/null @@ -1,930 +0,0 @@ -/* - * basic.css - * ~~~~~~~~~ - * - * Sphinx stylesheet -- basic theme. - * - * :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -/* -- main layout ----------------------------------------------------------- */ - -div.clearer { - clear: both; -} - -div.section::after { - display: block; - content: ''; - clear: left; -} - -/* -- relbar ---------------------------------------------------------------- */ - -div.related { - width: 100%; - font-size: 90%; -} - -div.related h3 { - display: none; -} - -div.related ul { - margin: 0; - padding: 0 0 0 10px; - list-style: none; -} - -div.related li { - display: inline; -} - -div.related li.right { - float: right; - margin-right: 5px; -} - -/* -- sidebar --------------------------------------------------------------- */ - -div.sphinxsidebarwrapper { - padding: 10px 5px 0 10px; -} - -div.sphinxsidebar { - float: left; - width: 230px; - margin-left: -100%; - font-size: 90%; - word-wrap: break-word; - overflow-wrap : break-word; -} - -div.sphinxsidebar ul { - list-style: none; -} - -div.sphinxsidebar ul ul, -div.sphinxsidebar ul.want-points { - margin-left: 20px; - list-style: square; -} - -div.sphinxsidebar ul ul { - margin-top: 0; - margin-bottom: 0; -} - -div.sphinxsidebar form { - margin-top: 10px; -} - -div.sphinxsidebar input { - border: 1px solid #98dbcc; - font-family: sans-serif; - font-size: 1em; -} - -div.sphinxsidebar #searchbox form.search { - overflow: hidden; -} - -div.sphinxsidebar #searchbox input[type="text"] { - float: left; - width: 80%; - padding: 0.25em; - box-sizing: border-box; -} - -div.sphinxsidebar #searchbox input[type="submit"] { - float: left; - width: 20%; - border-left: none; - padding: 0.25em; - box-sizing: border-box; -} - - -img { - border: 0; - max-width: 100%; -} - -/* -- search page ----------------------------------------------------------- */ - -ul.search { - margin: 10px 0 0 20px; - padding: 0; -} - -ul.search li { - padding: 5px 0 5px 20px; - background-image: url(file.png); - background-repeat: no-repeat; - background-position: 0 7px; -} - -ul.search li a { - font-weight: bold; -} - -ul.search li p.context { - color: #888; - margin: 2px 0 0 30px; - text-align: left; -} - -ul.keywordmatches li.goodmatch a { - font-weight: bold; -} - -/* -- index page ------------------------------------------------------------ */ - -table.contentstable { - width: 90%; - margin-left: auto; - margin-right: auto; -} - -table.contentstable p.biglink { - line-height: 150%; -} - -a.biglink { - font-size: 1.3em; -} - -span.linkdescr { - font-style: italic; - padding-top: 5px; - font-size: 90%; -} - -/* -- general index --------------------------------------------------------- */ - -table.indextable { - width: 100%; -} - -table.indextable td { - text-align: left; - vertical-align: top; -} - -table.indextable ul { - margin-top: 0; - margin-bottom: 0; - list-style-type: none; -} - -table.indextable > tbody > tr > td > ul { - padding-left: 0em; -} - -table.indextable tr.pcap { - height: 10px; -} - -table.indextable tr.cap { - margin-top: 10px; - background-color: #f2f2f2; -} - -img.toggler { - margin-right: 3px; - margin-top: 3px; - cursor: pointer; -} - -div.modindex-jumpbox { - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - margin: 1em 0 1em 0; - padding: 0.4em; -} - -div.genindex-jumpbox { - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - margin: 1em 0 1em 0; - padding: 0.4em; -} - -/* -- domain module index --------------------------------------------------- */ - -table.modindextable td { - padding: 2px; - border-collapse: collapse; -} - -/* -- general body styles --------------------------------------------------- */ - -div.body { - min-width: 360px; - max-width: 800px; -} - -div.body p, div.body dd, div.body li, div.body blockquote { - -moz-hyphens: auto; - -ms-hyphens: auto; - -webkit-hyphens: auto; - hyphens: auto; -} - -a.headerlink { - visibility: hidden; -} - -h1:hover > a.headerlink, -h2:hover > a.headerlink, -h3:hover > a.headerlink, -h4:hover > a.headerlink, -h5:hover > a.headerlink, -h6:hover > a.headerlink, -dt:hover > a.headerlink, -caption:hover > a.headerlink, -p.caption:hover > a.headerlink, -div.code-block-caption:hover > a.headerlink { - visibility: visible; -} - -div.body p.caption { - text-align: inherit; -} - -div.body td { - text-align: left; -} - -.first { - margin-top: 0 !important; -} - -p.rubric { - margin-top: 30px; - font-weight: bold; -} - -img.align-left, figure.align-left, .figure.align-left, object.align-left { - clear: left; - float: left; - margin-right: 1em; -} - -img.align-right, figure.align-right, .figure.align-right, object.align-right { - clear: right; - float: right; - margin-left: 1em; -} - -img.align-center, figure.align-center, .figure.align-center, object.align-center { - display: block; - margin-left: auto; - margin-right: auto; -} - -img.align-default, figure.align-default, .figure.align-default { - display: block; - margin-left: auto; - margin-right: auto; -} - -.align-left { - text-align: left; -} - -.align-center { - text-align: center; -} - -.align-default { - text-align: center; -} - -.align-right { - text-align: right; -} - -/* -- sidebars -------------------------------------------------------------- */ - -div.sidebar, -aside.sidebar { - margin: 0 0 0.5em 1em; - border: 1px solid #ddb; - padding: 7px; - background-color: #ffe; - width: 40%; - float: right; - clear: right; - overflow-x: auto; -} - -p.sidebar-title { - font-weight: bold; -} -nav.contents, -aside.topic, - -div.admonition, div.topic, blockquote { - clear: left; -} - -/* -- topics ---------------------------------------------------------------- */ -nav.contents, -aside.topic, - -div.topic { - border: 1px solid #ccc; - padding: 7px; - margin: 10px 0 10px 0; -} - -p.topic-title { - font-size: 1.1em; - font-weight: bold; - margin-top: 10px; -} - -/* -- admonitions ----------------------------------------------------------- */ - -div.admonition { - margin-top: 10px; - margin-bottom: 10px; - padding: 7px; -} - -div.admonition dt { - font-weight: bold; -} - -p.admonition-title { - margin: 0px 10px 5px 0px; - font-weight: bold; -} - -div.body p.centered { - text-align: center; - margin-top: 25px; -} - -/* -- content of sidebars/topics/admonitions -------------------------------- */ - -div.sidebar > :last-child, -aside.sidebar > :last-child, -nav.contents > :last-child, -aside.topic > :last-child, - -div.topic > :last-child, -div.admonition > :last-child { - margin-bottom: 0; -} - -div.sidebar::after, -aside.sidebar::after, -nav.contents::after, -aside.topic::after, - -div.topic::after, -div.admonition::after, -blockquote::after { - display: block; - content: ''; - clear: both; -} - -/* -- tables ---------------------------------------------------------------- */ - -table.docutils { - margin-top: 10px; - margin-bottom: 10px; - border: 0; - border-collapse: collapse; -} - -table.align-center { - margin-left: auto; - margin-right: auto; -} - -table.align-default { - margin-left: auto; - margin-right: auto; -} - -table caption span.caption-number { - font-style: italic; -} - -table caption span.caption-text { -} - -table.docutils td, table.docutils th { - padding: 1px 8px 1px 5px; - border-top: 0; - border-left: 0; - border-right: 0; - border-bottom: 1px solid #aaa; -} - -th { - text-align: left; - padding-right: 5px; -} - -table.citation { - border-left: solid 1px gray; - margin-left: 1px; -} - -table.citation td { - border-bottom: none; -} - -th > :first-child, -td > :first-child { - margin-top: 0px; -} - -th > :last-child, -td > :last-child { - margin-bottom: 0px; -} - -/* -- figures --------------------------------------------------------------- */ - -div.figure, figure { - margin: 0.5em; - padding: 0.5em; -} - -div.figure p.caption, figcaption { - padding: 0.3em; -} - -div.figure p.caption span.caption-number, -figcaption span.caption-number { - font-style: italic; -} - -div.figure p.caption span.caption-text, -figcaption span.caption-text { -} - -/* -- field list styles ----------------------------------------------------- */ - -table.field-list td, table.field-list th { - border: 0 !important; -} - -.field-list ul { - margin: 0; - padding-left: 1em; -} - -.field-list p { - margin: 0; -} - -.field-name { - -moz-hyphens: manual; - -ms-hyphens: manual; - -webkit-hyphens: manual; - hyphens: manual; -} - -/* -- hlist styles ---------------------------------------------------------- */ - -table.hlist { - margin: 1em 0; -} - -table.hlist td { - vertical-align: top; -} - -/* -- object description styles --------------------------------------------- */ - -.sig { - font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace; -} - -.sig-name, code.descname { - background-color: transparent; - font-weight: bold; -} - -.sig-name { - font-size: 1.1em; -} - -code.descname { - font-size: 1.2em; -} - -.sig-prename, code.descclassname { - background-color: transparent; -} - -.optional { - font-size: 1.3em; -} - -.sig-paren { - font-size: larger; -} - -.sig-param.n { - font-style: italic; -} - -/* C++ specific styling */ - -.sig-inline.c-texpr, -.sig-inline.cpp-texpr { - font-family: unset; -} - -.sig.c .k, .sig.c .kt, -.sig.cpp .k, .sig.cpp .kt { - color: #0033B3; -} - -.sig.c .m, -.sig.cpp .m { - color: #1750EB; -} - -.sig.c .s, .sig.c .sc, -.sig.cpp .s, .sig.cpp .sc { - color: #067D17; -} - - -/* -- other body styles ----------------------------------------------------- */ - -ol.arabic { - list-style: decimal; -} - -ol.loweralpha { - list-style: lower-alpha; -} - -ol.upperalpha { - list-style: upper-alpha; -} - -ol.lowerroman { - list-style: lower-roman; -} - -ol.upperroman { - list-style: upper-roman; -} - -:not(li) > ol > li:first-child > :first-child, -:not(li) > ul > li:first-child > :first-child { - margin-top: 0px; -} - -:not(li) > ol > li:last-child > :last-child, -:not(li) > ul > li:last-child > :last-child { - margin-bottom: 0px; -} - -ol.simple ol p, -ol.simple ul p, -ul.simple ol p, -ul.simple ul p { - margin-top: 0; -} - -ol.simple > li:not(:first-child) > p, -ul.simple > li:not(:first-child) > p { - margin-top: 0; -} - -ol.simple p, -ul.simple p { - margin-bottom: 0; -} - -/* Docutils 0.17 and older (footnotes & citations) */ -dl.footnote > dt, -dl.citation > dt { - float: left; - margin-right: 0.5em; -} - -dl.footnote > dd, -dl.citation > dd { - margin-bottom: 0em; -} - -dl.footnote > dd:after, -dl.citation > dd:after { - content: ""; - clear: both; -} - -/* Docutils 0.18+ (footnotes & citations) */ -aside.footnote > span, -div.citation > span { - float: left; -} -aside.footnote > span:last-of-type, -div.citation > span:last-of-type { - padding-right: 0.5em; -} -aside.footnote > p { - margin-left: 2em; -} -div.citation > p { - margin-left: 4em; -} -aside.footnote > p:last-of-type, -div.citation > p:last-of-type { - margin-bottom: 0em; -} -aside.footnote > p:last-of-type:after, -div.citation > p:last-of-type:after { - content: ""; - clear: both; -} - -/* Footnotes & citations ends */ - -dl.field-list { - display: grid; - grid-template-columns: fit-content(30%) auto; -} - -dl.field-list > dt { - font-weight: bold; - word-break: break-word; - padding-left: 0.5em; - padding-right: 5px; -} - -dl.field-list > dt:after { - content: ":"; -} - -dl.field-list > dd { - padding-left: 0.5em; - margin-top: 0em; - margin-left: 0em; - margin-bottom: 0em; -} - -dl { - margin-bottom: 15px; -} - -dd > :first-child { - margin-top: 0px; -} - -dd ul, dd table { - margin-bottom: 10px; -} - -dd { - margin-top: 3px; - margin-bottom: 10px; - margin-left: 30px; -} - -dl > dd:last-child, -dl > dd:last-child > :last-child { - margin-bottom: 0; -} - -dt:target, span.highlighted { - background-color: #fbe54e; -} - -rect.highlighted { - fill: #fbe54e; -} - -dl.glossary dt { - font-weight: bold; - font-size: 1.1em; -} - -.versionmodified { - font-style: italic; -} - -.system-message { - background-color: #fda; - padding: 5px; - border: 3px solid red; -} - -.footnote:target { - background-color: #ffa; -} - -.line-block { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} - -.line-block .line-block { - margin-top: 0; - margin-bottom: 0; - margin-left: 1.5em; -} - -.guilabel, .menuselection { - font-family: sans-serif; -} - -.accelerator { - text-decoration: underline; -} - -.classifier { - font-style: oblique; -} - -.classifier:before { - font-style: normal; - margin: 0 0.5em; - content: ":"; - display: inline-block; -} - -abbr, acronym { - border-bottom: dotted 1px; - cursor: help; -} - -/* -- code displays --------------------------------------------------------- */ - -pre { - overflow: auto; - overflow-y: hidden; /* fixes display issues on Chrome browsers */ -} - -pre, div[class*="highlight-"] { - clear: both; -} - -span.pre { - -moz-hyphens: none; - -ms-hyphens: none; - -webkit-hyphens: none; - hyphens: none; - white-space: nowrap; -} - -div[class*="highlight-"] { - margin: 1em 0; -} - -td.linenos pre { - border: 0; - background-color: transparent; - color: #aaa; -} - -table.highlighttable { - display: block; -} - -table.highlighttable tbody { - display: block; -} - -table.highlighttable tr { - display: flex; -} - -table.highlighttable td { - margin: 0; - padding: 0; -} - -table.highlighttable td.linenos { - padding-right: 0.5em; -} - -table.highlighttable td.code { - flex: 1; - overflow: hidden; -} - -.highlight .hll { - display: block; -} - -div.highlight pre, -table.highlighttable pre { - margin: 0; -} - -div.code-block-caption + div { - margin-top: 0; -} - -div.code-block-caption { - margin-top: 1em; - padding: 2px 5px; - font-size: small; -} - -div.code-block-caption code { - background-color: transparent; -} - -table.highlighttable td.linenos, -span.linenos, -div.highlight span.gp { /* gp: Generic.Prompt */ - user-select: none; - -webkit-user-select: text; /* Safari fallback only */ - -webkit-user-select: none; /* Chrome/Safari */ - -moz-user-select: none; /* Firefox */ - -ms-user-select: none; /* IE10+ */ -} - -div.code-block-caption span.caption-number { - padding: 0.1em 0.3em; - font-style: italic; -} - -div.code-block-caption span.caption-text { -} - -div.literal-block-wrapper { - margin: 1em 0; -} - -code.xref, a code { - background-color: transparent; - font-weight: bold; -} - -h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { - background-color: transparent; -} - -.viewcode-link { - float: right; -} - -.viewcode-back { - float: right; - font-family: sans-serif; -} - -div.viewcode-block:target { - margin: -1px -10px; - padding: 0 10px; -} - -/* -- math display ---------------------------------------------------------- */ - -img.math { - vertical-align: middle; -} - -div.body div.math p { - text-align: center; -} - -span.eqno { - float: right; -} - -span.eqno a.headerlink { - position: absolute; - z-index: 1; -} - -div.math:hover a.headerlink { - visibility: visible; -} - -/* -- printout stylesheet --------------------------------------------------- */ - -@media print { - div.document, - div.documentwrapper, - div.bodywrapper { - margin: 0 !important; - width: 100%; - } - - div.sphinxsidebar, - div.related, - div.footer, - #top-link { - display: none; - } -} \ No newline at end of file diff --git a/docs/_static/custom.css b/docs/_static/custom.css deleted file mode 100644 index 2a924f1d..00000000 --- a/docs/_static/custom.css +++ /dev/null @@ -1 +0,0 @@ -/* This file intentionally left blank. */ diff --git a/docs/_static/doctools.js b/docs/_static/doctools.js deleted file mode 100644 index c3db08d1..00000000 --- a/docs/_static/doctools.js +++ /dev/null @@ -1,264 +0,0 @@ -/* - * doctools.js - * ~~~~~~~~~~~ - * - * Base JavaScript utilities for all Sphinx HTML documentation. - * - * :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ -"use strict"; - -const _ready = (callback) => { - if (document.readyState !== "loading") { - callback(); - } else { - document.addEventListener("DOMContentLoaded", callback); - } -}; - -/** - * highlight a given string on a node by wrapping it in - * span elements with the given class name. - */ -const _highlight = (node, addItems, text, className) => { - if (node.nodeType === Node.TEXT_NODE) { - const val = node.nodeValue; - const parent = node.parentNode; - const pos = val.toLowerCase().indexOf(text); - if ( - pos >= 0 && - !parent.classList.contains(className) && - !parent.classList.contains("nohighlight") - ) { - let span; - - const closestNode = parent.closest("body, svg, foreignObject"); - const isInSVG = closestNode && closestNode.matches("svg"); - if (isInSVG) { - span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); - } else { - span = document.createElement("span"); - span.classList.add(className); - } - - span.appendChild(document.createTextNode(val.substr(pos, text.length))); - parent.insertBefore( - span, - parent.insertBefore( - document.createTextNode(val.substr(pos + text.length)), - node.nextSibling - ) - ); - node.nodeValue = val.substr(0, pos); - - if (isInSVG) { - const rect = document.createElementNS( - "http://www.w3.org/2000/svg", - "rect" - ); - const bbox = parent.getBBox(); - rect.x.baseVal.value = bbox.x; - rect.y.baseVal.value = bbox.y; - rect.width.baseVal.value = bbox.width; - rect.height.baseVal.value = bbox.height; - rect.setAttribute("class", className); - addItems.push({ parent: parent, target: rect }); - } - } - } else if (node.matches && !node.matches("button, select, textarea")) { - node.childNodes.forEach((el) => _highlight(el, addItems, text, className)); - } -}; -const _highlightText = (thisNode, text, className) => { - let addItems = []; - _highlight(thisNode, addItems, text, className); - addItems.forEach((obj) => - obj.parent.insertAdjacentElement("beforebegin", obj.target) - ); -}; - -/** - * Small JavaScript module for the documentation. - */ -const Documentation = { - init: () => { - Documentation.highlightSearchWords(); - Documentation.initDomainIndexTable(); - Documentation.initOnKeyListeners(); - }, - - /** - * i18n support - */ - TRANSLATIONS: {}, - PLURAL_EXPR: (n) => (n === 1 ? 0 : 1), - LOCALE: "unknown", - - // gettext and ngettext don't access this so that the functions - // can safely bound to a different name (_ = Documentation.gettext) - gettext: (string) => { - const translated = Documentation.TRANSLATIONS[string]; - switch (typeof translated) { - case "undefined": - return string; // no translation - case "string": - return translated; // translation exists - default: - return translated[0]; // (singular, plural) translation tuple exists - } - }, - - ngettext: (singular, plural, n) => { - const translated = Documentation.TRANSLATIONS[singular]; - if (typeof translated !== "undefined") - return translated[Documentation.PLURAL_EXPR(n)]; - return n === 1 ? singular : plural; - }, - - addTranslations: (catalog) => { - Object.assign(Documentation.TRANSLATIONS, catalog.messages); - Documentation.PLURAL_EXPR = new Function( - "n", - `return (${catalog.plural_expr})` - ); - Documentation.LOCALE = catalog.locale; - }, - - /** - * highlight the search words provided in the url in the text - */ - highlightSearchWords: () => { - const highlight = - new URLSearchParams(window.location.search).get("highlight") || ""; - const terms = highlight.toLowerCase().split(/\s+/).filter(x => x); - if (terms.length === 0) return; // nothing to do - - // There should never be more than one element matching "div.body" - const divBody = document.querySelectorAll("div.body"); - const body = divBody.length ? divBody[0] : document.querySelector("body"); - window.setTimeout(() => { - terms.forEach((term) => _highlightText(body, term, "highlighted")); - }, 10); - - const searchBox = document.getElementById("searchbox"); - if (searchBox === null) return; - searchBox.appendChild( - document - .createRange() - .createContextualFragment( - '" - ) - ); - }, - - /** - * helper function to hide the search marks again - */ - hideSearchWords: () => { - document - .querySelectorAll("#searchbox .highlight-link") - .forEach((el) => el.remove()); - document - .querySelectorAll("span.highlighted") - .forEach((el) => el.classList.remove("highlighted")); - const url = new URL(window.location); - url.searchParams.delete("highlight"); - window.history.replaceState({}, "", url); - }, - - /** - * helper function to focus on search bar - */ - focusSearchBar: () => { - document.querySelectorAll("input[name=q]")[0]?.focus(); - }, - - /** - * Initialise the domain index toggle buttons - */ - initDomainIndexTable: () => { - const toggler = (el) => { - const idNumber = el.id.substr(7); - const toggledRows = document.querySelectorAll(`tr.cg-${idNumber}`); - if (el.src.substr(-9) === "minus.png") { - el.src = `${el.src.substr(0, el.src.length - 9)}plus.png`; - toggledRows.forEach((el) => (el.style.display = "none")); - } else { - el.src = `${el.src.substr(0, el.src.length - 8)}minus.png`; - toggledRows.forEach((el) => (el.style.display = "")); - } - }; - - const togglerElements = document.querySelectorAll("img.toggler"); - togglerElements.forEach((el) => - el.addEventListener("click", (event) => toggler(event.currentTarget)) - ); - togglerElements.forEach((el) => (el.style.display = "")); - if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) togglerElements.forEach(toggler); - }, - - initOnKeyListeners: () => { - // only install a listener if it is really needed - if ( - !DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS && - !DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS - ) - return; - - const blacklistedElements = new Set([ - "TEXTAREA", - "INPUT", - "SELECT", - "BUTTON", - ]); - document.addEventListener("keydown", (event) => { - if (blacklistedElements.has(document.activeElement.tagName)) return; // bail for input elements - if (event.altKey || event.ctrlKey || event.metaKey) return; // bail with special keys - - if (!event.shiftKey) { - switch (event.key) { - case "ArrowLeft": - if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; - - const prevLink = document.querySelector('link[rel="prev"]'); - if (prevLink && prevLink.href) { - window.location.href = prevLink.href; - event.preventDefault(); - } - break; - case "ArrowRight": - if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; - - const nextLink = document.querySelector('link[rel="next"]'); - if (nextLink && nextLink.href) { - window.location.href = nextLink.href; - event.preventDefault(); - } - break; - case "Escape": - if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break; - Documentation.hideSearchWords(); - event.preventDefault(); - } - } - - // some keyboard layouts may need Shift to get / - switch (event.key) { - case "/": - if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break; - Documentation.focusSearchBar(); - event.preventDefault(); - } - }); - }, -}; - -// quick alias for translations -const _ = Documentation.gettext; - -_ready(Documentation.init); diff --git a/docs/_static/documentation_options.js b/docs/_static/documentation_options.js deleted file mode 100644 index a750e4d5..00000000 --- a/docs/_static/documentation_options.js +++ /dev/null @@ -1,14 +0,0 @@ -var DOCUMENTATION_OPTIONS = { - URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), - VERSION: '', - LANGUAGE: 'en', - COLLAPSE_INDEX: false, - BUILDER: 'html', - FILE_SUFFIX: '.html', - LINK_SUFFIX: '.html', - HAS_SOURCE: true, - SOURCELINK_SUFFIX: '.txt', - NAVIGATION_WITH_KEYS: false, - SHOW_SEARCH_SUMMARY: true, - ENABLE_SEARCH_SHORTCUTS: false, -}; \ No newline at end of file diff --git a/docs/_static/file.png b/docs/_static/file.png deleted file mode 100644 index a858a410e4faa62ce324d814e4b816fff83a6fb3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 286 zcmV+(0pb3MP)s`hMrGg#P~ix$^RISR_I47Y|r1 z_CyJOe}D1){SET-^Amu_i71Lt6eYfZjRyw@I6OQAIXXHDfiX^GbOlHe=Ae4>0m)d(f|Me07*qoM6N<$f}vM^LjV8( diff --git a/docs/_static/jquery-3.6.0.js b/docs/_static/jquery-3.6.0.js deleted file mode 100644 index fc6c299b..00000000 --- a/docs/_static/jquery-3.6.0.js +++ /dev/null @@ -1,10881 +0,0 @@ -/*! - * jQuery JavaScript Library v3.6.0 - * https://jquery.com/ - * - * Includes Sizzle.js - * https://sizzlejs.com/ - * - * Copyright OpenJS Foundation and other contributors - * Released under the MIT license - * https://jquery.org/license - * - * Date: 2021-03-02T17:08Z - */ -( function( global, factory ) { - - "use strict"; - - if ( typeof module === "object" && typeof module.exports === "object" ) { - - // For CommonJS and CommonJS-like environments where a proper `window` - // is present, execute the factory and get jQuery. - // For environments that do not have a `window` with a `document` - // (such as Node.js), expose a factory as module.exports. - // This accentuates the need for the creation of a real `window`. - // e.g. var jQuery = require("jquery")(window); - // See ticket #14549 for more info. - module.exports = global.document ? - factory( global, true ) : - function( w ) { - if ( !w.document ) { - throw new Error( "jQuery requires a window with a document" ); - } - return factory( w ); - }; - } else { - factory( global ); - } - -// Pass this if window is not defined yet -} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { - -// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 -// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode -// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common -// enough that all such attempts are guarded in a try block. -"use strict"; - -var arr = []; - -var getProto = Object.getPrototypeOf; - -var slice = arr.slice; - -var flat = arr.flat ? function( array ) { - return arr.flat.call( array ); -} : function( array ) { - return arr.concat.apply( [], array ); -}; - - -var push = arr.push; - -var indexOf = arr.indexOf; - -var class2type = {}; - -var toString = class2type.toString; - -var hasOwn = class2type.hasOwnProperty; - -var fnToString = hasOwn.toString; - -var ObjectFunctionString = fnToString.call( Object ); - -var support = {}; - -var isFunction = function isFunction( obj ) { - - // Support: Chrome <=57, Firefox <=52 - // In some browsers, typeof returns "function" for HTML elements - // (i.e., `typeof document.createElement( "object" ) === "function"`). - // We don't want to classify *any* DOM node as a function. - // Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5 - // Plus for old WebKit, typeof returns "function" for HTML collections - // (e.g., `typeof document.getElementsByTagName("div") === "function"`). (gh-4756) - return typeof obj === "function" && typeof obj.nodeType !== "number" && - typeof obj.item !== "function"; - }; - - -var isWindow = function isWindow( obj ) { - return obj != null && obj === obj.window; - }; - - -var document = window.document; - - - - var preservedScriptAttributes = { - type: true, - src: true, - nonce: true, - noModule: true - }; - - function DOMEval( code, node, doc ) { - doc = doc || document; - - var i, val, - script = doc.createElement( "script" ); - - script.text = code; - if ( node ) { - for ( i in preservedScriptAttributes ) { - - // Support: Firefox 64+, Edge 18+ - // Some browsers don't support the "nonce" property on scripts. - // On the other hand, just using `getAttribute` is not enough as - // the `nonce` attribute is reset to an empty string whenever it - // becomes browsing-context connected. - // See https://github.com/whatwg/html/issues/2369 - // See https://html.spec.whatwg.org/#nonce-attributes - // The `node.getAttribute` check was added for the sake of - // `jQuery.globalEval` so that it can fake a nonce-containing node - // via an object. - val = node[ i ] || node.getAttribute && node.getAttribute( i ); - if ( val ) { - script.setAttribute( i, val ); - } - } - } - doc.head.appendChild( script ).parentNode.removeChild( script ); - } - - -function toType( obj ) { - if ( obj == null ) { - return obj + ""; - } - - // Support: Android <=2.3 only (functionish RegExp) - return typeof obj === "object" || typeof obj === "function" ? - class2type[ toString.call( obj ) ] || "object" : - typeof obj; -} -/* global Symbol */ -// Defining this global in .eslintrc.json would create a danger of using the global -// unguarded in another place, it seems safer to define global only for this module - - - -var - version = "3.6.0", - - // Define a local copy of jQuery - jQuery = function( selector, context ) { - - // The jQuery object is actually just the init constructor 'enhanced' - // Need init if jQuery is called (just allow error to be thrown if not included) - return new jQuery.fn.init( selector, context ); - }; - -jQuery.fn = jQuery.prototype = { - - // The current version of jQuery being used - jquery: version, - - constructor: jQuery, - - // The default length of a jQuery object is 0 - length: 0, - - toArray: function() { - return slice.call( this ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - - // Return all the elements in a clean array - if ( num == null ) { - return slice.call( this ); - } - - // Return just the one element from the set - return num < 0 ? this[ num + this.length ] : this[ num ]; - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems ) { - - // Build a new jQuery matched element set - var ret = jQuery.merge( this.constructor(), elems ); - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - - // Return the newly-formed element set - return ret; - }, - - // Execute a callback for every element in the matched set. - each: function( callback ) { - return jQuery.each( this, callback ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map( this, function( elem, i ) { - return callback.call( elem, i, elem ); - } ) ); - }, - - slice: function() { - return this.pushStack( slice.apply( this, arguments ) ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - even: function() { - return this.pushStack( jQuery.grep( this, function( _elem, i ) { - return ( i + 1 ) % 2; - } ) ); - }, - - odd: function() { - return this.pushStack( jQuery.grep( this, function( _elem, i ) { - return i % 2; - } ) ); - }, - - eq: function( i ) { - var len = this.length, - j = +i + ( i < 0 ? len : 0 ); - return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); - }, - - end: function() { - return this.prevObject || this.constructor(); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: push, - sort: arr.sort, - splice: arr.splice -}; - -jQuery.extend = jQuery.fn.extend = function() { - var options, name, src, copy, copyIsArray, clone, - target = arguments[ 0 ] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - - // Skip the boolean and the target - target = arguments[ i ] || {}; - i++; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !isFunction( target ) ) { - target = {}; - } - - // Extend jQuery itself if only one argument is passed - if ( i === length ) { - target = this; - i--; - } - - for ( ; i < length; i++ ) { - - // Only deal with non-null/undefined values - if ( ( options = arguments[ i ] ) != null ) { - - // Extend the base object - for ( name in options ) { - copy = options[ name ]; - - // Prevent Object.prototype pollution - // Prevent never-ending loop - if ( name === "__proto__" || target === copy ) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject( copy ) || - ( copyIsArray = Array.isArray( copy ) ) ) ) { - src = target[ name ]; - - // Ensure proper type for the source value - if ( copyIsArray && !Array.isArray( src ) ) { - clone = []; - } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) { - clone = {}; - } else { - clone = src; - } - copyIsArray = false; - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend( { - - // Unique for each copy of jQuery on the page - expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), - - // Assume jQuery is ready without the ready module - isReady: true, - - error: function( msg ) { - throw new Error( msg ); - }, - - noop: function() {}, - - isPlainObject: function( obj ) { - var proto, Ctor; - - // Detect obvious negatives - // Use toString instead of jQuery.type to catch host objects - if ( !obj || toString.call( obj ) !== "[object Object]" ) { - return false; - } - - proto = getProto( obj ); - - // Objects with no prototype (e.g., `Object.create( null )`) are plain - if ( !proto ) { - return true; - } - - // Objects with prototype are plain iff they were constructed by a global Object function - Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; - return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; - }, - - isEmptyObject: function( obj ) { - var name; - - for ( name in obj ) { - return false; - } - return true; - }, - - // Evaluates a script in a provided context; falls back to the global one - // if not specified. - globalEval: function( code, options, doc ) { - DOMEval( code, { nonce: options && options.nonce }, doc ); - }, - - each: function( obj, callback ) { - var length, i = 0; - - if ( isArrayLike( obj ) ) { - length = obj.length; - for ( ; i < length; i++ ) { - if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { - break; - } - } - } else { - for ( i in obj ) { - if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { - break; - } - } - } - - return obj; - }, - - // results is for internal usage only - makeArray: function( arr, results ) { - var ret = results || []; - - if ( arr != null ) { - if ( isArrayLike( Object( arr ) ) ) { - jQuery.merge( ret, - typeof arr === "string" ? - [ arr ] : arr - ); - } else { - push.call( ret, arr ); - } - } - - return ret; - }, - - inArray: function( elem, arr, i ) { - return arr == null ? -1 : indexOf.call( arr, elem, i ); - }, - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - merge: function( first, second ) { - var len = +second.length, - j = 0, - i = first.length; - - for ( ; j < len; j++ ) { - first[ i++ ] = second[ j ]; - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, invert ) { - var callbackInverse, - matches = [], - i = 0, - length = elems.length, - callbackExpect = !invert; - - // Go through the array, only saving the items - // that pass the validator function - for ( ; i < length; i++ ) { - callbackInverse = !callback( elems[ i ], i ); - if ( callbackInverse !== callbackExpect ) { - matches.push( elems[ i ] ); - } - } - - return matches; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var length, value, - i = 0, - ret = []; - - // Go through the array, translating each of the items to their new values - if ( isArrayLike( elems ) ) { - length = elems.length; - for ( ; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - - // Go through every key on the object, - } else { - for ( i in elems ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - } - - // Flatten any nested arrays - return flat( ret ); - }, - - // A global GUID counter for objects - guid: 1, - - // jQuery.support is not used in Core but other projects attach their - // properties to it so it needs to exist. - support: support -} ); - -if ( typeof Symbol === "function" ) { - jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; -} - -// Populate the class2type map -jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), - function( _i, name ) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); - } ); - -function isArrayLike( obj ) { - - // Support: real iOS 8.2 only (not reproducible in simulator) - // `in` check used to prevent JIT error (gh-2145) - // hasOwn isn't used here due to false negatives - // regarding Nodelist length in IE - var length = !!obj && "length" in obj && obj.length, - type = toType( obj ); - - if ( isFunction( obj ) || isWindow( obj ) ) { - return false; - } - - return type === "array" || length === 0 || - typeof length === "number" && length > 0 && ( length - 1 ) in obj; -} -var Sizzle = -/*! - * Sizzle CSS Selector Engine v2.3.6 - * https://sizzlejs.com/ - * - * Copyright JS Foundation and other contributors - * Released under the MIT license - * https://js.foundation/ - * - * Date: 2021-02-16 - */ -( function( window ) { -var i, - support, - Expr, - getText, - isXML, - tokenize, - compile, - select, - outermostContext, - sortInput, - hasDuplicate, - - // Local document vars - setDocument, - document, - docElem, - documentIsHTML, - rbuggyQSA, - rbuggyMatches, - matches, - contains, - - // Instance-specific data - expando = "sizzle" + 1 * new Date(), - preferredDoc = window.document, - dirruns = 0, - done = 0, - classCache = createCache(), - tokenCache = createCache(), - compilerCache = createCache(), - nonnativeSelectorCache = createCache(), - sortOrder = function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - } - return 0; - }, - - // Instance methods - hasOwn = ( {} ).hasOwnProperty, - arr = [], - pop = arr.pop, - pushNative = arr.push, - push = arr.push, - slice = arr.slice, - - // Use a stripped-down indexOf as it's faster than native - // https://jsperf.com/thor-indexof-vs-for/5 - indexOf = function( list, elem ) { - var i = 0, - len = list.length; - for ( ; i < len; i++ ) { - if ( list[ i ] === elem ) { - return i; - } - } - return -1; - }, - - booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" + - "ismap|loop|multiple|open|readonly|required|scoped", - - // Regular expressions - - // http://www.w3.org/TR/css3-selectors/#whitespace - whitespace = "[\\x20\\t\\r\\n\\f]", - - // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram - identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + - "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", - - // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors - attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + - - // Operator (capture 2) - "*([*^$|!~]?=)" + whitespace + - - // "Attribute values must be CSS identifiers [capture 5] - // or strings [capture 3 or capture 4]" - "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + - whitespace + "*\\]", - - pseudos = ":(" + identifier + ")(?:\\((" + - - // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: - // 1. quoted (capture 3; capture 4 or capture 5) - "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + - - // 2. simple (capture 6) - "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + - - // 3. anything else (capture 2) - ".*" + - ")\\)|)", - - // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter - rwhitespace = new RegExp( whitespace + "+", "g" ), - rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + - whitespace + "+$", "g" ), - - rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), - rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + - "*" ), - rdescend = new RegExp( whitespace + "|>" ), - - rpseudo = new RegExp( pseudos ), - ridentifier = new RegExp( "^" + identifier + "$" ), - - matchExpr = { - "ID": new RegExp( "^#(" + identifier + ")" ), - "CLASS": new RegExp( "^\\.(" + identifier + ")" ), - "TAG": new RegExp( "^(" + identifier + "|[*])" ), - "ATTR": new RegExp( "^" + attributes ), - "PSEUDO": new RegExp( "^" + pseudos ), - "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + - whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + - whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), - "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), - - // For use in libraries implementing .is() - // We use this for POS matching in `select` - "needsContext": new RegExp( "^" + whitespace + - "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + - "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) - }, - - rhtml = /HTML$/i, - rinputs = /^(?:input|select|textarea|button)$/i, - rheader = /^h\d$/i, - - rnative = /^[^{]+\{\s*\[native \w/, - - // Easily-parseable/retrievable ID or TAG or CLASS selectors - rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, - - rsibling = /[+~]/, - - // CSS escapes - // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters - runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g" ), - funescape = function( escape, nonHex ) { - var high = "0x" + escape.slice( 1 ) - 0x10000; - - return nonHex ? - - // Strip the backslash prefix from a non-hex escape sequence - nonHex : - - // Replace a hexadecimal escape sequence with the encoded Unicode code point - // Support: IE <=11+ - // For values outside the Basic Multilingual Plane (BMP), manually construct a - // surrogate pair - high < 0 ? - String.fromCharCode( high + 0x10000 ) : - String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); - }, - - // CSS string/identifier serialization - // https://drafts.csswg.org/cssom/#common-serializing-idioms - rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, - fcssescape = function( ch, asCodePoint ) { - if ( asCodePoint ) { - - // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER - if ( ch === "\0" ) { - return "\uFFFD"; - } - - // Control characters and (dependent upon position) numbers get escaped as code points - return ch.slice( 0, -1 ) + "\\" + - ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; - } - - // Other potentially-special ASCII characters get backslash-escaped - return "\\" + ch; - }, - - // Used for iframes - // See setDocument() - // Removing the function wrapper causes a "Permission Denied" - // error in IE - unloadHandler = function() { - setDocument(); - }, - - inDisabledFieldset = addCombinator( - function( elem ) { - return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset"; - }, - { dir: "parentNode", next: "legend" } - ); - -// Optimize for push.apply( _, NodeList ) -try { - push.apply( - ( arr = slice.call( preferredDoc.childNodes ) ), - preferredDoc.childNodes - ); - - // Support: Android<4.0 - // Detect silently failing push.apply - // eslint-disable-next-line no-unused-expressions - arr[ preferredDoc.childNodes.length ].nodeType; -} catch ( e ) { - push = { apply: arr.length ? - - // Leverage slice if possible - function( target, els ) { - pushNative.apply( target, slice.call( els ) ); - } : - - // Support: IE<9 - // Otherwise append directly - function( target, els ) { - var j = target.length, - i = 0; - - // Can't trust NodeList.length - while ( ( target[ j++ ] = els[ i++ ] ) ) {} - target.length = j - 1; - } - }; -} - -function Sizzle( selector, context, results, seed ) { - var m, i, elem, nid, match, groups, newSelector, - newContext = context && context.ownerDocument, - - // nodeType defaults to 9, since context defaults to document - nodeType = context ? context.nodeType : 9; - - results = results || []; - - // Return early from calls with invalid selector or context - if ( typeof selector !== "string" || !selector || - nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { - - return results; - } - - // Try to shortcut find operations (as opposed to filters) in HTML documents - if ( !seed ) { - setDocument( context ); - context = context || document; - - if ( documentIsHTML ) { - - // If the selector is sufficiently simple, try using a "get*By*" DOM method - // (excepting DocumentFragment context, where the methods don't exist) - if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) { - - // ID selector - if ( ( m = match[ 1 ] ) ) { - - // Document context - if ( nodeType === 9 ) { - if ( ( elem = context.getElementById( m ) ) ) { - - // Support: IE, Opera, Webkit - // TODO: identify versions - // getElementById can match elements by name instead of ID - if ( elem.id === m ) { - results.push( elem ); - return results; - } - } else { - return results; - } - - // Element context - } else { - - // Support: IE, Opera, Webkit - // TODO: identify versions - // getElementById can match elements by name instead of ID - if ( newContext && ( elem = newContext.getElementById( m ) ) && - contains( context, elem ) && - elem.id === m ) { - - results.push( elem ); - return results; - } - } - - // Type selector - } else if ( match[ 2 ] ) { - push.apply( results, context.getElementsByTagName( selector ) ); - return results; - - // Class selector - } else if ( ( m = match[ 3 ] ) && support.getElementsByClassName && - context.getElementsByClassName ) { - - push.apply( results, context.getElementsByClassName( m ) ); - return results; - } - } - - // Take advantage of querySelectorAll - if ( support.qsa && - !nonnativeSelectorCache[ selector + " " ] && - ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) && - - // Support: IE 8 only - // Exclude object elements - ( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) { - - newSelector = selector; - newContext = context; - - // qSA considers elements outside a scoping root when evaluating child or - // descendant combinators, which is not what we want. - // In such cases, we work around the behavior by prefixing every selector in the - // list with an ID selector referencing the scope context. - // The technique has to be used as well when a leading combinator is used - // as such selectors are not recognized by querySelectorAll. - // Thanks to Andrew Dupont for this technique. - if ( nodeType === 1 && - ( rdescend.test( selector ) || rcombinators.test( selector ) ) ) { - - // Expand context for sibling selectors - newContext = rsibling.test( selector ) && testContext( context.parentNode ) || - context; - - // We can use :scope instead of the ID hack if the browser - // supports it & if we're not changing the context. - if ( newContext !== context || !support.scope ) { - - // Capture the context ID, setting it first if necessary - if ( ( nid = context.getAttribute( "id" ) ) ) { - nid = nid.replace( rcssescape, fcssescape ); - } else { - context.setAttribute( "id", ( nid = expando ) ); - } - } - - // Prefix every selector in the list - groups = tokenize( selector ); - i = groups.length; - while ( i-- ) { - groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " + - toSelector( groups[ i ] ); - } - newSelector = groups.join( "," ); - } - - try { - push.apply( results, - newContext.querySelectorAll( newSelector ) - ); - return results; - } catch ( qsaError ) { - nonnativeSelectorCache( selector, true ); - } finally { - if ( nid === expando ) { - context.removeAttribute( "id" ); - } - } - } - } - } - - // All others - return select( selector.replace( rtrim, "$1" ), context, results, seed ); -} - -/** - * Create key-value caches of limited size - * @returns {function(string, object)} Returns the Object data after storing it on itself with - * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) - * deleting the oldest entry - */ -function createCache() { - var keys = []; - - function cache( key, value ) { - - // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) - if ( keys.push( key + " " ) > Expr.cacheLength ) { - - // Only keep the most recent entries - delete cache[ keys.shift() ]; - } - return ( cache[ key + " " ] = value ); - } - return cache; -} - -/** - * Mark a function for special use by Sizzle - * @param {Function} fn The function to mark - */ -function markFunction( fn ) { - fn[ expando ] = true; - return fn; -} - -/** - * Support testing using an element - * @param {Function} fn Passed the created element and returns a boolean result - */ -function assert( fn ) { - var el = document.createElement( "fieldset" ); - - try { - return !!fn( el ); - } catch ( e ) { - return false; - } finally { - - // Remove from its parent by default - if ( el.parentNode ) { - el.parentNode.removeChild( el ); - } - - // release memory in IE - el = null; - } -} - -/** - * Adds the same handler for all of the specified attrs - * @param {String} attrs Pipe-separated list of attributes - * @param {Function} handler The method that will be applied - */ -function addHandle( attrs, handler ) { - var arr = attrs.split( "|" ), - i = arr.length; - - while ( i-- ) { - Expr.attrHandle[ arr[ i ] ] = handler; - } -} - -/** - * Checks document order of two siblings - * @param {Element} a - * @param {Element} b - * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b - */ -function siblingCheck( a, b ) { - var cur = b && a, - diff = cur && a.nodeType === 1 && b.nodeType === 1 && - a.sourceIndex - b.sourceIndex; - - // Use IE sourceIndex if available on both nodes - if ( diff ) { - return diff; - } - - // Check if b follows a - if ( cur ) { - while ( ( cur = cur.nextSibling ) ) { - if ( cur === b ) { - return -1; - } - } - } - - return a ? 1 : -1; -} - -/** - * Returns a function to use in pseudos for input types - * @param {String} type - */ -function createInputPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for buttons - * @param {String} type - */ -function createButtonPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return ( name === "input" || name === "button" ) && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for :enabled/:disabled - * @param {Boolean} disabled true for :disabled; false for :enabled - */ -function createDisabledPseudo( disabled ) { - - // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable - return function( elem ) { - - // Only certain elements can match :enabled or :disabled - // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled - // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled - if ( "form" in elem ) { - - // Check for inherited disabledness on relevant non-disabled elements: - // * listed form-associated elements in a disabled fieldset - // https://html.spec.whatwg.org/multipage/forms.html#category-listed - // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled - // * option elements in a disabled optgroup - // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled - // All such elements have a "form" property. - if ( elem.parentNode && elem.disabled === false ) { - - // Option elements defer to a parent optgroup if present - if ( "label" in elem ) { - if ( "label" in elem.parentNode ) { - return elem.parentNode.disabled === disabled; - } else { - return elem.disabled === disabled; - } - } - - // Support: IE 6 - 11 - // Use the isDisabled shortcut property to check for disabled fieldset ancestors - return elem.isDisabled === disabled || - - // Where there is no isDisabled, check manually - /* jshint -W018 */ - elem.isDisabled !== !disabled && - inDisabledFieldset( elem ) === disabled; - } - - return elem.disabled === disabled; - - // Try to winnow out elements that can't be disabled before trusting the disabled property. - // Some victims get caught in our net (label, legend, menu, track), but it shouldn't - // even exist on them, let alone have a boolean value. - } else if ( "label" in elem ) { - return elem.disabled === disabled; - } - - // Remaining elements are neither :enabled nor :disabled - return false; - }; -} - -/** - * Returns a function to use in pseudos for positionals - * @param {Function} fn - */ -function createPositionalPseudo( fn ) { - return markFunction( function( argument ) { - argument = +argument; - return markFunction( function( seed, matches ) { - var j, - matchIndexes = fn( [], seed.length, argument ), - i = matchIndexes.length; - - // Match elements found at the specified indexes - while ( i-- ) { - if ( seed[ ( j = matchIndexes[ i ] ) ] ) { - seed[ j ] = !( matches[ j ] = seed[ j ] ); - } - } - } ); - } ); -} - -/** - * Checks a node for validity as a Sizzle context - * @param {Element|Object=} context - * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value - */ -function testContext( context ) { - return context && typeof context.getElementsByTagName !== "undefined" && context; -} - -// Expose support vars for convenience -support = Sizzle.support = {}; - -/** - * Detects XML nodes - * @param {Element|Object} elem An element or a document - * @returns {Boolean} True iff elem is a non-HTML XML node - */ -isXML = Sizzle.isXML = function( elem ) { - var namespace = elem && elem.namespaceURI, - docElem = elem && ( elem.ownerDocument || elem ).documentElement; - - // Support: IE <=8 - // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes - // https://bugs.jquery.com/ticket/4833 - return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" ); -}; - -/** - * Sets document-related variables once based on the current document - * @param {Element|Object} [doc] An element or document object to use to set the document - * @returns {Object} Returns the current document - */ -setDocument = Sizzle.setDocument = function( node ) { - var hasCompare, subWindow, - doc = node ? node.ownerDocument || node : preferredDoc; - - // Return early if doc is invalid or already selected - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) { - return document; - } - - // Update global variables - document = doc; - docElem = document.documentElement; - documentIsHTML = !isXML( document ); - - // Support: IE 9 - 11+, Edge 12 - 18+ - // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( preferredDoc != document && - ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) { - - // Support: IE 11, Edge - if ( subWindow.addEventListener ) { - subWindow.addEventListener( "unload", unloadHandler, false ); - - // Support: IE 9 - 10 only - } else if ( subWindow.attachEvent ) { - subWindow.attachEvent( "onunload", unloadHandler ); - } - } - - // Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only, - // Safari 4 - 5 only, Opera <=11.6 - 12.x only - // IE/Edge & older browsers don't support the :scope pseudo-class. - // Support: Safari 6.0 only - // Safari 6.0 supports :scope but it's an alias of :root there. - support.scope = assert( function( el ) { - docElem.appendChild( el ).appendChild( document.createElement( "div" ) ); - return typeof el.querySelectorAll !== "undefined" && - !el.querySelectorAll( ":scope fieldset div" ).length; - } ); - - /* Attributes - ---------------------------------------------------------------------- */ - - // Support: IE<8 - // Verify that getAttribute really returns attributes and not properties - // (excepting IE8 booleans) - support.attributes = assert( function( el ) { - el.className = "i"; - return !el.getAttribute( "className" ); - } ); - - /* getElement(s)By* - ---------------------------------------------------------------------- */ - - // Check if getElementsByTagName("*") returns only elements - support.getElementsByTagName = assert( function( el ) { - el.appendChild( document.createComment( "" ) ); - return !el.getElementsByTagName( "*" ).length; - } ); - - // Support: IE<9 - support.getElementsByClassName = rnative.test( document.getElementsByClassName ); - - // Support: IE<10 - // Check if getElementById returns elements by name - // The broken getElementById methods don't pick up programmatically-set names, - // so use a roundabout getElementsByName test - support.getById = assert( function( el ) { - docElem.appendChild( el ).id = expando; - return !document.getElementsByName || !document.getElementsByName( expando ).length; - } ); - - // ID filter and find - if ( support.getById ) { - Expr.filter[ "ID" ] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - return elem.getAttribute( "id" ) === attrId; - }; - }; - Expr.find[ "ID" ] = function( id, context ) { - if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { - var elem = context.getElementById( id ); - return elem ? [ elem ] : []; - } - }; - } else { - Expr.filter[ "ID" ] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - var node = typeof elem.getAttributeNode !== "undefined" && - elem.getAttributeNode( "id" ); - return node && node.value === attrId; - }; - }; - - // Support: IE 6 - 7 only - // getElementById is not reliable as a find shortcut - Expr.find[ "ID" ] = function( id, context ) { - if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { - var node, i, elems, - elem = context.getElementById( id ); - - if ( elem ) { - - // Verify the id attribute - node = elem.getAttributeNode( "id" ); - if ( node && node.value === id ) { - return [ elem ]; - } - - // Fall back on getElementsByName - elems = context.getElementsByName( id ); - i = 0; - while ( ( elem = elems[ i++ ] ) ) { - node = elem.getAttributeNode( "id" ); - if ( node && node.value === id ) { - return [ elem ]; - } - } - } - - return []; - } - }; - } - - // Tag - Expr.find[ "TAG" ] = support.getElementsByTagName ? - function( tag, context ) { - if ( typeof context.getElementsByTagName !== "undefined" ) { - return context.getElementsByTagName( tag ); - - // DocumentFragment nodes don't have gEBTN - } else if ( support.qsa ) { - return context.querySelectorAll( tag ); - } - } : - - function( tag, context ) { - var elem, - tmp = [], - i = 0, - - // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too - results = context.getElementsByTagName( tag ); - - // Filter out possible comments - if ( tag === "*" ) { - while ( ( elem = results[ i++ ] ) ) { - if ( elem.nodeType === 1 ) { - tmp.push( elem ); - } - } - - return tmp; - } - return results; - }; - - // Class - Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) { - if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { - return context.getElementsByClassName( className ); - } - }; - - /* QSA/matchesSelector - ---------------------------------------------------------------------- */ - - // QSA and matchesSelector support - - // matchesSelector(:active) reports false when true (IE9/Opera 11.5) - rbuggyMatches = []; - - // qSa(:focus) reports false when true (Chrome 21) - // We allow this because of a bug in IE8/9 that throws an error - // whenever `document.activeElement` is accessed on an iframe - // So, we allow :focus to pass through QSA all the time to avoid the IE error - // See https://bugs.jquery.com/ticket/13378 - rbuggyQSA = []; - - if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) { - - // Build QSA regex - // Regex strategy adopted from Diego Perini - assert( function( el ) { - - var input; - - // Select is set to empty string on purpose - // This is to test IE's treatment of not explicitly - // setting a boolean content attribute, - // since its presence should be enough - // https://bugs.jquery.com/ticket/12359 - docElem.appendChild( el ).innerHTML = "" + - ""; - - // Support: IE8, Opera 11-12.16 - // Nothing should be selected when empty strings follow ^= or $= or *= - // The test attribute must be unknown in Opera but "safe" for WinRT - // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section - if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) { - rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); - } - - // Support: IE8 - // Boolean attributes and "value" are not treated correctly - if ( !el.querySelectorAll( "[selected]" ).length ) { - rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); - } - - // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ - if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { - rbuggyQSA.push( "~=" ); - } - - // Support: IE 11+, Edge 15 - 18+ - // IE 11/Edge don't find elements on a `[name='']` query in some cases. - // Adding a temporary attribute to the document before the selection works - // around the issue. - // Interestingly, IE 10 & older don't seem to have the issue. - input = document.createElement( "input" ); - input.setAttribute( "name", "" ); - el.appendChild( input ); - if ( !el.querySelectorAll( "[name='']" ).length ) { - rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" + - whitespace + "*(?:''|\"\")" ); - } - - // Webkit/Opera - :checked should return selected option elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - // IE8 throws error here and will not see later tests - if ( !el.querySelectorAll( ":checked" ).length ) { - rbuggyQSA.push( ":checked" ); - } - - // Support: Safari 8+, iOS 8+ - // https://bugs.webkit.org/show_bug.cgi?id=136851 - // In-page `selector#id sibling-combinator selector` fails - if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { - rbuggyQSA.push( ".#.+[+~]" ); - } - - // Support: Firefox <=3.6 - 5 only - // Old Firefox doesn't throw on a badly-escaped identifier. - el.querySelectorAll( "\\\f" ); - rbuggyQSA.push( "[\\r\\n\\f]" ); - } ); - - assert( function( el ) { - el.innerHTML = "" + - ""; - - // Support: Windows 8 Native Apps - // The type and name attributes are restricted during .innerHTML assignment - var input = document.createElement( "input" ); - input.setAttribute( "type", "hidden" ); - el.appendChild( input ).setAttribute( "name", "D" ); - - // Support: IE8 - // Enforce case-sensitivity of name attribute - if ( el.querySelectorAll( "[name=d]" ).length ) { - rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); - } - - // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) - // IE8 throws error here and will not see later tests - if ( el.querySelectorAll( ":enabled" ).length !== 2 ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Support: IE9-11+ - // IE's :disabled selector does not pick up the children of disabled fieldsets - docElem.appendChild( el ).disabled = true; - if ( el.querySelectorAll( ":disabled" ).length !== 2 ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Support: Opera 10 - 11 only - // Opera 10-11 does not throw on post-comma invalid pseudos - el.querySelectorAll( "*,:x" ); - rbuggyQSA.push( ",.*:" ); - } ); - } - - if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches || - docElem.webkitMatchesSelector || - docElem.mozMatchesSelector || - docElem.oMatchesSelector || - docElem.msMatchesSelector ) ) ) ) { - - assert( function( el ) { - - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9) - support.disconnectedMatch = matches.call( el, "*" ); - - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( el, "[s!='']:x" ); - rbuggyMatches.push( "!=", pseudos ); - } ); - } - - rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) ); - rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) ); - - /* Contains - ---------------------------------------------------------------------- */ - hasCompare = rnative.test( docElem.compareDocumentPosition ); - - // Element contains another - // Purposefully self-exclusive - // As in, an element does not contain itself - contains = hasCompare || rnative.test( docElem.contains ) ? - function( a, b ) { - var adown = a.nodeType === 9 ? a.documentElement : a, - bup = b && b.parentNode; - return a === bup || !!( bup && bup.nodeType === 1 && ( - adown.contains ? - adown.contains( bup ) : - a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 - ) ); - } : - function( a, b ) { - if ( b ) { - while ( ( b = b.parentNode ) ) { - if ( b === a ) { - return true; - } - } - } - return false; - }; - - /* Sorting - ---------------------------------------------------------------------- */ - - // Document order sorting - sortOrder = hasCompare ? - function( a, b ) { - - // Flag for duplicate removal - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - // Sort on method existence if only one input has compareDocumentPosition - var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; - if ( compare ) { - return compare; - } - - // Calculate position if both inputs belong to the same document - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ? - a.compareDocumentPosition( b ) : - - // Otherwise we know they are disconnected - 1; - - // Disconnected nodes - if ( compare & 1 || - ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) { - - // Choose the first element that is related to our preferred document - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( a == document || a.ownerDocument == preferredDoc && - contains( preferredDoc, a ) ) { - return -1; - } - - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( b == document || b.ownerDocument == preferredDoc && - contains( preferredDoc, b ) ) { - return 1; - } - - // Maintain original order - return sortInput ? - ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : - 0; - } - - return compare & 4 ? -1 : 1; - } : - function( a, b ) { - - // Exit early if the nodes are identical - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - var cur, - i = 0, - aup = a.parentNode, - bup = b.parentNode, - ap = [ a ], - bp = [ b ]; - - // Parentless nodes are either documents or disconnected - if ( !aup || !bup ) { - - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - /* eslint-disable eqeqeq */ - return a == document ? -1 : - b == document ? 1 : - /* eslint-enable eqeqeq */ - aup ? -1 : - bup ? 1 : - sortInput ? - ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : - 0; - - // If the nodes are siblings, we can do a quick check - } else if ( aup === bup ) { - return siblingCheck( a, b ); - } - - // Otherwise we need full lists of their ancestors for comparison - cur = a; - while ( ( cur = cur.parentNode ) ) { - ap.unshift( cur ); - } - cur = b; - while ( ( cur = cur.parentNode ) ) { - bp.unshift( cur ); - } - - // Walk down the tree looking for a discrepancy - while ( ap[ i ] === bp[ i ] ) { - i++; - } - - return i ? - - // Do a sibling check if the nodes have a common ancestor - siblingCheck( ap[ i ], bp[ i ] ) : - - // Otherwise nodes in our document sort first - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - /* eslint-disable eqeqeq */ - ap[ i ] == preferredDoc ? -1 : - bp[ i ] == preferredDoc ? 1 : - /* eslint-enable eqeqeq */ - 0; - }; - - return document; -}; - -Sizzle.matches = function( expr, elements ) { - return Sizzle( expr, null, null, elements ); -}; - -Sizzle.matchesSelector = function( elem, expr ) { - setDocument( elem ); - - if ( support.matchesSelector && documentIsHTML && - !nonnativeSelectorCache[ expr + " " ] && - ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && - ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { - - try { - var ret = matches.call( elem, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || support.disconnectedMatch || - - // As well, disconnected nodes are said to be in a document - // fragment in IE 9 - elem.document && elem.document.nodeType !== 11 ) { - return ret; - } - } catch ( e ) { - nonnativeSelectorCache( expr, true ); - } - } - - return Sizzle( expr, document, null, [ elem ] ).length > 0; -}; - -Sizzle.contains = function( context, elem ) { - - // Set document vars if needed - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( ( context.ownerDocument || context ) != document ) { - setDocument( context ); - } - return contains( context, elem ); -}; - -Sizzle.attr = function( elem, name ) { - - // Set document vars if needed - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( ( elem.ownerDocument || elem ) != document ) { - setDocument( elem ); - } - - var fn = Expr.attrHandle[ name.toLowerCase() ], - - // Don't get fooled by Object.prototype properties (jQuery #13807) - val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? - fn( elem, name, !documentIsHTML ) : - undefined; - - return val !== undefined ? - val : - support.attributes || !documentIsHTML ? - elem.getAttribute( name ) : - ( val = elem.getAttributeNode( name ) ) && val.specified ? - val.value : - null; -}; - -Sizzle.escape = function( sel ) { - return ( sel + "" ).replace( rcssescape, fcssescape ); -}; - -Sizzle.error = function( msg ) { - throw new Error( "Syntax error, unrecognized expression: " + msg ); -}; - -/** - * Document sorting and removing duplicates - * @param {ArrayLike} results - */ -Sizzle.uniqueSort = function( results ) { - var elem, - duplicates = [], - j = 0, - i = 0; - - // Unless we *know* we can detect duplicates, assume their presence - hasDuplicate = !support.detectDuplicates; - sortInput = !support.sortStable && results.slice( 0 ); - results.sort( sortOrder ); - - if ( hasDuplicate ) { - while ( ( elem = results[ i++ ] ) ) { - if ( elem === results[ i ] ) { - j = duplicates.push( i ); - } - } - while ( j-- ) { - results.splice( duplicates[ j ], 1 ); - } - } - - // Clear input after sorting to release objects - // See https://github.com/jquery/sizzle/pull/225 - sortInput = null; - - return results; -}; - -/** - * Utility function for retrieving the text value of an array of DOM nodes - * @param {Array|Element} elem - */ -getText = Sizzle.getText = function( elem ) { - var node, - ret = "", - i = 0, - nodeType = elem.nodeType; - - if ( !nodeType ) { - - // If no nodeType, this is expected to be an array - while ( ( node = elem[ i++ ] ) ) { - - // Do not traverse comment nodes - ret += getText( node ); - } - } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { - - // Use textContent for elements - // innerText usage removed for consistency of new lines (jQuery #11153) - if ( typeof elem.textContent === "string" ) { - return elem.textContent; - } else { - - // Traverse its children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - ret += getText( elem ); - } - } - } else if ( nodeType === 3 || nodeType === 4 ) { - return elem.nodeValue; - } - - // Do not include comment or processing instruction nodes - - return ret; -}; - -Expr = Sizzle.selectors = { - - // Can be adjusted by the user - cacheLength: 50, - - createPseudo: markFunction, - - match: matchExpr, - - attrHandle: {}, - - find: {}, - - relative: { - ">": { dir: "parentNode", first: true }, - " ": { dir: "parentNode" }, - "+": { dir: "previousSibling", first: true }, - "~": { dir: "previousSibling" } - }, - - preFilter: { - "ATTR": function( match ) { - match[ 1 ] = match[ 1 ].replace( runescape, funescape ); - - // Move the given value to match[3] whether quoted or unquoted - match[ 3 ] = ( match[ 3 ] || match[ 4 ] || - match[ 5 ] || "" ).replace( runescape, funescape ); - - if ( match[ 2 ] === "~=" ) { - match[ 3 ] = " " + match[ 3 ] + " "; - } - - return match.slice( 0, 4 ); - }, - - "CHILD": function( match ) { - - /* matches from matchExpr["CHILD"] - 1 type (only|nth|...) - 2 what (child|of-type) - 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) - 4 xn-component of xn+y argument ([+-]?\d*n|) - 5 sign of xn-component - 6 x of xn-component - 7 sign of y-component - 8 y of y-component - */ - match[ 1 ] = match[ 1 ].toLowerCase(); - - if ( match[ 1 ].slice( 0, 3 ) === "nth" ) { - - // nth-* requires argument - if ( !match[ 3 ] ) { - Sizzle.error( match[ 0 ] ); - } - - // numeric x and y parameters for Expr.filter.CHILD - // remember that false/true cast respectively to 0/1 - match[ 4 ] = +( match[ 4 ] ? - match[ 5 ] + ( match[ 6 ] || 1 ) : - 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) ); - match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" ); - - // other types prohibit arguments - } else if ( match[ 3 ] ) { - Sizzle.error( match[ 0 ] ); - } - - return match; - }, - - "PSEUDO": function( match ) { - var excess, - unquoted = !match[ 6 ] && match[ 2 ]; - - if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) { - return null; - } - - // Accept quoted arguments as-is - if ( match[ 3 ] ) { - match[ 2 ] = match[ 4 ] || match[ 5 ] || ""; - - // Strip excess characters from unquoted arguments - } else if ( unquoted && rpseudo.test( unquoted ) && - - // Get excess from tokenize (recursively) - ( excess = tokenize( unquoted, true ) ) && - - // advance to the next closing parenthesis - ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) { - - // excess is a negative index - match[ 0 ] = match[ 0 ].slice( 0, excess ); - match[ 2 ] = unquoted.slice( 0, excess ); - } - - // Return only captures needed by the pseudo filter method (type and argument) - return match.slice( 0, 3 ); - } - }, - - filter: { - - "TAG": function( nodeNameSelector ) { - var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); - return nodeNameSelector === "*" ? - function() { - return true; - } : - function( elem ) { - return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; - }; - }, - - "CLASS": function( className ) { - var pattern = classCache[ className + " " ]; - - return pattern || - ( pattern = new RegExp( "(^|" + whitespace + - ")" + className + "(" + whitespace + "|$)" ) ) && classCache( - className, function( elem ) { - return pattern.test( - typeof elem.className === "string" && elem.className || - typeof elem.getAttribute !== "undefined" && - elem.getAttribute( "class" ) || - "" - ); - } ); - }, - - "ATTR": function( name, operator, check ) { - return function( elem ) { - var result = Sizzle.attr( elem, name ); - - if ( result == null ) { - return operator === "!="; - } - if ( !operator ) { - return true; - } - - result += ""; - - /* eslint-disable max-len */ - - return operator === "=" ? result === check : - operator === "!=" ? result !== check : - operator === "^=" ? check && result.indexOf( check ) === 0 : - operator === "*=" ? check && result.indexOf( check ) > -1 : - operator === "$=" ? check && result.slice( -check.length ) === check : - operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : - operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : - false; - /* eslint-enable max-len */ - - }; - }, - - "CHILD": function( type, what, _argument, first, last ) { - var simple = type.slice( 0, 3 ) !== "nth", - forward = type.slice( -4 ) !== "last", - ofType = what === "of-type"; - - return first === 1 && last === 0 ? - - // Shortcut for :nth-*(n) - function( elem ) { - return !!elem.parentNode; - } : - - function( elem, _context, xml ) { - var cache, uniqueCache, outerCache, node, nodeIndex, start, - dir = simple !== forward ? "nextSibling" : "previousSibling", - parent = elem.parentNode, - name = ofType && elem.nodeName.toLowerCase(), - useCache = !xml && !ofType, - diff = false; - - if ( parent ) { - - // :(first|last|only)-(child|of-type) - if ( simple ) { - while ( dir ) { - node = elem; - while ( ( node = node[ dir ] ) ) { - if ( ofType ? - node.nodeName.toLowerCase() === name : - node.nodeType === 1 ) { - - return false; - } - } - - // Reverse direction for :only-* (if we haven't yet done so) - start = dir = type === "only" && !start && "nextSibling"; - } - return true; - } - - start = [ forward ? parent.firstChild : parent.lastChild ]; - - // non-xml :nth-child(...) stores cache data on `parent` - if ( forward && useCache ) { - - // Seek `elem` from a previously-cached index - - // ...in a gzip-friendly way - node = parent; - outerCache = node[ expando ] || ( node[ expando ] = {} ); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ node.uniqueID ] || - ( outerCache[ node.uniqueID ] = {} ); - - cache = uniqueCache[ type ] || []; - nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; - diff = nodeIndex && cache[ 2 ]; - node = nodeIndex && parent.childNodes[ nodeIndex ]; - - while ( ( node = ++nodeIndex && node && node[ dir ] || - - // Fallback to seeking `elem` from the start - ( diff = nodeIndex = 0 ) || start.pop() ) ) { - - // When found, cache indexes on `parent` and break - if ( node.nodeType === 1 && ++diff && node === elem ) { - uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; - break; - } - } - - } else { - - // Use previously-cached element index if available - if ( useCache ) { - - // ...in a gzip-friendly way - node = elem; - outerCache = node[ expando ] || ( node[ expando ] = {} ); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ node.uniqueID ] || - ( outerCache[ node.uniqueID ] = {} ); - - cache = uniqueCache[ type ] || []; - nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; - diff = nodeIndex; - } - - // xml :nth-child(...) - // or :nth-last-child(...) or :nth(-last)?-of-type(...) - if ( diff === false ) { - - // Use the same loop as above to seek `elem` from the start - while ( ( node = ++nodeIndex && node && node[ dir ] || - ( diff = nodeIndex = 0 ) || start.pop() ) ) { - - if ( ( ofType ? - node.nodeName.toLowerCase() === name : - node.nodeType === 1 ) && - ++diff ) { - - // Cache the index of each encountered element - if ( useCache ) { - outerCache = node[ expando ] || - ( node[ expando ] = {} ); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ node.uniqueID ] || - ( outerCache[ node.uniqueID ] = {} ); - - uniqueCache[ type ] = [ dirruns, diff ]; - } - - if ( node === elem ) { - break; - } - } - } - } - } - - // Incorporate the offset, then check against cycle size - diff -= last; - return diff === first || ( diff % first === 0 && diff / first >= 0 ); - } - }; - }, - - "PSEUDO": function( pseudo, argument ) { - - // pseudo-class names are case-insensitive - // http://www.w3.org/TR/selectors/#pseudo-classes - // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters - // Remember that setFilters inherits from pseudos - var args, - fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || - Sizzle.error( "unsupported pseudo: " + pseudo ); - - // The user may use createPseudo to indicate that - // arguments are needed to create the filter function - // just as Sizzle does - if ( fn[ expando ] ) { - return fn( argument ); - } - - // But maintain support for old signatures - if ( fn.length > 1 ) { - args = [ pseudo, pseudo, "", argument ]; - return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? - markFunction( function( seed, matches ) { - var idx, - matched = fn( seed, argument ), - i = matched.length; - while ( i-- ) { - idx = indexOf( seed, matched[ i ] ); - seed[ idx ] = !( matches[ idx ] = matched[ i ] ); - } - } ) : - function( elem ) { - return fn( elem, 0, args ); - }; - } - - return fn; - } - }, - - pseudos: { - - // Potentially complex pseudos - "not": markFunction( function( selector ) { - - // Trim the selector passed to compile - // to avoid treating leading and trailing - // spaces as combinators - var input = [], - results = [], - matcher = compile( selector.replace( rtrim, "$1" ) ); - - return matcher[ expando ] ? - markFunction( function( seed, matches, _context, xml ) { - var elem, - unmatched = matcher( seed, null, xml, [] ), - i = seed.length; - - // Match elements unmatched by `matcher` - while ( i-- ) { - if ( ( elem = unmatched[ i ] ) ) { - seed[ i ] = !( matches[ i ] = elem ); - } - } - } ) : - function( elem, _context, xml ) { - input[ 0 ] = elem; - matcher( input, null, xml, results ); - - // Don't keep the element (issue #299) - input[ 0 ] = null; - return !results.pop(); - }; - } ), - - "has": markFunction( function( selector ) { - return function( elem ) { - return Sizzle( selector, elem ).length > 0; - }; - } ), - - "contains": markFunction( function( text ) { - text = text.replace( runescape, funescape ); - return function( elem ) { - return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1; - }; - } ), - - // "Whether an element is represented by a :lang() selector - // is based solely on the element's language value - // being equal to the identifier C, - // or beginning with the identifier C immediately followed by "-". - // The matching of C against the element's language value is performed case-insensitively. - // The identifier C does not have to be a valid language name." - // http://www.w3.org/TR/selectors/#lang-pseudo - "lang": markFunction( function( lang ) { - - // lang value must be a valid identifier - if ( !ridentifier.test( lang || "" ) ) { - Sizzle.error( "unsupported lang: " + lang ); - } - lang = lang.replace( runescape, funescape ).toLowerCase(); - return function( elem ) { - var elemLang; - do { - if ( ( elemLang = documentIsHTML ? - elem.lang : - elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) { - - elemLang = elemLang.toLowerCase(); - return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; - } - } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 ); - return false; - }; - } ), - - // Miscellaneous - "target": function( elem ) { - var hash = window.location && window.location.hash; - return hash && hash.slice( 1 ) === elem.id; - }, - - "root": function( elem ) { - return elem === docElem; - }, - - "focus": function( elem ) { - return elem === document.activeElement && - ( !document.hasFocus || document.hasFocus() ) && - !!( elem.type || elem.href || ~elem.tabIndex ); - }, - - // Boolean properties - "enabled": createDisabledPseudo( false ), - "disabled": createDisabledPseudo( true ), - - "checked": function( elem ) { - - // In CSS3, :checked should return both checked and selected elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - var nodeName = elem.nodeName.toLowerCase(); - return ( nodeName === "input" && !!elem.checked ) || - ( nodeName === "option" && !!elem.selected ); - }, - - "selected": function( elem ) { - - // Accessing this property makes selected-by-default - // options in Safari work properly - if ( elem.parentNode ) { - // eslint-disable-next-line no-unused-expressions - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - // Contents - "empty": function( elem ) { - - // http://www.w3.org/TR/selectors/#empty-pseudo - // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), - // but not by others (comment: 8; processing instruction: 7; etc.) - // nodeType < 6 works because attributes (2) do not appear as children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - if ( elem.nodeType < 6 ) { - return false; - } - } - return true; - }, - - "parent": function( elem ) { - return !Expr.pseudos[ "empty" ]( elem ); - }, - - // Element/input types - "header": function( elem ) { - return rheader.test( elem.nodeName ); - }, - - "input": function( elem ) { - return rinputs.test( elem.nodeName ); - }, - - "button": function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === "button" || name === "button"; - }, - - "text": function( elem ) { - var attr; - return elem.nodeName.toLowerCase() === "input" && - elem.type === "text" && - - // Support: IE<8 - // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" - ( ( attr = elem.getAttribute( "type" ) ) == null || - attr.toLowerCase() === "text" ); - }, - - // Position-in-collection - "first": createPositionalPseudo( function() { - return [ 0 ]; - } ), - - "last": createPositionalPseudo( function( _matchIndexes, length ) { - return [ length - 1 ]; - } ), - - "eq": createPositionalPseudo( function( _matchIndexes, length, argument ) { - return [ argument < 0 ? argument + length : argument ]; - } ), - - "even": createPositionalPseudo( function( matchIndexes, length ) { - var i = 0; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - } ), - - "odd": createPositionalPseudo( function( matchIndexes, length ) { - var i = 1; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - } ), - - "lt": createPositionalPseudo( function( matchIndexes, length, argument ) { - var i = argument < 0 ? - argument + length : - argument > length ? - length : - argument; - for ( ; --i >= 0; ) { - matchIndexes.push( i ); - } - return matchIndexes; - } ), - - "gt": createPositionalPseudo( function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; ++i < length; ) { - matchIndexes.push( i ); - } - return matchIndexes; - } ) - } -}; - -Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ]; - -// Add button/input type pseudos -for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { - Expr.pseudos[ i ] = createInputPseudo( i ); -} -for ( i in { submit: true, reset: true } ) { - Expr.pseudos[ i ] = createButtonPseudo( i ); -} - -// Easy API for creating new setFilters -function setFilters() {} -setFilters.prototype = Expr.filters = Expr.pseudos; -Expr.setFilters = new setFilters(); - -tokenize = Sizzle.tokenize = function( selector, parseOnly ) { - var matched, match, tokens, type, - soFar, groups, preFilters, - cached = tokenCache[ selector + " " ]; - - if ( cached ) { - return parseOnly ? 0 : cached.slice( 0 ); - } - - soFar = selector; - groups = []; - preFilters = Expr.preFilter; - - while ( soFar ) { - - // Comma and first run - if ( !matched || ( match = rcomma.exec( soFar ) ) ) { - if ( match ) { - - // Don't consume trailing commas as valid - soFar = soFar.slice( match[ 0 ].length ) || soFar; - } - groups.push( ( tokens = [] ) ); - } - - matched = false; - - // Combinators - if ( ( match = rcombinators.exec( soFar ) ) ) { - matched = match.shift(); - tokens.push( { - value: matched, - - // Cast descendant combinators to space - type: match[ 0 ].replace( rtrim, " " ) - } ); - soFar = soFar.slice( matched.length ); - } - - // Filters - for ( type in Expr.filter ) { - if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] || - ( match = preFilters[ type ]( match ) ) ) ) { - matched = match.shift(); - tokens.push( { - value: matched, - type: type, - matches: match - } ); - soFar = soFar.slice( matched.length ); - } - } - - if ( !matched ) { - break; - } - } - - // Return the length of the invalid excess - // if we're just parsing - // Otherwise, throw an error or return tokens - return parseOnly ? - soFar.length : - soFar ? - Sizzle.error( selector ) : - - // Cache the tokens - tokenCache( selector, groups ).slice( 0 ); -}; - -function toSelector( tokens ) { - var i = 0, - len = tokens.length, - selector = ""; - for ( ; i < len; i++ ) { - selector += tokens[ i ].value; - } - return selector; -} - -function addCombinator( matcher, combinator, base ) { - var dir = combinator.dir, - skip = combinator.next, - key = skip || dir, - checkNonElements = base && key === "parentNode", - doneName = done++; - - return combinator.first ? - - // Check against closest ancestor/preceding element - function( elem, context, xml ) { - while ( ( elem = elem[ dir ] ) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - return matcher( elem, context, xml ); - } - } - return false; - } : - - // Check against all ancestor/preceding elements - function( elem, context, xml ) { - var oldCache, uniqueCache, outerCache, - newCache = [ dirruns, doneName ]; - - // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching - if ( xml ) { - while ( ( elem = elem[ dir ] ) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - if ( matcher( elem, context, xml ) ) { - return true; - } - } - } - } else { - while ( ( elem = elem[ dir ] ) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - outerCache = elem[ expando ] || ( elem[ expando ] = {} ); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ elem.uniqueID ] || - ( outerCache[ elem.uniqueID ] = {} ); - - if ( skip && skip === elem.nodeName.toLowerCase() ) { - elem = elem[ dir ] || elem; - } else if ( ( oldCache = uniqueCache[ key ] ) && - oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { - - // Assign to newCache so results back-propagate to previous elements - return ( newCache[ 2 ] = oldCache[ 2 ] ); - } else { - - // Reuse newcache so results back-propagate to previous elements - uniqueCache[ key ] = newCache; - - // A match means we're done; a fail means we have to keep checking - if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) { - return true; - } - } - } - } - } - return false; - }; -} - -function elementMatcher( matchers ) { - return matchers.length > 1 ? - function( elem, context, xml ) { - var i = matchers.length; - while ( i-- ) { - if ( !matchers[ i ]( elem, context, xml ) ) { - return false; - } - } - return true; - } : - matchers[ 0 ]; -} - -function multipleContexts( selector, contexts, results ) { - var i = 0, - len = contexts.length; - for ( ; i < len; i++ ) { - Sizzle( selector, contexts[ i ], results ); - } - return results; -} - -function condense( unmatched, map, filter, context, xml ) { - var elem, - newUnmatched = [], - i = 0, - len = unmatched.length, - mapped = map != null; - - for ( ; i < len; i++ ) { - if ( ( elem = unmatched[ i ] ) ) { - if ( !filter || filter( elem, context, xml ) ) { - newUnmatched.push( elem ); - if ( mapped ) { - map.push( i ); - } - } - } - } - - return newUnmatched; -} - -function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { - if ( postFilter && !postFilter[ expando ] ) { - postFilter = setMatcher( postFilter ); - } - if ( postFinder && !postFinder[ expando ] ) { - postFinder = setMatcher( postFinder, postSelector ); - } - return markFunction( function( seed, results, context, xml ) { - var temp, i, elem, - preMap = [], - postMap = [], - preexisting = results.length, - - // Get initial elements from seed or context - elems = seed || multipleContexts( - selector || "*", - context.nodeType ? [ context ] : context, - [] - ), - - // Prefilter to get matcher input, preserving a map for seed-results synchronization - matcherIn = preFilter && ( seed || !selector ) ? - condense( elems, preMap, preFilter, context, xml ) : - elems, - - matcherOut = matcher ? - - // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, - postFinder || ( seed ? preFilter : preexisting || postFilter ) ? - - // ...intermediate processing is necessary - [] : - - // ...otherwise use results directly - results : - matcherIn; - - // Find primary matches - if ( matcher ) { - matcher( matcherIn, matcherOut, context, xml ); - } - - // Apply postFilter - if ( postFilter ) { - temp = condense( matcherOut, postMap ); - postFilter( temp, [], context, xml ); - - // Un-match failing elements by moving them back to matcherIn - i = temp.length; - while ( i-- ) { - if ( ( elem = temp[ i ] ) ) { - matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem ); - } - } - } - - if ( seed ) { - if ( postFinder || preFilter ) { - if ( postFinder ) { - - // Get the final matcherOut by condensing this intermediate into postFinder contexts - temp = []; - i = matcherOut.length; - while ( i-- ) { - if ( ( elem = matcherOut[ i ] ) ) { - - // Restore matcherIn since elem is not yet a final match - temp.push( ( matcherIn[ i ] = elem ) ); - } - } - postFinder( null, ( matcherOut = [] ), temp, xml ); - } - - // Move matched elements from seed to results to keep them synchronized - i = matcherOut.length; - while ( i-- ) { - if ( ( elem = matcherOut[ i ] ) && - ( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) { - - seed[ temp ] = !( results[ temp ] = elem ); - } - } - } - - // Add elements to results, through postFinder if defined - } else { - matcherOut = condense( - matcherOut === results ? - matcherOut.splice( preexisting, matcherOut.length ) : - matcherOut - ); - if ( postFinder ) { - postFinder( null, results, matcherOut, xml ); - } else { - push.apply( results, matcherOut ); - } - } - } ); -} - -function matcherFromTokens( tokens ) { - var checkContext, matcher, j, - len = tokens.length, - leadingRelative = Expr.relative[ tokens[ 0 ].type ], - implicitRelative = leadingRelative || Expr.relative[ " " ], - i = leadingRelative ? 1 : 0, - - // The foundational matcher ensures that elements are reachable from top-level context(s) - matchContext = addCombinator( function( elem ) { - return elem === checkContext; - }, implicitRelative, true ), - matchAnyContext = addCombinator( function( elem ) { - return indexOf( checkContext, elem ) > -1; - }, implicitRelative, true ), - matchers = [ function( elem, context, xml ) { - var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( - ( checkContext = context ).nodeType ? - matchContext( elem, context, xml ) : - matchAnyContext( elem, context, xml ) ); - - // Avoid hanging onto element (issue #299) - checkContext = null; - return ret; - } ]; - - for ( ; i < len; i++ ) { - if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) { - matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ]; - } else { - matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches ); - - // Return special upon seeing a positional matcher - if ( matcher[ expando ] ) { - - // Find the next relative operator (if any) for proper handling - j = ++i; - for ( ; j < len; j++ ) { - if ( Expr.relative[ tokens[ j ].type ] ) { - break; - } - } - return setMatcher( - i > 1 && elementMatcher( matchers ), - i > 1 && toSelector( - - // If the preceding token was a descendant combinator, insert an implicit any-element `*` - tokens - .slice( 0, i - 1 ) - .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } ) - ).replace( rtrim, "$1" ), - matcher, - i < j && matcherFromTokens( tokens.slice( i, j ) ), - j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ), - j < len && toSelector( tokens ) - ); - } - matchers.push( matcher ); - } - } - - return elementMatcher( matchers ); -} - -function matcherFromGroupMatchers( elementMatchers, setMatchers ) { - var bySet = setMatchers.length > 0, - byElement = elementMatchers.length > 0, - superMatcher = function( seed, context, xml, results, outermost ) { - var elem, j, matcher, - matchedCount = 0, - i = "0", - unmatched = seed && [], - setMatched = [], - contextBackup = outermostContext, - - // We must always have either seed elements or outermost context - elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ), - - // Use integer dirruns iff this is the outermost matcher - dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ), - len = elems.length; - - if ( outermost ) { - - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - outermostContext = context == document || context || outermost; - } - - // Add elements passing elementMatchers directly to results - // Support: IE<9, Safari - // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id - for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) { - if ( byElement && elem ) { - j = 0; - - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( !context && elem.ownerDocument != document ) { - setDocument( elem ); - xml = !documentIsHTML; - } - while ( ( matcher = elementMatchers[ j++ ] ) ) { - if ( matcher( elem, context || document, xml ) ) { - results.push( elem ); - break; - } - } - if ( outermost ) { - dirruns = dirrunsUnique; - } - } - - // Track unmatched elements for set filters - if ( bySet ) { - - // They will have gone through all possible matchers - if ( ( elem = !matcher && elem ) ) { - matchedCount--; - } - - // Lengthen the array for every element, matched or not - if ( seed ) { - unmatched.push( elem ); - } - } - } - - // `i` is now the count of elements visited above, and adding it to `matchedCount` - // makes the latter nonnegative. - matchedCount += i; - - // Apply set filters to unmatched elements - // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` - // equals `i`), unless we didn't visit _any_ elements in the above loop because we have - // no element matchers and no seed. - // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that - // case, which will result in a "00" `matchedCount` that differs from `i` but is also - // numerically zero. - if ( bySet && i !== matchedCount ) { - j = 0; - while ( ( matcher = setMatchers[ j++ ] ) ) { - matcher( unmatched, setMatched, context, xml ); - } - - if ( seed ) { - - // Reintegrate element matches to eliminate the need for sorting - if ( matchedCount > 0 ) { - while ( i-- ) { - if ( !( unmatched[ i ] || setMatched[ i ] ) ) { - setMatched[ i ] = pop.call( results ); - } - } - } - - // Discard index placeholder values to get only actual matches - setMatched = condense( setMatched ); - } - - // Add matches to results - push.apply( results, setMatched ); - - // Seedless set matches succeeding multiple successful matchers stipulate sorting - if ( outermost && !seed && setMatched.length > 0 && - ( matchedCount + setMatchers.length ) > 1 ) { - - Sizzle.uniqueSort( results ); - } - } - - // Override manipulation of globals by nested matchers - if ( outermost ) { - dirruns = dirrunsUnique; - outermostContext = contextBackup; - } - - return unmatched; - }; - - return bySet ? - markFunction( superMatcher ) : - superMatcher; -} - -compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { - var i, - setMatchers = [], - elementMatchers = [], - cached = compilerCache[ selector + " " ]; - - if ( !cached ) { - - // Generate a function of recursive functions that can be used to check each element - if ( !match ) { - match = tokenize( selector ); - } - i = match.length; - while ( i-- ) { - cached = matcherFromTokens( match[ i ] ); - if ( cached[ expando ] ) { - setMatchers.push( cached ); - } else { - elementMatchers.push( cached ); - } - } - - // Cache the compiled function - cached = compilerCache( - selector, - matcherFromGroupMatchers( elementMatchers, setMatchers ) - ); - - // Save selector and tokenization - cached.selector = selector; - } - return cached; -}; - -/** - * A low-level selection function that works with Sizzle's compiled - * selector functions - * @param {String|Function} selector A selector or a pre-compiled - * selector function built with Sizzle.compile - * @param {Element} context - * @param {Array} [results] - * @param {Array} [seed] A set of elements to match against - */ -select = Sizzle.select = function( selector, context, results, seed ) { - var i, tokens, token, type, find, - compiled = typeof selector === "function" && selector, - match = !seed && tokenize( ( selector = compiled.selector || selector ) ); - - results = results || []; - - // Try to minimize operations if there is only one selector in the list and no seed - // (the latter of which guarantees us context) - if ( match.length === 1 ) { - - // Reduce context if the leading compound selector is an ID - tokens = match[ 0 ] = match[ 0 ].slice( 0 ); - if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" && - context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) { - - context = ( Expr.find[ "ID" ]( token.matches[ 0 ] - .replace( runescape, funescape ), context ) || [] )[ 0 ]; - if ( !context ) { - return results; - - // Precompiled matchers will still verify ancestry, so step up a level - } else if ( compiled ) { - context = context.parentNode; - } - - selector = selector.slice( tokens.shift().value.length ); - } - - // Fetch a seed set for right-to-left matching - i = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length; - while ( i-- ) { - token = tokens[ i ]; - - // Abort if we hit a combinator - if ( Expr.relative[ ( type = token.type ) ] ) { - break; - } - if ( ( find = Expr.find[ type ] ) ) { - - // Search, expanding context for leading sibling combinators - if ( ( seed = find( - token.matches[ 0 ].replace( runescape, funescape ), - rsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) || - context - ) ) ) { - - // If seed is empty or no tokens remain, we can return early - tokens.splice( i, 1 ); - selector = seed.length && toSelector( tokens ); - if ( !selector ) { - push.apply( results, seed ); - return results; - } - - break; - } - } - } - } - - // Compile and execute a filtering function if one is not provided - // Provide `match` to avoid retokenization if we modified the selector above - ( compiled || compile( selector, match ) )( - seed, - context, - !documentIsHTML, - results, - !context || rsibling.test( selector ) && testContext( context.parentNode ) || context - ); - return results; -}; - -// One-time assignments - -// Sort stability -support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando; - -// Support: Chrome 14-35+ -// Always assume duplicates if they aren't passed to the comparison function -support.detectDuplicates = !!hasDuplicate; - -// Initialize against the default document -setDocument(); - -// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) -// Detached nodes confoundingly follow *each other* -support.sortDetached = assert( function( el ) { - - // Should return 1, but returns 4 (following) - return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1; -} ); - -// Support: IE<8 -// Prevent attribute/property "interpolation" -// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx -if ( !assert( function( el ) { - el.innerHTML = ""; - return el.firstChild.getAttribute( "href" ) === "#"; -} ) ) { - addHandle( "type|href|height|width", function( elem, name, isXML ) { - if ( !isXML ) { - return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); - } - } ); -} - -// Support: IE<9 -// Use defaultValue in place of getAttribute("value") -if ( !support.attributes || !assert( function( el ) { - el.innerHTML = ""; - el.firstChild.setAttribute( "value", "" ); - return el.firstChild.getAttribute( "value" ) === ""; -} ) ) { - addHandle( "value", function( elem, _name, isXML ) { - if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { - return elem.defaultValue; - } - } ); -} - -// Support: IE<9 -// Use getAttributeNode to fetch booleans when getAttribute lies -if ( !assert( function( el ) { - return el.getAttribute( "disabled" ) == null; -} ) ) { - addHandle( booleans, function( elem, name, isXML ) { - var val; - if ( !isXML ) { - return elem[ name ] === true ? name.toLowerCase() : - ( val = elem.getAttributeNode( name ) ) && val.specified ? - val.value : - null; - } - } ); -} - -return Sizzle; - -} )( window ); - - - -jQuery.find = Sizzle; -jQuery.expr = Sizzle.selectors; - -// Deprecated -jQuery.expr[ ":" ] = jQuery.expr.pseudos; -jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; -jQuery.text = Sizzle.getText; -jQuery.isXMLDoc = Sizzle.isXML; -jQuery.contains = Sizzle.contains; -jQuery.escapeSelector = Sizzle.escape; - - - - -var dir = function( elem, dir, until ) { - var matched = [], - truncate = until !== undefined; - - while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { - if ( elem.nodeType === 1 ) { - if ( truncate && jQuery( elem ).is( until ) ) { - break; - } - matched.push( elem ); - } - } - return matched; -}; - - -var siblings = function( n, elem ) { - var matched = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - matched.push( n ); - } - } - - return matched; -}; - - -var rneedsContext = jQuery.expr.match.needsContext; - - - -function nodeName( elem, name ) { - - return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); - -} -var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); - - - -// Implement the identical functionality for filter and not -function winnow( elements, qualifier, not ) { - if ( isFunction( qualifier ) ) { - return jQuery.grep( elements, function( elem, i ) { - return !!qualifier.call( elem, i, elem ) !== not; - } ); - } - - // Single element - if ( qualifier.nodeType ) { - return jQuery.grep( elements, function( elem ) { - return ( elem === qualifier ) !== not; - } ); - } - - // Arraylike of elements (jQuery, arguments, Array) - if ( typeof qualifier !== "string" ) { - return jQuery.grep( elements, function( elem ) { - return ( indexOf.call( qualifier, elem ) > -1 ) !== not; - } ); - } - - // Filtered directly for both simple and complex selectors - return jQuery.filter( qualifier, elements, not ); -} - -jQuery.filter = function( expr, elems, not ) { - var elem = elems[ 0 ]; - - if ( not ) { - expr = ":not(" + expr + ")"; - } - - if ( elems.length === 1 && elem.nodeType === 1 ) { - return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; - } - - return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { - return elem.nodeType === 1; - } ) ); -}; - -jQuery.fn.extend( { - find: function( selector ) { - var i, ret, - len = this.length, - self = this; - - if ( typeof selector !== "string" ) { - return this.pushStack( jQuery( selector ).filter( function() { - for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( self[ i ], this ) ) { - return true; - } - } - } ) ); - } - - ret = this.pushStack( [] ); - - for ( i = 0; i < len; i++ ) { - jQuery.find( selector, self[ i ], ret ); - } - - return len > 1 ? jQuery.uniqueSort( ret ) : ret; - }, - filter: function( selector ) { - return this.pushStack( winnow( this, selector || [], false ) ); - }, - not: function( selector ) { - return this.pushStack( winnow( this, selector || [], true ) ); - }, - is: function( selector ) { - return !!winnow( - this, - - // If this is a positional/relative selector, check membership in the returned set - // so $("p:first").is("p:last") won't return true for a doc with two "p". - typeof selector === "string" && rneedsContext.test( selector ) ? - jQuery( selector ) : - selector || [], - false - ).length; - } -} ); - - -// Initialize a jQuery object - - -// A central reference to the root jQuery(document) -var rootjQuery, - - // A simple way to check for HTML strings - // Prioritize #id over to avoid XSS via location.hash (#9521) - // Strict HTML recognition (#11290: must start with <) - // Shortcut simple #id case for speed - rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, - - init = jQuery.fn.init = function( selector, context, root ) { - var match, elem; - - // HANDLE: $(""), $(null), $(undefined), $(false) - if ( !selector ) { - return this; - } - - // Method init() accepts an alternate rootjQuery - // so migrate can support jQuery.sub (gh-2101) - root = root || rootjQuery; - - // Handle HTML strings - if ( typeof selector === "string" ) { - if ( selector[ 0 ] === "<" && - selector[ selector.length - 1 ] === ">" && - selector.length >= 3 ) { - - // Assume that strings that start and end with <> are HTML and skip the regex check - match = [ null, selector, null ]; - - } else { - match = rquickExpr.exec( selector ); - } - - // Match html or make sure no context is specified for #id - if ( match && ( match[ 1 ] || !context ) ) { - - // HANDLE: $(html) -> $(array) - if ( match[ 1 ] ) { - context = context instanceof jQuery ? context[ 0 ] : context; - - // Option to run scripts is true for back-compat - // Intentionally let the error be thrown if parseHTML is not present - jQuery.merge( this, jQuery.parseHTML( - match[ 1 ], - context && context.nodeType ? context.ownerDocument || context : document, - true - ) ); - - // HANDLE: $(html, props) - if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { - for ( match in context ) { - - // Properties of context are called as methods if possible - if ( isFunction( this[ match ] ) ) { - this[ match ]( context[ match ] ); - - // ...and otherwise set as attributes - } else { - this.attr( match, context[ match ] ); - } - } - } - - return this; - - // HANDLE: $(#id) - } else { - elem = document.getElementById( match[ 2 ] ); - - if ( elem ) { - - // Inject the element directly into the jQuery object - this[ 0 ] = elem; - this.length = 1; - } - return this; - } - - // HANDLE: $(expr, $(...)) - } else if ( !context || context.jquery ) { - return ( context || root ).find( selector ); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return this.constructor( context ).find( selector ); - } - - // HANDLE: $(DOMElement) - } else if ( selector.nodeType ) { - this[ 0 ] = selector; - this.length = 1; - return this; - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( isFunction( selector ) ) { - return root.ready !== undefined ? - root.ready( selector ) : - - // Execute immediately if ready is not present - selector( jQuery ); - } - - return jQuery.makeArray( selector, this ); - }; - -// Give the init function the jQuery prototype for later instantiation -init.prototype = jQuery.fn; - -// Initialize central reference -rootjQuery = jQuery( document ); - - -var rparentsprev = /^(?:parents|prev(?:Until|All))/, - - // Methods guaranteed to produce a unique set when starting from a unique set - guaranteedUnique = { - children: true, - contents: true, - next: true, - prev: true - }; - -jQuery.fn.extend( { - has: function( target ) { - var targets = jQuery( target, this ), - l = targets.length; - - return this.filter( function() { - var i = 0; - for ( ; i < l; i++ ) { - if ( jQuery.contains( this, targets[ i ] ) ) { - return true; - } - } - } ); - }, - - closest: function( selectors, context ) { - var cur, - i = 0, - l = this.length, - matched = [], - targets = typeof selectors !== "string" && jQuery( selectors ); - - // Positional selectors never match, since there's no _selection_ context - if ( !rneedsContext.test( selectors ) ) { - for ( ; i < l; i++ ) { - for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { - - // Always skip document fragments - if ( cur.nodeType < 11 && ( targets ? - targets.index( cur ) > -1 : - - // Don't pass non-elements to Sizzle - cur.nodeType === 1 && - jQuery.find.matchesSelector( cur, selectors ) ) ) { - - matched.push( cur ); - break; - } - } - } - } - - return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); - }, - - // Determine the position of an element within the set - index: function( elem ) { - - // No argument, return index in parent - if ( !elem ) { - return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; - } - - // Index in selector - if ( typeof elem === "string" ) { - return indexOf.call( jQuery( elem ), this[ 0 ] ); - } - - // Locate the position of the desired element - return indexOf.call( this, - - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[ 0 ] : elem - ); - }, - - add: function( selector, context ) { - return this.pushStack( - jQuery.uniqueSort( - jQuery.merge( this.get(), jQuery( selector, context ) ) - ) - ); - }, - - addBack: function( selector ) { - return this.add( selector == null ? - this.prevObject : this.prevObject.filter( selector ) - ); - } -} ); - -function sibling( cur, dir ) { - while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} - return cur; -} - -jQuery.each( { - parent: function( elem ) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - parents: function( elem ) { - return dir( elem, "parentNode" ); - }, - parentsUntil: function( elem, _i, until ) { - return dir( elem, "parentNode", until ); - }, - next: function( elem ) { - return sibling( elem, "nextSibling" ); - }, - prev: function( elem ) { - return sibling( elem, "previousSibling" ); - }, - nextAll: function( elem ) { - return dir( elem, "nextSibling" ); - }, - prevAll: function( elem ) { - return dir( elem, "previousSibling" ); - }, - nextUntil: function( elem, _i, until ) { - return dir( elem, "nextSibling", until ); - }, - prevUntil: function( elem, _i, until ) { - return dir( elem, "previousSibling", until ); - }, - siblings: function( elem ) { - return siblings( ( elem.parentNode || {} ).firstChild, elem ); - }, - children: function( elem ) { - return siblings( elem.firstChild ); - }, - contents: function( elem ) { - if ( elem.contentDocument != null && - - // Support: IE 11+ - // elements with no `data` attribute has an object - // `contentDocument` with a `null` prototype. - getProto( elem.contentDocument ) ) { - - return elem.contentDocument; - } - - // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only - // Treat the template element as a regular one in browsers that - // don't support it. - if ( nodeName( elem, "template" ) ) { - elem = elem.content || elem; - } - - return jQuery.merge( [], elem.childNodes ); - } -}, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var matched = jQuery.map( this, fn, until ); - - if ( name.slice( -5 ) !== "Until" ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - matched = jQuery.filter( selector, matched ); - } - - if ( this.length > 1 ) { - - // Remove duplicates - if ( !guaranteedUnique[ name ] ) { - jQuery.uniqueSort( matched ); - } - - // Reverse order for parents* and prev-derivatives - if ( rparentsprev.test( name ) ) { - matched.reverse(); - } - } - - return this.pushStack( matched ); - }; -} ); -var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); - - - -// Convert String-formatted options into Object-formatted ones -function createOptions( options ) { - var object = {}; - jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { - object[ flag ] = true; - } ); - return object; -} - -/* - * Create a callback list using the following parameters: - * - * options: an optional list of space-separated options that will change how - * the callback list behaves or a more traditional option object - * - * By default a callback list will act like an event callback list and can be - * "fired" multiple times. - * - * Possible options: - * - * once: will ensure the callback list can only be fired once (like a Deferred) - * - * memory: will keep track of previous values and will call any callback added - * after the list has been fired right away with the latest "memorized" - * values (like a Deferred) - * - * unique: will ensure a callback can only be added once (no duplicate in the list) - * - * stopOnFalse: interrupt callings when a callback returns false - * - */ -jQuery.Callbacks = function( options ) { - - // Convert options from String-formatted to Object-formatted if needed - // (we check in cache first) - options = typeof options === "string" ? - createOptions( options ) : - jQuery.extend( {}, options ); - - var // Flag to know if list is currently firing - firing, - - // Last fire value for non-forgettable lists - memory, - - // Flag to know if list was already fired - fired, - - // Flag to prevent firing - locked, - - // Actual callback list - list = [], - - // Queue of execution data for repeatable lists - queue = [], - - // Index of currently firing callback (modified by add/remove as needed) - firingIndex = -1, - - // Fire callbacks - fire = function() { - - // Enforce single-firing - locked = locked || options.once; - - // Execute callbacks for all pending executions, - // respecting firingIndex overrides and runtime changes - fired = firing = true; - for ( ; queue.length; firingIndex = -1 ) { - memory = queue.shift(); - while ( ++firingIndex < list.length ) { - - // Run callback and check for early termination - if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && - options.stopOnFalse ) { - - // Jump to end and forget the data so .add doesn't re-fire - firingIndex = list.length; - memory = false; - } - } - } - - // Forget the data if we're done with it - if ( !options.memory ) { - memory = false; - } - - firing = false; - - // Clean up if we're done firing for good - if ( locked ) { - - // Keep an empty list if we have data for future add calls - if ( memory ) { - list = []; - - // Otherwise, this object is spent - } else { - list = ""; - } - } - }, - - // Actual Callbacks object - self = { - - // Add a callback or a collection of callbacks to the list - add: function() { - if ( list ) { - - // If we have memory from a past run, we should fire after adding - if ( memory && !firing ) { - firingIndex = list.length - 1; - queue.push( memory ); - } - - ( function add( args ) { - jQuery.each( args, function( _, arg ) { - if ( isFunction( arg ) ) { - if ( !options.unique || !self.has( arg ) ) { - list.push( arg ); - } - } else if ( arg && arg.length && toType( arg ) !== "string" ) { - - // Inspect recursively - add( arg ); - } - } ); - } )( arguments ); - - if ( memory && !firing ) { - fire(); - } - } - return this; - }, - - // Remove a callback from the list - remove: function() { - jQuery.each( arguments, function( _, arg ) { - var index; - while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { - list.splice( index, 1 ); - - // Handle firing indexes - if ( index <= firingIndex ) { - firingIndex--; - } - } - } ); - return this; - }, - - // Check if a given callback is in the list. - // If no argument is given, return whether or not list has callbacks attached. - has: function( fn ) { - return fn ? - jQuery.inArray( fn, list ) > -1 : - list.length > 0; - }, - - // Remove all callbacks from the list - empty: function() { - if ( list ) { - list = []; - } - return this; - }, - - // Disable .fire and .add - // Abort any current/pending executions - // Clear all callbacks and values - disable: function() { - locked = queue = []; - list = memory = ""; - return this; - }, - disabled: function() { - return !list; - }, - - // Disable .fire - // Also disable .add unless we have memory (since it would have no effect) - // Abort any pending executions - lock: function() { - locked = queue = []; - if ( !memory && !firing ) { - list = memory = ""; - } - return this; - }, - locked: function() { - return !!locked; - }, - - // Call all callbacks with the given context and arguments - fireWith: function( context, args ) { - if ( !locked ) { - args = args || []; - args = [ context, args.slice ? args.slice() : args ]; - queue.push( args ); - if ( !firing ) { - fire(); - } - } - return this; - }, - - // Call all the callbacks with the given arguments - fire: function() { - self.fireWith( this, arguments ); - return this; - }, - - // To know if the callbacks have already been called at least once - fired: function() { - return !!fired; - } - }; - - return self; -}; - - -function Identity( v ) { - return v; -} -function Thrower( ex ) { - throw ex; -} - -function adoptValue( value, resolve, reject, noValue ) { - var method; - - try { - - // Check for promise aspect first to privilege synchronous behavior - if ( value && isFunction( ( method = value.promise ) ) ) { - method.call( value ).done( resolve ).fail( reject ); - - // Other thenables - } else if ( value && isFunction( ( method = value.then ) ) ) { - method.call( value, resolve, reject ); - - // Other non-thenables - } else { - - // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: - // * false: [ value ].slice( 0 ) => resolve( value ) - // * true: [ value ].slice( 1 ) => resolve() - resolve.apply( undefined, [ value ].slice( noValue ) ); - } - - // For Promises/A+, convert exceptions into rejections - // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in - // Deferred#then to conditionally suppress rejection. - } catch ( value ) { - - // Support: Android 4.0 only - // Strict mode functions invoked without .call/.apply get global-object context - reject.apply( undefined, [ value ] ); - } -} - -jQuery.extend( { - - Deferred: function( func ) { - var tuples = [ - - // action, add listener, callbacks, - // ... .then handlers, argument index, [final state] - [ "notify", "progress", jQuery.Callbacks( "memory" ), - jQuery.Callbacks( "memory" ), 2 ], - [ "resolve", "done", jQuery.Callbacks( "once memory" ), - jQuery.Callbacks( "once memory" ), 0, "resolved" ], - [ "reject", "fail", jQuery.Callbacks( "once memory" ), - jQuery.Callbacks( "once memory" ), 1, "rejected" ] - ], - state = "pending", - promise = { - state: function() { - return state; - }, - always: function() { - deferred.done( arguments ).fail( arguments ); - return this; - }, - "catch": function( fn ) { - return promise.then( null, fn ); - }, - - // Keep pipe for back-compat - pipe: function( /* fnDone, fnFail, fnProgress */ ) { - var fns = arguments; - - return jQuery.Deferred( function( newDefer ) { - jQuery.each( tuples, function( _i, tuple ) { - - // Map tuples (progress, done, fail) to arguments (done, fail, progress) - var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; - - // deferred.progress(function() { bind to newDefer or newDefer.notify }) - // deferred.done(function() { bind to newDefer or newDefer.resolve }) - // deferred.fail(function() { bind to newDefer or newDefer.reject }) - deferred[ tuple[ 1 ] ]( function() { - var returned = fn && fn.apply( this, arguments ); - if ( returned && isFunction( returned.promise ) ) { - returned.promise() - .progress( newDefer.notify ) - .done( newDefer.resolve ) - .fail( newDefer.reject ); - } else { - newDefer[ tuple[ 0 ] + "With" ]( - this, - fn ? [ returned ] : arguments - ); - } - } ); - } ); - fns = null; - } ).promise(); - }, - then: function( onFulfilled, onRejected, onProgress ) { - var maxDepth = 0; - function resolve( depth, deferred, handler, special ) { - return function() { - var that = this, - args = arguments, - mightThrow = function() { - var returned, then; - - // Support: Promises/A+ section 2.3.3.3.3 - // https://promisesaplus.com/#point-59 - // Ignore double-resolution attempts - if ( depth < maxDepth ) { - return; - } - - returned = handler.apply( that, args ); - - // Support: Promises/A+ section 2.3.1 - // https://promisesaplus.com/#point-48 - if ( returned === deferred.promise() ) { - throw new TypeError( "Thenable self-resolution" ); - } - - // Support: Promises/A+ sections 2.3.3.1, 3.5 - // https://promisesaplus.com/#point-54 - // https://promisesaplus.com/#point-75 - // Retrieve `then` only once - then = returned && - - // Support: Promises/A+ section 2.3.4 - // https://promisesaplus.com/#point-64 - // Only check objects and functions for thenability - ( typeof returned === "object" || - typeof returned === "function" ) && - returned.then; - - // Handle a returned thenable - if ( isFunction( then ) ) { - - // Special processors (notify) just wait for resolution - if ( special ) { - then.call( - returned, - resolve( maxDepth, deferred, Identity, special ), - resolve( maxDepth, deferred, Thrower, special ) - ); - - // Normal processors (resolve) also hook into progress - } else { - - // ...and disregard older resolution values - maxDepth++; - - then.call( - returned, - resolve( maxDepth, deferred, Identity, special ), - resolve( maxDepth, deferred, Thrower, special ), - resolve( maxDepth, deferred, Identity, - deferred.notifyWith ) - ); - } - - // Handle all other returned values - } else { - - // Only substitute handlers pass on context - // and multiple values (non-spec behavior) - if ( handler !== Identity ) { - that = undefined; - args = [ returned ]; - } - - // Process the value(s) - // Default process is resolve - ( special || deferred.resolveWith )( that, args ); - } - }, - - // Only normal processors (resolve) catch and reject exceptions - process = special ? - mightThrow : - function() { - try { - mightThrow(); - } catch ( e ) { - - if ( jQuery.Deferred.exceptionHook ) { - jQuery.Deferred.exceptionHook( e, - process.stackTrace ); - } - - // Support: Promises/A+ section 2.3.3.3.4.1 - // https://promisesaplus.com/#point-61 - // Ignore post-resolution exceptions - if ( depth + 1 >= maxDepth ) { - - // Only substitute handlers pass on context - // and multiple values (non-spec behavior) - if ( handler !== Thrower ) { - that = undefined; - args = [ e ]; - } - - deferred.rejectWith( that, args ); - } - } - }; - - // Support: Promises/A+ section 2.3.3.3.1 - // https://promisesaplus.com/#point-57 - // Re-resolve promises immediately to dodge false rejection from - // subsequent errors - if ( depth ) { - process(); - } else { - - // Call an optional hook to record the stack, in case of exception - // since it's otherwise lost when execution goes async - if ( jQuery.Deferred.getStackHook ) { - process.stackTrace = jQuery.Deferred.getStackHook(); - } - window.setTimeout( process ); - } - }; - } - - return jQuery.Deferred( function( newDefer ) { - - // progress_handlers.add( ... ) - tuples[ 0 ][ 3 ].add( - resolve( - 0, - newDefer, - isFunction( onProgress ) ? - onProgress : - Identity, - newDefer.notifyWith - ) - ); - - // fulfilled_handlers.add( ... ) - tuples[ 1 ][ 3 ].add( - resolve( - 0, - newDefer, - isFunction( onFulfilled ) ? - onFulfilled : - Identity - ) - ); - - // rejected_handlers.add( ... ) - tuples[ 2 ][ 3 ].add( - resolve( - 0, - newDefer, - isFunction( onRejected ) ? - onRejected : - Thrower - ) - ); - } ).promise(); - }, - - // Get a promise for this deferred - // If obj is provided, the promise aspect is added to the object - promise: function( obj ) { - return obj != null ? jQuery.extend( obj, promise ) : promise; - } - }, - deferred = {}; - - // Add list-specific methods - jQuery.each( tuples, function( i, tuple ) { - var list = tuple[ 2 ], - stateString = tuple[ 5 ]; - - // promise.progress = list.add - // promise.done = list.add - // promise.fail = list.add - promise[ tuple[ 1 ] ] = list.add; - - // Handle state - if ( stateString ) { - list.add( - function() { - - // state = "resolved" (i.e., fulfilled) - // state = "rejected" - state = stateString; - }, - - // rejected_callbacks.disable - // fulfilled_callbacks.disable - tuples[ 3 - i ][ 2 ].disable, - - // rejected_handlers.disable - // fulfilled_handlers.disable - tuples[ 3 - i ][ 3 ].disable, - - // progress_callbacks.lock - tuples[ 0 ][ 2 ].lock, - - // progress_handlers.lock - tuples[ 0 ][ 3 ].lock - ); - } - - // progress_handlers.fire - // fulfilled_handlers.fire - // rejected_handlers.fire - list.add( tuple[ 3 ].fire ); - - // deferred.notify = function() { deferred.notifyWith(...) } - // deferred.resolve = function() { deferred.resolveWith(...) } - // deferred.reject = function() { deferred.rejectWith(...) } - deferred[ tuple[ 0 ] ] = function() { - deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); - return this; - }; - - // deferred.notifyWith = list.fireWith - // deferred.resolveWith = list.fireWith - // deferred.rejectWith = list.fireWith - deferred[ tuple[ 0 ] + "With" ] = list.fireWith; - } ); - - // Make the deferred a promise - promise.promise( deferred ); - - // Call given func if any - if ( func ) { - func.call( deferred, deferred ); - } - - // All done! - return deferred; - }, - - // Deferred helper - when: function( singleValue ) { - var - - // count of uncompleted subordinates - remaining = arguments.length, - - // count of unprocessed arguments - i = remaining, - - // subordinate fulfillment data - resolveContexts = Array( i ), - resolveValues = slice.call( arguments ), - - // the primary Deferred - primary = jQuery.Deferred(), - - // subordinate callback factory - updateFunc = function( i ) { - return function( value ) { - resolveContexts[ i ] = this; - resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; - if ( !( --remaining ) ) { - primary.resolveWith( resolveContexts, resolveValues ); - } - }; - }; - - // Single- and empty arguments are adopted like Promise.resolve - if ( remaining <= 1 ) { - adoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject, - !remaining ); - - // Use .then() to unwrap secondary thenables (cf. gh-3000) - if ( primary.state() === "pending" || - isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { - - return primary.then(); - } - } - - // Multiple arguments are aggregated like Promise.all array elements - while ( i-- ) { - adoptValue( resolveValues[ i ], updateFunc( i ), primary.reject ); - } - - return primary.promise(); - } -} ); - - -// These usually indicate a programmer mistake during development, -// warn about them ASAP rather than swallowing them by default. -var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; - -jQuery.Deferred.exceptionHook = function( error, stack ) { - - // Support: IE 8 - 9 only - // Console exists when dev tools are open, which can happen at any time - if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { - window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); - } -}; - - - - -jQuery.readyException = function( error ) { - window.setTimeout( function() { - throw error; - } ); -}; - - - - -// The deferred used on DOM ready -var readyList = jQuery.Deferred(); - -jQuery.fn.ready = function( fn ) { - - readyList - .then( fn ) - - // Wrap jQuery.readyException in a function so that the lookup - // happens at the time of error handling instead of callback - // registration. - .catch( function( error ) { - jQuery.readyException( error ); - } ); - - return this; -}; - -jQuery.extend( { - - // Is the DOM ready to be used? Set to true once it occurs. - isReady: false, - - // A counter to track how many items to wait for before - // the ready event fires. See #6781 - readyWait: 1, - - // Handle when the DOM is ready - ready: function( wait ) { - - // Abort if there are pending holds or we're already ready - if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { - return; - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If a normal DOM Ready event fired, decrement, and wait if need be - if ( wait !== true && --jQuery.readyWait > 0 ) { - return; - } - - // If there are functions bound, to execute - readyList.resolveWith( document, [ jQuery ] ); - } -} ); - -jQuery.ready.then = readyList.then; - -// The ready event handler and self cleanup method -function completed() { - document.removeEventListener( "DOMContentLoaded", completed ); - window.removeEventListener( "load", completed ); - jQuery.ready(); -} - -// Catch cases where $(document).ready() is called -// after the browser event has already occurred. -// Support: IE <=9 - 10 only -// Older IE sometimes signals "interactive" too soon -if ( document.readyState === "complete" || - ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { - - // Handle it asynchronously to allow scripts the opportunity to delay ready - window.setTimeout( jQuery.ready ); - -} else { - - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", completed ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", completed ); -} - - - - -// Multifunctional method to get and set values of a collection -// The value/s can optionally be executed if it's a function -var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { - var i = 0, - len = elems.length, - bulk = key == null; - - // Sets many values - if ( toType( key ) === "object" ) { - chainable = true; - for ( i in key ) { - access( elems, fn, i, key[ i ], true, emptyGet, raw ); - } - - // Sets one value - } else if ( value !== undefined ) { - chainable = true; - - if ( !isFunction( value ) ) { - raw = true; - } - - if ( bulk ) { - - // Bulk operations run against the entire set - if ( raw ) { - fn.call( elems, value ); - fn = null; - - // ...except when executing function values - } else { - bulk = fn; - fn = function( elem, _key, value ) { - return bulk.call( jQuery( elem ), value ); - }; - } - } - - if ( fn ) { - for ( ; i < len; i++ ) { - fn( - elems[ i ], key, raw ? - value : - value.call( elems[ i ], i, fn( elems[ i ], key ) ) - ); - } - } - } - - if ( chainable ) { - return elems; - } - - // Gets - if ( bulk ) { - return fn.call( elems ); - } - - return len ? fn( elems[ 0 ], key ) : emptyGet; -}; - - -// Matches dashed string for camelizing -var rmsPrefix = /^-ms-/, - rdashAlpha = /-([a-z])/g; - -// Used by camelCase as callback to replace() -function fcamelCase( _all, letter ) { - return letter.toUpperCase(); -} - -// Convert dashed to camelCase; used by the css and data modules -// Support: IE <=9 - 11, Edge 12 - 15 -// Microsoft forgot to hump their vendor prefix (#9572) -function camelCase( string ) { - return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); -} -var acceptData = function( owner ) { - - // Accepts only: - // - Node - // - Node.ELEMENT_NODE - // - Node.DOCUMENT_NODE - // - Object - // - Any - return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); -}; - - - - -function Data() { - this.expando = jQuery.expando + Data.uid++; -} - -Data.uid = 1; - -Data.prototype = { - - cache: function( owner ) { - - // Check if the owner object already has a cache - var value = owner[ this.expando ]; - - // If not, create one - if ( !value ) { - value = {}; - - // We can accept data for non-element nodes in modern browsers, - // but we should not, see #8335. - // Always return an empty object. - if ( acceptData( owner ) ) { - - // If it is a node unlikely to be stringify-ed or looped over - // use plain assignment - if ( owner.nodeType ) { - owner[ this.expando ] = value; - - // Otherwise secure it in a non-enumerable property - // configurable must be true to allow the property to be - // deleted when data is removed - } else { - Object.defineProperty( owner, this.expando, { - value: value, - configurable: true - } ); - } - } - } - - return value; - }, - set: function( owner, data, value ) { - var prop, - cache = this.cache( owner ); - - // Handle: [ owner, key, value ] args - // Always use camelCase key (gh-2257) - if ( typeof data === "string" ) { - cache[ camelCase( data ) ] = value; - - // Handle: [ owner, { properties } ] args - } else { - - // Copy the properties one-by-one to the cache object - for ( prop in data ) { - cache[ camelCase( prop ) ] = data[ prop ]; - } - } - return cache; - }, - get: function( owner, key ) { - return key === undefined ? - this.cache( owner ) : - - // Always use camelCase key (gh-2257) - owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; - }, - access: function( owner, key, value ) { - - // In cases where either: - // - // 1. No key was specified - // 2. A string key was specified, but no value provided - // - // Take the "read" path and allow the get method to determine - // which value to return, respectively either: - // - // 1. The entire cache object - // 2. The data stored at the key - // - if ( key === undefined || - ( ( key && typeof key === "string" ) && value === undefined ) ) { - - return this.get( owner, key ); - } - - // When the key is not a string, or both a key and value - // are specified, set or extend (existing objects) with either: - // - // 1. An object of properties - // 2. A key and value - // - this.set( owner, key, value ); - - // Since the "set" path can have two possible entry points - // return the expected data based on which path was taken[*] - return value !== undefined ? value : key; - }, - remove: function( owner, key ) { - var i, - cache = owner[ this.expando ]; - - if ( cache === undefined ) { - return; - } - - if ( key !== undefined ) { - - // Support array or space separated string of keys - if ( Array.isArray( key ) ) { - - // If key is an array of keys... - // We always set camelCase keys, so remove that. - key = key.map( camelCase ); - } else { - key = camelCase( key ); - - // If a key with the spaces exists, use it. - // Otherwise, create an array by matching non-whitespace - key = key in cache ? - [ key ] : - ( key.match( rnothtmlwhite ) || [] ); - } - - i = key.length; - - while ( i-- ) { - delete cache[ key[ i ] ]; - } - } - - // Remove the expando if there's no more data - if ( key === undefined || jQuery.isEmptyObject( cache ) ) { - - // Support: Chrome <=35 - 45 - // Webkit & Blink performance suffers when deleting properties - // from DOM nodes, so set to undefined instead - // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) - if ( owner.nodeType ) { - owner[ this.expando ] = undefined; - } else { - delete owner[ this.expando ]; - } - } - }, - hasData: function( owner ) { - var cache = owner[ this.expando ]; - return cache !== undefined && !jQuery.isEmptyObject( cache ); - } -}; -var dataPriv = new Data(); - -var dataUser = new Data(); - - - -// Implementation Summary -// -// 1. Enforce API surface and semantic compatibility with 1.9.x branch -// 2. Improve the module's maintainability by reducing the storage -// paths to a single mechanism. -// 3. Use the same single mechanism to support "private" and "user" data. -// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) -// 5. Avoid exposing implementation details on user objects (eg. expando properties) -// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 - -var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, - rmultiDash = /[A-Z]/g; - -function getData( data ) { - if ( data === "true" ) { - return true; - } - - if ( data === "false" ) { - return false; - } - - if ( data === "null" ) { - return null; - } - - // Only convert to a number if it doesn't change the string - if ( data === +data + "" ) { - return +data; - } - - if ( rbrace.test( data ) ) { - return JSON.parse( data ); - } - - return data; -} - -function dataAttr( elem, key, data ) { - var name; - - // If nothing was found internally, try to fetch any - // data from the HTML5 data-* attribute - if ( data === undefined && elem.nodeType === 1 ) { - name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); - data = elem.getAttribute( name ); - - if ( typeof data === "string" ) { - try { - data = getData( data ); - } catch ( e ) {} - - // Make sure we set the data so it isn't changed later - dataUser.set( elem, key, data ); - } else { - data = undefined; - } - } - return data; -} - -jQuery.extend( { - hasData: function( elem ) { - return dataUser.hasData( elem ) || dataPriv.hasData( elem ); - }, - - data: function( elem, name, data ) { - return dataUser.access( elem, name, data ); - }, - - removeData: function( elem, name ) { - dataUser.remove( elem, name ); - }, - - // TODO: Now that all calls to _data and _removeData have been replaced - // with direct calls to dataPriv methods, these can be deprecated. - _data: function( elem, name, data ) { - return dataPriv.access( elem, name, data ); - }, - - _removeData: function( elem, name ) { - dataPriv.remove( elem, name ); - } -} ); - -jQuery.fn.extend( { - data: function( key, value ) { - var i, name, data, - elem = this[ 0 ], - attrs = elem && elem.attributes; - - // Gets all values - if ( key === undefined ) { - if ( this.length ) { - data = dataUser.get( elem ); - - if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { - i = attrs.length; - while ( i-- ) { - - // Support: IE 11 only - // The attrs elements can be null (#14894) - if ( attrs[ i ] ) { - name = attrs[ i ].name; - if ( name.indexOf( "data-" ) === 0 ) { - name = camelCase( name.slice( 5 ) ); - dataAttr( elem, name, data[ name ] ); - } - } - } - dataPriv.set( elem, "hasDataAttrs", true ); - } - } - - return data; - } - - // Sets multiple values - if ( typeof key === "object" ) { - return this.each( function() { - dataUser.set( this, key ); - } ); - } - - return access( this, function( value ) { - var data; - - // The calling jQuery object (element matches) is not empty - // (and therefore has an element appears at this[ 0 ]) and the - // `value` parameter was not undefined. An empty jQuery object - // will result in `undefined` for elem = this[ 0 ] which will - // throw an exception if an attempt to read a data cache is made. - if ( elem && value === undefined ) { - - // Attempt to get data from the cache - // The key will always be camelCased in Data - data = dataUser.get( elem, key ); - if ( data !== undefined ) { - return data; - } - - // Attempt to "discover" the data in - // HTML5 custom data-* attrs - data = dataAttr( elem, key ); - if ( data !== undefined ) { - return data; - } - - // We tried really hard, but the data doesn't exist. - return; - } - - // Set the data... - this.each( function() { - - // We always store the camelCased key - dataUser.set( this, key, value ); - } ); - }, null, value, arguments.length > 1, null, true ); - }, - - removeData: function( key ) { - return this.each( function() { - dataUser.remove( this, key ); - } ); - } -} ); - - -jQuery.extend( { - queue: function( elem, type, data ) { - var queue; - - if ( elem ) { - type = ( type || "fx" ) + "queue"; - queue = dataPriv.get( elem, type ); - - // Speed up dequeue by getting out quickly if this is just a lookup - if ( data ) { - if ( !queue || Array.isArray( data ) ) { - queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); - } else { - queue.push( data ); - } - } - return queue || []; - } - }, - - dequeue: function( elem, type ) { - type = type || "fx"; - - var queue = jQuery.queue( elem, type ), - startLength = queue.length, - fn = queue.shift(), - hooks = jQuery._queueHooks( elem, type ), - next = function() { - jQuery.dequeue( elem, type ); - }; - - // If the fx queue is dequeued, always remove the progress sentinel - if ( fn === "inprogress" ) { - fn = queue.shift(); - startLength--; - } - - if ( fn ) { - - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if ( type === "fx" ) { - queue.unshift( "inprogress" ); - } - - // Clear up the last queue stop function - delete hooks.stop; - fn.call( elem, next, hooks ); - } - - if ( !startLength && hooks ) { - hooks.empty.fire(); - } - }, - - // Not public - generate a queueHooks object, or return the current one - _queueHooks: function( elem, type ) { - var key = type + "queueHooks"; - return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { - empty: jQuery.Callbacks( "once memory" ).add( function() { - dataPriv.remove( elem, [ type + "queue", key ] ); - } ) - } ); - } -} ); - -jQuery.fn.extend( { - queue: function( type, data ) { - var setter = 2; - - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - setter--; - } - - if ( arguments.length < setter ) { - return jQuery.queue( this[ 0 ], type ); - } - - return data === undefined ? - this : - this.each( function() { - var queue = jQuery.queue( this, type, data ); - - // Ensure a hooks for this queue - jQuery._queueHooks( this, type ); - - if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { - jQuery.dequeue( this, type ); - } - } ); - }, - dequeue: function( type ) { - return this.each( function() { - jQuery.dequeue( this, type ); - } ); - }, - clearQueue: function( type ) { - return this.queue( type || "fx", [] ); - }, - - // Get a promise resolved when queues of a certain type - // are emptied (fx is the type by default) - promise: function( type, obj ) { - var tmp, - count = 1, - defer = jQuery.Deferred(), - elements = this, - i = this.length, - resolve = function() { - if ( !( --count ) ) { - defer.resolveWith( elements, [ elements ] ); - } - }; - - if ( typeof type !== "string" ) { - obj = type; - type = undefined; - } - type = type || "fx"; - - while ( i-- ) { - tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); - if ( tmp && tmp.empty ) { - count++; - tmp.empty.add( resolve ); - } - } - resolve(); - return defer.promise( obj ); - } -} ); -var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; - -var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); - - -var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; - -var documentElement = document.documentElement; - - - - var isAttached = function( elem ) { - return jQuery.contains( elem.ownerDocument, elem ); - }, - composed = { composed: true }; - - // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only - // Check attachment across shadow DOM boundaries when possible (gh-3504) - // Support: iOS 10.0-10.2 only - // Early iOS 10 versions support `attachShadow` but not `getRootNode`, - // leading to errors. We need to check for `getRootNode`. - if ( documentElement.getRootNode ) { - isAttached = function( elem ) { - return jQuery.contains( elem.ownerDocument, elem ) || - elem.getRootNode( composed ) === elem.ownerDocument; - }; - } -var isHiddenWithinTree = function( elem, el ) { - - // isHiddenWithinTree might be called from jQuery#filter function; - // in that case, element will be second argument - elem = el || elem; - - // Inline style trumps all - return elem.style.display === "none" || - elem.style.display === "" && - - // Otherwise, check computed style - // Support: Firefox <=43 - 45 - // Disconnected elements can have computed display: none, so first confirm that elem is - // in the document. - isAttached( elem ) && - - jQuery.css( elem, "display" ) === "none"; - }; - - - -function adjustCSS( elem, prop, valueParts, tween ) { - var adjusted, scale, - maxIterations = 20, - currentValue = tween ? - function() { - return tween.cur(); - } : - function() { - return jQuery.css( elem, prop, "" ); - }, - initial = currentValue(), - unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), - - // Starting value computation is required for potential unit mismatches - initialInUnit = elem.nodeType && - ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && - rcssNum.exec( jQuery.css( elem, prop ) ); - - if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { - - // Support: Firefox <=54 - // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) - initial = initial / 2; - - // Trust units reported by jQuery.css - unit = unit || initialInUnit[ 3 ]; - - // Iteratively approximate from a nonzero starting point - initialInUnit = +initial || 1; - - while ( maxIterations-- ) { - - // Evaluate and update our best guess (doubling guesses that zero out). - // Finish if the scale equals or crosses 1 (making the old*new product non-positive). - jQuery.style( elem, prop, initialInUnit + unit ); - if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) { - maxIterations = 0; - } - initialInUnit = initialInUnit / scale; - - } - - initialInUnit = initialInUnit * 2; - jQuery.style( elem, prop, initialInUnit + unit ); - - // Make sure we update the tween properties later on - valueParts = valueParts || []; - } - - if ( valueParts ) { - initialInUnit = +initialInUnit || +initial || 0; - - // Apply relative offset (+=/-=) if specified - adjusted = valueParts[ 1 ] ? - initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : - +valueParts[ 2 ]; - if ( tween ) { - tween.unit = unit; - tween.start = initialInUnit; - tween.end = adjusted; - } - } - return adjusted; -} - - -var defaultDisplayMap = {}; - -function getDefaultDisplay( elem ) { - var temp, - doc = elem.ownerDocument, - nodeName = elem.nodeName, - display = defaultDisplayMap[ nodeName ]; - - if ( display ) { - return display; - } - - temp = doc.body.appendChild( doc.createElement( nodeName ) ); - display = jQuery.css( temp, "display" ); - - temp.parentNode.removeChild( temp ); - - if ( display === "none" ) { - display = "block"; - } - defaultDisplayMap[ nodeName ] = display; - - return display; -} - -function showHide( elements, show ) { - var display, elem, - values = [], - index = 0, - length = elements.length; - - // Determine new display value for elements that need to change - for ( ; index < length; index++ ) { - elem = elements[ index ]; - if ( !elem.style ) { - continue; - } - - display = elem.style.display; - if ( show ) { - - // Since we force visibility upon cascade-hidden elements, an immediate (and slow) - // check is required in this first loop unless we have a nonempty display value (either - // inline or about-to-be-restored) - if ( display === "none" ) { - values[ index ] = dataPriv.get( elem, "display" ) || null; - if ( !values[ index ] ) { - elem.style.display = ""; - } - } - if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { - values[ index ] = getDefaultDisplay( elem ); - } - } else { - if ( display !== "none" ) { - values[ index ] = "none"; - - // Remember what we're overwriting - dataPriv.set( elem, "display", display ); - } - } - } - - // Set the display of the elements in a second loop to avoid constant reflow - for ( index = 0; index < length; index++ ) { - if ( values[ index ] != null ) { - elements[ index ].style.display = values[ index ]; - } - } - - return elements; -} - -jQuery.fn.extend( { - show: function() { - return showHide( this, true ); - }, - hide: function() { - return showHide( this ); - }, - toggle: function( state ) { - if ( typeof state === "boolean" ) { - return state ? this.show() : this.hide(); - } - - return this.each( function() { - if ( isHiddenWithinTree( this ) ) { - jQuery( this ).show(); - } else { - jQuery( this ).hide(); - } - } ); - } -} ); -var rcheckableType = ( /^(?:checkbox|radio)$/i ); - -var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i ); - -var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); - - - -( function() { - var fragment = document.createDocumentFragment(), - div = fragment.appendChild( document.createElement( "div" ) ), - input = document.createElement( "input" ); - - // Support: Android 4.0 - 4.3 only - // Check state lost if the name is set (#11217) - // Support: Windows Web Apps (WWA) - // `name` and `type` must use .setAttribute for WWA (#14901) - input.setAttribute( "type", "radio" ); - input.setAttribute( "checked", "checked" ); - input.setAttribute( "name", "t" ); - - div.appendChild( input ); - - // Support: Android <=4.1 only - // Older WebKit doesn't clone checked state correctly in fragments - support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; - - // Support: IE <=11 only - // Make sure textarea (and checkbox) defaultValue is properly cloned - div.innerHTML = ""; - support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; - - // Support: IE <=9 only - // IE <=9 replaces "; - support.option = !!div.lastChild; -} )(); - - -// We have to close these tags to support XHTML (#13200) -var wrapMap = { - - // XHTML parsers do not magically insert elements in the - // same way that tag soup parsers do. So we cannot shorten - // this by omitting or other required elements. - thead: [ 1, "", "
" ], - col: [ 2, "", "
" ], - tr: [ 2, "", "
" ], - td: [ 3, "", "
" ], - - _default: [ 0, "", "" ] -}; - -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - -// Support: IE <=9 only -if ( !support.option ) { - wrapMap.optgroup = wrapMap.option = [ 1, "" ]; -} - - -function getAll( context, tag ) { - - // Support: IE <=9 - 11 only - // Use typeof to avoid zero-argument method invocation on host objects (#15151) - var ret; - - if ( typeof context.getElementsByTagName !== "undefined" ) { - ret = context.getElementsByTagName( tag || "*" ); - - } else if ( typeof context.querySelectorAll !== "undefined" ) { - ret = context.querySelectorAll( tag || "*" ); - - } else { - ret = []; - } - - if ( tag === undefined || tag && nodeName( context, tag ) ) { - return jQuery.merge( [ context ], ret ); - } - - return ret; -} - - -// Mark scripts as having already been evaluated -function setGlobalEval( elems, refElements ) { - var i = 0, - l = elems.length; - - for ( ; i < l; i++ ) { - dataPriv.set( - elems[ i ], - "globalEval", - !refElements || dataPriv.get( refElements[ i ], "globalEval" ) - ); - } -} - - -var rhtml = /<|&#?\w+;/; - -function buildFragment( elems, context, scripts, selection, ignored ) { - var elem, tmp, tag, wrap, attached, j, - fragment = context.createDocumentFragment(), - nodes = [], - i = 0, - l = elems.length; - - for ( ; i < l; i++ ) { - elem = elems[ i ]; - - if ( elem || elem === 0 ) { - - // Add nodes directly - if ( toType( elem ) === "object" ) { - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); - - // Convert non-html into a text node - } else if ( !rhtml.test( elem ) ) { - nodes.push( context.createTextNode( elem ) ); - - // Convert html into DOM nodes - } else { - tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); - - // Deserialize a standard representation - tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); - wrap = wrapMap[ tag ] || wrapMap._default; - tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; - - // Descend through wrappers to the right content - j = wrap[ 0 ]; - while ( j-- ) { - tmp = tmp.lastChild; - } - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( nodes, tmp.childNodes ); - - // Remember the top-level container - tmp = fragment.firstChild; - - // Ensure the created nodes are orphaned (#12392) - tmp.textContent = ""; - } - } - } - - // Remove wrapper from fragment - fragment.textContent = ""; - - i = 0; - while ( ( elem = nodes[ i++ ] ) ) { - - // Skip elements already in the context collection (trac-4087) - if ( selection && jQuery.inArray( elem, selection ) > -1 ) { - if ( ignored ) { - ignored.push( elem ); - } - continue; - } - - attached = isAttached( elem ); - - // Append to fragment - tmp = getAll( fragment.appendChild( elem ), "script" ); - - // Preserve script evaluation history - if ( attached ) { - setGlobalEval( tmp ); - } - - // Capture executables - if ( scripts ) { - j = 0; - while ( ( elem = tmp[ j++ ] ) ) { - if ( rscriptType.test( elem.type || "" ) ) { - scripts.push( elem ); - } - } - } - } - - return fragment; -} - - -var rtypenamespace = /^([^.]*)(?:\.(.+)|)/; - -function returnTrue() { - return true; -} - -function returnFalse() { - return false; -} - -// Support: IE <=9 - 11+ -// focus() and blur() are asynchronous, except when they are no-op. -// So expect focus to be synchronous when the element is already active, -// and blur to be synchronous when the element is not already active. -// (focus and blur are always synchronous in other supported browsers, -// this just defines when we can count on it). -function expectSync( elem, type ) { - return ( elem === safeActiveElement() ) === ( type === "focus" ); -} - -// Support: IE <=9 only -// Accessing document.activeElement can throw unexpectedly -// https://bugs.jquery.com/ticket/13393 -function safeActiveElement() { - try { - return document.activeElement; - } catch ( err ) { } -} - -function on( elem, types, selector, data, fn, one ) { - var origFn, type; - - // Types can be a map of types/handlers - if ( typeof types === "object" ) { - - // ( types-Object, selector, data ) - if ( typeof selector !== "string" ) { - - // ( types-Object, data ) - data = data || selector; - selector = undefined; - } - for ( type in types ) { - on( elem, type, selector, data, types[ type ], one ); - } - return elem; - } - - if ( data == null && fn == null ) { - - // ( types, fn ) - fn = selector; - data = selector = undefined; - } else if ( fn == null ) { - if ( typeof selector === "string" ) { - - // ( types, selector, fn ) - fn = data; - data = undefined; - } else { - - // ( types, data, fn ) - fn = data; - data = selector; - selector = undefined; - } - } - if ( fn === false ) { - fn = returnFalse; - } else if ( !fn ) { - return elem; - } - - if ( one === 1 ) { - origFn = fn; - fn = function( event ) { - - // Can use an empty set, since event contains the info - jQuery().off( event ); - return origFn.apply( this, arguments ); - }; - - // Use same guid so caller can remove using origFn - fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); - } - return elem.each( function() { - jQuery.event.add( this, types, fn, data, selector ); - } ); -} - -/* - * Helper functions for managing events -- not part of the public interface. - * Props to Dean Edwards' addEvent library for many of the ideas. - */ -jQuery.event = { - - global: {}, - - add: function( elem, types, handler, data, selector ) { - - var handleObjIn, eventHandle, tmp, - events, t, handleObj, - special, handlers, type, namespaces, origType, - elemData = dataPriv.get( elem ); - - // Only attach events to objects that accept data - if ( !acceptData( elem ) ) { - return; - } - - // Caller can pass in an object of custom data in lieu of the handler - if ( handler.handler ) { - handleObjIn = handler; - handler = handleObjIn.handler; - selector = handleObjIn.selector; - } - - // Ensure that invalid selectors throw exceptions at attach time - // Evaluate against documentElement in case elem is a non-element node (e.g., document) - if ( selector ) { - jQuery.find.matchesSelector( documentElement, selector ); - } - - // Make sure that the handler has a unique ID, used to find/remove it later - if ( !handler.guid ) { - handler.guid = jQuery.guid++; - } - - // Init the element's event structure and main handler, if this is the first - if ( !( events = elemData.events ) ) { - events = elemData.events = Object.create( null ); - } - if ( !( eventHandle = elemData.handle ) ) { - eventHandle = elemData.handle = function( e ) { - - // Discard the second event of a jQuery.event.trigger() and - // when an event is called after a page has unloaded - return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? - jQuery.event.dispatch.apply( elem, arguments ) : undefined; - }; - } - - // Handle multiple events separated by a space - types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[ t ] ) || []; - type = origType = tmp[ 1 ]; - namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); - - // There *must* be a type, no attaching namespace-only handlers - if ( !type ) { - continue; - } - - // If event changes its type, use the special event handlers for the changed type - special = jQuery.event.special[ type ] || {}; - - // If selector defined, determine special event api type, otherwise given type - type = ( selector ? special.delegateType : special.bindType ) || type; - - // Update special based on newly reset type - special = jQuery.event.special[ type ] || {}; - - // handleObj is passed to all event handlers - handleObj = jQuery.extend( { - type: type, - origType: origType, - data: data, - handler: handler, - guid: handler.guid, - selector: selector, - needsContext: selector && jQuery.expr.match.needsContext.test( selector ), - namespace: namespaces.join( "." ) - }, handleObjIn ); - - // Init the event handler queue if we're the first - if ( !( handlers = events[ type ] ) ) { - handlers = events[ type ] = []; - handlers.delegateCount = 0; - - // Only use addEventListener if the special events handler returns false - if ( !special.setup || - special.setup.call( elem, data, namespaces, eventHandle ) === false ) { - - if ( elem.addEventListener ) { - elem.addEventListener( type, eventHandle ); - } - } - } - - if ( special.add ) { - special.add.call( elem, handleObj ); - - if ( !handleObj.handler.guid ) { - handleObj.handler.guid = handler.guid; - } - } - - // Add to the element's handler list, delegates in front - if ( selector ) { - handlers.splice( handlers.delegateCount++, 0, handleObj ); - } else { - handlers.push( handleObj ); - } - - // Keep track of which events have ever been used, for event optimization - jQuery.event.global[ type ] = true; - } - - }, - - // Detach an event or set of events from an element - remove: function( elem, types, handler, selector, mappedTypes ) { - - var j, origCount, tmp, - events, t, handleObj, - special, handlers, type, namespaces, origType, - elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); - - if ( !elemData || !( events = elemData.events ) ) { - return; - } - - // Once for each type.namespace in types; type may be omitted - types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[ t ] ) || []; - type = origType = tmp[ 1 ]; - namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); - - // Unbind all events (on this namespace, if provided) for the element - if ( !type ) { - for ( type in events ) { - jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); - } - continue; - } - - special = jQuery.event.special[ type ] || {}; - type = ( selector ? special.delegateType : special.bindType ) || type; - handlers = events[ type ] || []; - tmp = tmp[ 2 ] && - new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); - - // Remove matching events - origCount = j = handlers.length; - while ( j-- ) { - handleObj = handlers[ j ]; - - if ( ( mappedTypes || origType === handleObj.origType ) && - ( !handler || handler.guid === handleObj.guid ) && - ( !tmp || tmp.test( handleObj.namespace ) ) && - ( !selector || selector === handleObj.selector || - selector === "**" && handleObj.selector ) ) { - handlers.splice( j, 1 ); - - if ( handleObj.selector ) { - handlers.delegateCount--; - } - if ( special.remove ) { - special.remove.call( elem, handleObj ); - } - } - } - - // Remove generic event handler if we removed something and no more handlers exist - // (avoids potential for endless recursion during removal of special event handlers) - if ( origCount && !handlers.length ) { - if ( !special.teardown || - special.teardown.call( elem, namespaces, elemData.handle ) === false ) { - - jQuery.removeEvent( elem, type, elemData.handle ); - } - - delete events[ type ]; - } - } - - // Remove data and the expando if it's no longer used - if ( jQuery.isEmptyObject( events ) ) { - dataPriv.remove( elem, "handle events" ); - } - }, - - dispatch: function( nativeEvent ) { - - var i, j, ret, matched, handleObj, handlerQueue, - args = new Array( arguments.length ), - - // Make a writable jQuery.Event from the native event object - event = jQuery.event.fix( nativeEvent ), - - handlers = ( - dataPriv.get( this, "events" ) || Object.create( null ) - )[ event.type ] || [], - special = jQuery.event.special[ event.type ] || {}; - - // Use the fix-ed jQuery.Event rather than the (read-only) native event - args[ 0 ] = event; - - for ( i = 1; i < arguments.length; i++ ) { - args[ i ] = arguments[ i ]; - } - - event.delegateTarget = this; - - // Call the preDispatch hook for the mapped type, and let it bail if desired - if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { - return; - } - - // Determine handlers - handlerQueue = jQuery.event.handlers.call( this, event, handlers ); - - // Run delegates first; they may want to stop propagation beneath us - i = 0; - while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { - event.currentTarget = matched.elem; - - j = 0; - while ( ( handleObj = matched.handlers[ j++ ] ) && - !event.isImmediatePropagationStopped() ) { - - // If the event is namespaced, then each handler is only invoked if it is - // specially universal or its namespaces are a superset of the event's. - if ( !event.rnamespace || handleObj.namespace === false || - event.rnamespace.test( handleObj.namespace ) ) { - - event.handleObj = handleObj; - event.data = handleObj.data; - - ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || - handleObj.handler ).apply( matched.elem, args ); - - if ( ret !== undefined ) { - if ( ( event.result = ret ) === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - } - } - } - - // Call the postDispatch hook for the mapped type - if ( special.postDispatch ) { - special.postDispatch.call( this, event ); - } - - return event.result; - }, - - handlers: function( event, handlers ) { - var i, handleObj, sel, matchedHandlers, matchedSelectors, - handlerQueue = [], - delegateCount = handlers.delegateCount, - cur = event.target; - - // Find delegate handlers - if ( delegateCount && - - // Support: IE <=9 - // Black-hole SVG instance trees (trac-13180) - cur.nodeType && - - // Support: Firefox <=42 - // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) - // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click - // Support: IE 11 only - // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) - !( event.type === "click" && event.button >= 1 ) ) { - - for ( ; cur !== this; cur = cur.parentNode || this ) { - - // Don't check non-elements (#13208) - // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) - if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { - matchedHandlers = []; - matchedSelectors = {}; - for ( i = 0; i < delegateCount; i++ ) { - handleObj = handlers[ i ]; - - // Don't conflict with Object.prototype properties (#13203) - sel = handleObj.selector + " "; - - if ( matchedSelectors[ sel ] === undefined ) { - matchedSelectors[ sel ] = handleObj.needsContext ? - jQuery( sel, this ).index( cur ) > -1 : - jQuery.find( sel, this, null, [ cur ] ).length; - } - if ( matchedSelectors[ sel ] ) { - matchedHandlers.push( handleObj ); - } - } - if ( matchedHandlers.length ) { - handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); - } - } - } - } - - // Add the remaining (directly-bound) handlers - cur = this; - if ( delegateCount < handlers.length ) { - handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); - } - - return handlerQueue; - }, - - addProp: function( name, hook ) { - Object.defineProperty( jQuery.Event.prototype, name, { - enumerable: true, - configurable: true, - - get: isFunction( hook ) ? - function() { - if ( this.originalEvent ) { - return hook( this.originalEvent ); - } - } : - function() { - if ( this.originalEvent ) { - return this.originalEvent[ name ]; - } - }, - - set: function( value ) { - Object.defineProperty( this, name, { - enumerable: true, - configurable: true, - writable: true, - value: value - } ); - } - } ); - }, - - fix: function( originalEvent ) { - return originalEvent[ jQuery.expando ] ? - originalEvent : - new jQuery.Event( originalEvent ); - }, - - special: { - load: { - - // Prevent triggered image.load events from bubbling to window.load - noBubble: true - }, - click: { - - // Utilize native event to ensure correct state for checkable inputs - setup: function( data ) { - - // For mutual compressibility with _default, replace `this` access with a local var. - // `|| data` is dead code meant only to preserve the variable through minification. - var el = this || data; - - // Claim the first handler - if ( rcheckableType.test( el.type ) && - el.click && nodeName( el, "input" ) ) { - - // dataPriv.set( el, "click", ... ) - leverageNative( el, "click", returnTrue ); - } - - // Return false to allow normal processing in the caller - return false; - }, - trigger: function( data ) { - - // For mutual compressibility with _default, replace `this` access with a local var. - // `|| data` is dead code meant only to preserve the variable through minification. - var el = this || data; - - // Force setup before triggering a click - if ( rcheckableType.test( el.type ) && - el.click && nodeName( el, "input" ) ) { - - leverageNative( el, "click" ); - } - - // Return non-false to allow normal event-path propagation - return true; - }, - - // For cross-browser consistency, suppress native .click() on links - // Also prevent it if we're currently inside a leveraged native-event stack - _default: function( event ) { - var target = event.target; - return rcheckableType.test( target.type ) && - target.click && nodeName( target, "input" ) && - dataPriv.get( target, "click" ) || - nodeName( target, "a" ); - } - }, - - beforeunload: { - postDispatch: function( event ) { - - // Support: Firefox 20+ - // Firefox doesn't alert if the returnValue field is not set. - if ( event.result !== undefined && event.originalEvent ) { - event.originalEvent.returnValue = event.result; - } - } - } - } -}; - -// Ensure the presence of an event listener that handles manually-triggered -// synthetic events by interrupting progress until reinvoked in response to -// *native* events that it fires directly, ensuring that state changes have -// already occurred before other listeners are invoked. -function leverageNative( el, type, expectSync ) { - - // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add - if ( !expectSync ) { - if ( dataPriv.get( el, type ) === undefined ) { - jQuery.event.add( el, type, returnTrue ); - } - return; - } - - // Register the controller as a special universal handler for all event namespaces - dataPriv.set( el, type, false ); - jQuery.event.add( el, type, { - namespace: false, - handler: function( event ) { - var notAsync, result, - saved = dataPriv.get( this, type ); - - if ( ( event.isTrigger & 1 ) && this[ type ] ) { - - // Interrupt processing of the outer synthetic .trigger()ed event - // Saved data should be false in such cases, but might be a leftover capture object - // from an async native handler (gh-4350) - if ( !saved.length ) { - - // Store arguments for use when handling the inner native event - // There will always be at least one argument (an event object), so this array - // will not be confused with a leftover capture object. - saved = slice.call( arguments ); - dataPriv.set( this, type, saved ); - - // Trigger the native event and capture its result - // Support: IE <=9 - 11+ - // focus() and blur() are asynchronous - notAsync = expectSync( this, type ); - this[ type ](); - result = dataPriv.get( this, type ); - if ( saved !== result || notAsync ) { - dataPriv.set( this, type, false ); - } else { - result = {}; - } - if ( saved !== result ) { - - // Cancel the outer synthetic event - event.stopImmediatePropagation(); - event.preventDefault(); - - // Support: Chrome 86+ - // In Chrome, if an element having a focusout handler is blurred by - // clicking outside of it, it invokes the handler synchronously. If - // that handler calls `.remove()` on the element, the data is cleared, - // leaving `result` undefined. We need to guard against this. - return result && result.value; - } - - // If this is an inner synthetic event for an event with a bubbling surrogate - // (focus or blur), assume that the surrogate already propagated from triggering the - // native event and prevent that from happening again here. - // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the - // bubbling surrogate propagates *after* the non-bubbling base), but that seems - // less bad than duplication. - } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) { - event.stopPropagation(); - } - - // If this is a native event triggered above, everything is now in order - // Fire an inner synthetic event with the original arguments - } else if ( saved.length ) { - - // ...and capture the result - dataPriv.set( this, type, { - value: jQuery.event.trigger( - - // Support: IE <=9 - 11+ - // Extend with the prototype to reset the above stopImmediatePropagation() - jQuery.extend( saved[ 0 ], jQuery.Event.prototype ), - saved.slice( 1 ), - this - ) - } ); - - // Abort handling of the native event - event.stopImmediatePropagation(); - } - } - } ); -} - -jQuery.removeEvent = function( elem, type, handle ) { - - // This "if" is needed for plain objects - if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle ); - } -}; - -jQuery.Event = function( src, props ) { - - // Allow instantiation without the 'new' keyword - if ( !( this instanceof jQuery.Event ) ) { - return new jQuery.Event( src, props ); - } - - // Event object - if ( src && src.type ) { - this.originalEvent = src; - this.type = src.type; - - // Events bubbling up the document may have been marked as prevented - // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = src.defaultPrevented || - src.defaultPrevented === undefined && - - // Support: Android <=2.3 only - src.returnValue === false ? - returnTrue : - returnFalse; - - // Create target properties - // Support: Safari <=6 - 7 only - // Target should not be a text node (#504, #13143) - this.target = ( src.target && src.target.nodeType === 3 ) ? - src.target.parentNode : - src.target; - - this.currentTarget = src.currentTarget; - this.relatedTarget = src.relatedTarget; - - // Event type - } else { - this.type = src; - } - - // Put explicitly provided properties onto the event object - if ( props ) { - jQuery.extend( this, props ); - } - - // Create a timestamp if incoming event doesn't have one - this.timeStamp = src && src.timeStamp || Date.now(); - - // Mark it as fixed - this[ jQuery.expando ] = true; -}; - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - constructor: jQuery.Event, - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse, - isSimulated: false, - - preventDefault: function() { - var e = this.originalEvent; - - this.isDefaultPrevented = returnTrue; - - if ( e && !this.isSimulated ) { - e.preventDefault(); - } - }, - stopPropagation: function() { - var e = this.originalEvent; - - this.isPropagationStopped = returnTrue; - - if ( e && !this.isSimulated ) { - e.stopPropagation(); - } - }, - stopImmediatePropagation: function() { - var e = this.originalEvent; - - this.isImmediatePropagationStopped = returnTrue; - - if ( e && !this.isSimulated ) { - e.stopImmediatePropagation(); - } - - this.stopPropagation(); - } -}; - -// Includes all common event props including KeyEvent and MouseEvent specific props -jQuery.each( { - altKey: true, - bubbles: true, - cancelable: true, - changedTouches: true, - ctrlKey: true, - detail: true, - eventPhase: true, - metaKey: true, - pageX: true, - pageY: true, - shiftKey: true, - view: true, - "char": true, - code: true, - charCode: true, - key: true, - keyCode: true, - button: true, - buttons: true, - clientX: true, - clientY: true, - offsetX: true, - offsetY: true, - pointerId: true, - pointerType: true, - screenX: true, - screenY: true, - targetTouches: true, - toElement: true, - touches: true, - which: true -}, jQuery.event.addProp ); - -jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) { - jQuery.event.special[ type ] = { - - // Utilize native event if possible so blur/focus sequence is correct - setup: function() { - - // Claim the first handler - // dataPriv.set( this, "focus", ... ) - // dataPriv.set( this, "blur", ... ) - leverageNative( this, type, expectSync ); - - // Return false to allow normal processing in the caller - return false; - }, - trigger: function() { - - // Force setup before trigger - leverageNative( this, type ); - - // Return non-false to allow normal event-path propagation - return true; - }, - - // Suppress native focus or blur as it's already being fired - // in leverageNative. - _default: function() { - return true; - }, - - delegateType: delegateType - }; -} ); - -// Create mouseenter/leave events using mouseover/out and event-time checks -// so that event delegation works in jQuery. -// Do the same for pointerenter/pointerleave and pointerover/pointerout -// -// Support: Safari 7 only -// Safari sends mouseenter too often; see: -// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 -// for the description of the bug (it existed in older Chrome versions as well). -jQuery.each( { - mouseenter: "mouseover", - mouseleave: "mouseout", - pointerenter: "pointerover", - pointerleave: "pointerout" -}, function( orig, fix ) { - jQuery.event.special[ orig ] = { - delegateType: fix, - bindType: fix, - - handle: function( event ) { - var ret, - target = this, - related = event.relatedTarget, - handleObj = event.handleObj; - - // For mouseenter/leave call the handler if related is outside the target. - // NB: No relatedTarget if the mouse left/entered the browser window - if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { - event.type = handleObj.origType; - ret = handleObj.handler.apply( this, arguments ); - event.type = fix; - } - return ret; - } - }; -} ); - -jQuery.fn.extend( { - - on: function( types, selector, data, fn ) { - return on( this, types, selector, data, fn ); - }, - one: function( types, selector, data, fn ) { - return on( this, types, selector, data, fn, 1 ); - }, - off: function( types, selector, fn ) { - var handleObj, type; - if ( types && types.preventDefault && types.handleObj ) { - - // ( event ) dispatched jQuery.Event - handleObj = types.handleObj; - jQuery( types.delegateTarget ).off( - handleObj.namespace ? - handleObj.origType + "." + handleObj.namespace : - handleObj.origType, - handleObj.selector, - handleObj.handler - ); - return this; - } - if ( typeof types === "object" ) { - - // ( types-object [, selector] ) - for ( type in types ) { - this.off( type, selector, types[ type ] ); - } - return this; - } - if ( selector === false || typeof selector === "function" ) { - - // ( types [, fn] ) - fn = selector; - selector = undefined; - } - if ( fn === false ) { - fn = returnFalse; - } - return this.each( function() { - jQuery.event.remove( this, types, fn, selector ); - } ); - } -} ); - - -var - - // Support: IE <=10 - 11, Edge 12 - 13 only - // In IE/Edge using regex groups here causes severe slowdowns. - // See https://connect.microsoft.com/IE/feedback/details/1736512/ - rnoInnerhtml = /\s*$/g; - -// Prefer a tbody over its parent table for containing new rows -function manipulationTarget( elem, content ) { - if ( nodeName( elem, "table" ) && - nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { - - return jQuery( elem ).children( "tbody" )[ 0 ] || elem; - } - - return elem; -} - -// Replace/restore the type attribute of script elements for safe DOM manipulation -function disableScript( elem ) { - elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; - return elem; -} -function restoreScript( elem ) { - if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) { - elem.type = elem.type.slice( 5 ); - } else { - elem.removeAttribute( "type" ); - } - - return elem; -} - -function cloneCopyEvent( src, dest ) { - var i, l, type, pdataOld, udataOld, udataCur, events; - - if ( dest.nodeType !== 1 ) { - return; - } - - // 1. Copy private data: events, handlers, etc. - if ( dataPriv.hasData( src ) ) { - pdataOld = dataPriv.get( src ); - events = pdataOld.events; - - if ( events ) { - dataPriv.remove( dest, "handle events" ); - - for ( type in events ) { - for ( i = 0, l = events[ type ].length; i < l; i++ ) { - jQuery.event.add( dest, type, events[ type ][ i ] ); - } - } - } - } - - // 2. Copy user data - if ( dataUser.hasData( src ) ) { - udataOld = dataUser.access( src ); - udataCur = jQuery.extend( {}, udataOld ); - - dataUser.set( dest, udataCur ); - } -} - -// Fix IE bugs, see support tests -function fixInput( src, dest ) { - var nodeName = dest.nodeName.toLowerCase(); - - // Fails to persist the checked state of a cloned checkbox or radio button. - if ( nodeName === "input" && rcheckableType.test( src.type ) ) { - dest.checked = src.checked; - - // Fails to return the selected option to the default selected state when cloning options - } else if ( nodeName === "input" || nodeName === "textarea" ) { - dest.defaultValue = src.defaultValue; - } -} - -function domManip( collection, args, callback, ignored ) { - - // Flatten any nested arrays - args = flat( args ); - - var fragment, first, scripts, hasScripts, node, doc, - i = 0, - l = collection.length, - iNoClone = l - 1, - value = args[ 0 ], - valueIsFunction = isFunction( value ); - - // We can't cloneNode fragments that contain checked, in WebKit - if ( valueIsFunction || - ( l > 1 && typeof value === "string" && - !support.checkClone && rchecked.test( value ) ) ) { - return collection.each( function( index ) { - var self = collection.eq( index ); - if ( valueIsFunction ) { - args[ 0 ] = value.call( this, index, self.html() ); - } - domManip( self, args, callback, ignored ); - } ); - } - - if ( l ) { - fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); - first = fragment.firstChild; - - if ( fragment.childNodes.length === 1 ) { - fragment = first; - } - - // Require either new content or an interest in ignored elements to invoke the callback - if ( first || ignored ) { - scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); - hasScripts = scripts.length; - - // Use the original fragment for the last item - // instead of the first because it can end up - // being emptied incorrectly in certain situations (#8070). - for ( ; i < l; i++ ) { - node = fragment; - - if ( i !== iNoClone ) { - node = jQuery.clone( node, true, true ); - - // Keep references to cloned scripts for later restoration - if ( hasScripts ) { - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( scripts, getAll( node, "script" ) ); - } - } - - callback.call( collection[ i ], node, i ); - } - - if ( hasScripts ) { - doc = scripts[ scripts.length - 1 ].ownerDocument; - - // Reenable scripts - jQuery.map( scripts, restoreScript ); - - // Evaluate executable scripts on first document insertion - for ( i = 0; i < hasScripts; i++ ) { - node = scripts[ i ]; - if ( rscriptType.test( node.type || "" ) && - !dataPriv.access( node, "globalEval" ) && - jQuery.contains( doc, node ) ) { - - if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { - - // Optional AJAX dependency, but won't run scripts if not present - if ( jQuery._evalUrl && !node.noModule ) { - jQuery._evalUrl( node.src, { - nonce: node.nonce || node.getAttribute( "nonce" ) - }, doc ); - } - } else { - DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc ); - } - } - } - } - } - } - - return collection; -} - -function remove( elem, selector, keepData ) { - var node, - nodes = selector ? jQuery.filter( selector, elem ) : elem, - i = 0; - - for ( ; ( node = nodes[ i ] ) != null; i++ ) { - if ( !keepData && node.nodeType === 1 ) { - jQuery.cleanData( getAll( node ) ); - } - - if ( node.parentNode ) { - if ( keepData && isAttached( node ) ) { - setGlobalEval( getAll( node, "script" ) ); - } - node.parentNode.removeChild( node ); - } - } - - return elem; -} - -jQuery.extend( { - htmlPrefilter: function( html ) { - return html; - }, - - clone: function( elem, dataAndEvents, deepDataAndEvents ) { - var i, l, srcElements, destElements, - clone = elem.cloneNode( true ), - inPage = isAttached( elem ); - - // Fix IE cloning issues - if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && - !jQuery.isXMLDoc( elem ) ) { - - // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 - destElements = getAll( clone ); - srcElements = getAll( elem ); - - for ( i = 0, l = srcElements.length; i < l; i++ ) { - fixInput( srcElements[ i ], destElements[ i ] ); - } - } - - // Copy the events from the original to the clone - if ( dataAndEvents ) { - if ( deepDataAndEvents ) { - srcElements = srcElements || getAll( elem ); - destElements = destElements || getAll( clone ); - - for ( i = 0, l = srcElements.length; i < l; i++ ) { - cloneCopyEvent( srcElements[ i ], destElements[ i ] ); - } - } else { - cloneCopyEvent( elem, clone ); - } - } - - // Preserve script evaluation history - destElements = getAll( clone, "script" ); - if ( destElements.length > 0 ) { - setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); - } - - // Return the cloned set - return clone; - }, - - cleanData: function( elems ) { - var data, elem, type, - special = jQuery.event.special, - i = 0; - - for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { - if ( acceptData( elem ) ) { - if ( ( data = elem[ dataPriv.expando ] ) ) { - if ( data.events ) { - for ( type in data.events ) { - if ( special[ type ] ) { - jQuery.event.remove( elem, type ); - - // This is a shortcut to avoid jQuery.event.remove's overhead - } else { - jQuery.removeEvent( elem, type, data.handle ); - } - } - } - - // Support: Chrome <=35 - 45+ - // Assign undefined instead of using delete, see Data#remove - elem[ dataPriv.expando ] = undefined; - } - if ( elem[ dataUser.expando ] ) { - - // Support: Chrome <=35 - 45+ - // Assign undefined instead of using delete, see Data#remove - elem[ dataUser.expando ] = undefined; - } - } - } - } -} ); - -jQuery.fn.extend( { - detach: function( selector ) { - return remove( this, selector, true ); - }, - - remove: function( selector ) { - return remove( this, selector ); - }, - - text: function( value ) { - return access( this, function( value ) { - return value === undefined ? - jQuery.text( this ) : - this.empty().each( function() { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - this.textContent = value; - } - } ); - }, null, value, arguments.length ); - }, - - append: function() { - return domManip( this, arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.appendChild( elem ); - } - } ); - }, - - prepend: function() { - return domManip( this, arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.insertBefore( elem, target.firstChild ); - } - } ); - }, - - before: function() { - return domManip( this, arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this ); - } - } ); - }, - - after: function() { - return domManip( this, arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this.nextSibling ); - } - } ); - }, - - empty: function() { - var elem, - i = 0; - - for ( ; ( elem = this[ i ] ) != null; i++ ) { - if ( elem.nodeType === 1 ) { - - // Prevent memory leaks - jQuery.cleanData( getAll( elem, false ) ); - - // Remove any remaining nodes - elem.textContent = ""; - } - } - - return this; - }, - - clone: function( dataAndEvents, deepDataAndEvents ) { - dataAndEvents = dataAndEvents == null ? false : dataAndEvents; - deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; - - return this.map( function() { - return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); - } ); - }, - - html: function( value ) { - return access( this, function( value ) { - var elem = this[ 0 ] || {}, - i = 0, - l = this.length; - - if ( value === undefined && elem.nodeType === 1 ) { - return elem.innerHTML; - } - - // See if we can take a shortcut and just use innerHTML - if ( typeof value === "string" && !rnoInnerhtml.test( value ) && - !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { - - value = jQuery.htmlPrefilter( value ); - - try { - for ( ; i < l; i++ ) { - elem = this[ i ] || {}; - - // Remove element nodes and prevent memory leaks - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - elem.innerHTML = value; - } - } - - elem = 0; - - // If using innerHTML throws an exception, use the fallback method - } catch ( e ) {} - } - - if ( elem ) { - this.empty().append( value ); - } - }, null, value, arguments.length ); - }, - - replaceWith: function() { - var ignored = []; - - // Make the changes, replacing each non-ignored context element with the new content - return domManip( this, arguments, function( elem ) { - var parent = this.parentNode; - - if ( jQuery.inArray( this, ignored ) < 0 ) { - jQuery.cleanData( getAll( this ) ); - if ( parent ) { - parent.replaceChild( elem, this ); - } - } - - // Force callback invocation - }, ignored ); - } -} ); - -jQuery.each( { - appendTo: "append", - prependTo: "prepend", - insertBefore: "before", - insertAfter: "after", - replaceAll: "replaceWith" -}, function( name, original ) { - jQuery.fn[ name ] = function( selector ) { - var elems, - ret = [], - insert = jQuery( selector ), - last = insert.length - 1, - i = 0; - - for ( ; i <= last; i++ ) { - elems = i === last ? this : this.clone( true ); - jQuery( insert[ i ] )[ original ]( elems ); - - // Support: Android <=4.0 only, PhantomJS 1 only - // .get() because push.apply(_, arraylike) throws on ancient WebKit - push.apply( ret, elems.get() ); - } - - return this.pushStack( ret ); - }; -} ); -var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); - -var getStyles = function( elem ) { - - // Support: IE <=11 only, Firefox <=30 (#15098, #14150) - // IE throws on elements created in popups - // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" - var view = elem.ownerDocument.defaultView; - - if ( !view || !view.opener ) { - view = window; - } - - return view.getComputedStyle( elem ); - }; - -var swap = function( elem, options, callback ) { - var ret, name, - old = {}; - - // Remember the old values, and insert the new ones - for ( name in options ) { - old[ name ] = elem.style[ name ]; - elem.style[ name ] = options[ name ]; - } - - ret = callback.call( elem ); - - // Revert the old values - for ( name in options ) { - elem.style[ name ] = old[ name ]; - } - - return ret; -}; - - -var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); - - - -( function() { - - // Executing both pixelPosition & boxSizingReliable tests require only one layout - // so they're executed at the same time to save the second computation. - function computeStyleTests() { - - // This is a singleton, we need to execute it only once - if ( !div ) { - return; - } - - container.style.cssText = "position:absolute;left:-11111px;width:60px;" + - "margin-top:1px;padding:0;border:0"; - div.style.cssText = - "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + - "margin:auto;border:1px;padding:1px;" + - "width:60%;top:1%"; - documentElement.appendChild( container ).appendChild( div ); - - var divStyle = window.getComputedStyle( div ); - pixelPositionVal = divStyle.top !== "1%"; - - // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 - reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12; - - // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3 - // Some styles come back with percentage values, even though they shouldn't - div.style.right = "60%"; - pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36; - - // Support: IE 9 - 11 only - // Detect misreporting of content dimensions for box-sizing:border-box elements - boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36; - - // Support: IE 9 only - // Detect overflow:scroll screwiness (gh-3699) - // Support: Chrome <=64 - // Don't get tricked when zoom affects offsetWidth (gh-4029) - div.style.position = "absolute"; - scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12; - - documentElement.removeChild( container ); - - // Nullify the div so it wouldn't be stored in the memory and - // it will also be a sign that checks already performed - div = null; - } - - function roundPixelMeasures( measure ) { - return Math.round( parseFloat( measure ) ); - } - - var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, - reliableTrDimensionsVal, reliableMarginLeftVal, - container = document.createElement( "div" ), - div = document.createElement( "div" ); - - // Finish early in limited (non-browser) environments - if ( !div.style ) { - return; - } - - // Support: IE <=9 - 11 only - // Style of cloned element affects source element cloned (#8908) - div.style.backgroundClip = "content-box"; - div.cloneNode( true ).style.backgroundClip = ""; - support.clearCloneStyle = div.style.backgroundClip === "content-box"; - - jQuery.extend( support, { - boxSizingReliable: function() { - computeStyleTests(); - return boxSizingReliableVal; - }, - pixelBoxStyles: function() { - computeStyleTests(); - return pixelBoxStylesVal; - }, - pixelPosition: function() { - computeStyleTests(); - return pixelPositionVal; - }, - reliableMarginLeft: function() { - computeStyleTests(); - return reliableMarginLeftVal; - }, - scrollboxSize: function() { - computeStyleTests(); - return scrollboxSizeVal; - }, - - // Support: IE 9 - 11+, Edge 15 - 18+ - // IE/Edge misreport `getComputedStyle` of table rows with width/height - // set in CSS while `offset*` properties report correct values. - // Behavior in IE 9 is more subtle than in newer versions & it passes - // some versions of this test; make sure not to make it pass there! - // - // Support: Firefox 70+ - // Only Firefox includes border widths - // in computed dimensions. (gh-4529) - reliableTrDimensions: function() { - var table, tr, trChild, trStyle; - if ( reliableTrDimensionsVal == null ) { - table = document.createElement( "table" ); - tr = document.createElement( "tr" ); - trChild = document.createElement( "div" ); - - table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate"; - tr.style.cssText = "border:1px solid"; - - // Support: Chrome 86+ - // Height set through cssText does not get applied. - // Computed height then comes back as 0. - tr.style.height = "1px"; - trChild.style.height = "9px"; - - // Support: Android 8 Chrome 86+ - // In our bodyBackground.html iframe, - // display for all div elements is set to "inline", - // which causes a problem only in Android 8 Chrome 86. - // Ensuring the div is display: block - // gets around this issue. - trChild.style.display = "block"; - - documentElement - .appendChild( table ) - .appendChild( tr ) - .appendChild( trChild ); - - trStyle = window.getComputedStyle( tr ); - reliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) + - parseInt( trStyle.borderTopWidth, 10 ) + - parseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight; - - documentElement.removeChild( table ); - } - return reliableTrDimensionsVal; - } - } ); -} )(); - - -function curCSS( elem, name, computed ) { - var width, minWidth, maxWidth, ret, - - // Support: Firefox 51+ - // Retrieving style before computed somehow - // fixes an issue with getting wrong values - // on detached elements - style = elem.style; - - computed = computed || getStyles( elem ); - - // getPropertyValue is needed for: - // .css('filter') (IE 9 only, #12537) - // .css('--customProperty) (#3144) - if ( computed ) { - ret = computed.getPropertyValue( name ) || computed[ name ]; - - if ( ret === "" && !isAttached( elem ) ) { - ret = jQuery.style( elem, name ); - } - - // A tribute to the "awesome hack by Dean Edwards" - // Android Browser returns percentage for some values, - // but width seems to be reliably pixels. - // This is against the CSSOM draft spec: - // https://drafts.csswg.org/cssom/#resolved-values - if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) { - - // Remember the original values - width = style.width; - minWidth = style.minWidth; - maxWidth = style.maxWidth; - - // Put in the new values to get a computed value out - style.minWidth = style.maxWidth = style.width = ret; - ret = computed.width; - - // Revert the changed values - style.width = width; - style.minWidth = minWidth; - style.maxWidth = maxWidth; - } - } - - return ret !== undefined ? - - // Support: IE <=9 - 11 only - // IE returns zIndex value as an integer. - ret + "" : - ret; -} - - -function addGetHookIf( conditionFn, hookFn ) { - - // Define the hook, we'll check on the first run if it's really needed. - return { - get: function() { - if ( conditionFn() ) { - - // Hook not needed (or it's not possible to use it due - // to missing dependency), remove it. - delete this.get; - return; - } - - // Hook needed; redefine it so that the support test is not executed again. - return ( this.get = hookFn ).apply( this, arguments ); - } - }; -} - - -var cssPrefixes = [ "Webkit", "Moz", "ms" ], - emptyStyle = document.createElement( "div" ).style, - vendorProps = {}; - -// Return a vendor-prefixed property or undefined -function vendorPropName( name ) { - - // Check for vendor prefixed names - var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), - i = cssPrefixes.length; - - while ( i-- ) { - name = cssPrefixes[ i ] + capName; - if ( name in emptyStyle ) { - return name; - } - } -} - -// Return a potentially-mapped jQuery.cssProps or vendor prefixed property -function finalPropName( name ) { - var final = jQuery.cssProps[ name ] || vendorProps[ name ]; - - if ( final ) { - return final; - } - if ( name in emptyStyle ) { - return name; - } - return vendorProps[ name ] = vendorPropName( name ) || name; -} - - -var - - // Swappable if display is none or starts with table - // except "table", "table-cell", or "table-caption" - // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display - rdisplayswap = /^(none|table(?!-c[ea]).+)/, - rcustomProp = /^--/, - cssShow = { position: "absolute", visibility: "hidden", display: "block" }, - cssNormalTransform = { - letterSpacing: "0", - fontWeight: "400" - }; - -function setPositiveNumber( _elem, value, subtract ) { - - // Any relative (+/-) values have already been - // normalized at this point - var matches = rcssNum.exec( value ); - return matches ? - - // Guard against undefined "subtract", e.g., when used as in cssHooks - Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : - value; -} - -function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) { - var i = dimension === "width" ? 1 : 0, - extra = 0, - delta = 0; - - // Adjustment may not be necessary - if ( box === ( isBorderBox ? "border" : "content" ) ) { - return 0; - } - - for ( ; i < 4; i += 2 ) { - - // Both box models exclude margin - if ( box === "margin" ) { - delta += jQuery.css( elem, box + cssExpand[ i ], true, styles ); - } - - // If we get here with a content-box, we're seeking "padding" or "border" or "margin" - if ( !isBorderBox ) { - - // Add padding - delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - - // For "border" or "margin", add border - if ( box !== "padding" ) { - delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - - // But still keep track of it otherwise - } else { - extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - - // If we get here with a border-box (content + padding + border), we're seeking "content" or - // "padding" or "margin" - } else { - - // For "content", subtract padding - if ( box === "content" ) { - delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - } - - // For "content" or "padding", subtract border - if ( box !== "margin" ) { - delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - } - } - - // Account for positive content-box scroll gutter when requested by providing computedVal - if ( !isBorderBox && computedVal >= 0 ) { - - // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border - // Assuming integer scroll gutter, subtract the rest and round down - delta += Math.max( 0, Math.ceil( - elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - - computedVal - - delta - - extra - - 0.5 - - // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter - // Use an explicit zero to avoid NaN (gh-3964) - ) ) || 0; - } - - return delta; -} - -function getWidthOrHeight( elem, dimension, extra ) { - - // Start with computed style - var styles = getStyles( elem ), - - // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322). - // Fake content-box until we know it's needed to know the true value. - boxSizingNeeded = !support.boxSizingReliable() || extra, - isBorderBox = boxSizingNeeded && - jQuery.css( elem, "boxSizing", false, styles ) === "border-box", - valueIsBorderBox = isBorderBox, - - val = curCSS( elem, dimension, styles ), - offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ); - - // Support: Firefox <=54 - // Return a confounding non-pixel value or feign ignorance, as appropriate. - if ( rnumnonpx.test( val ) ) { - if ( !extra ) { - return val; - } - val = "auto"; - } - - - // Support: IE 9 - 11 only - // Use offsetWidth/offsetHeight for when box sizing is unreliable. - // In those cases, the computed value can be trusted to be border-box. - if ( ( !support.boxSizingReliable() && isBorderBox || - - // Support: IE 10 - 11+, Edge 15 - 18+ - // IE/Edge misreport `getComputedStyle` of table rows with width/height - // set in CSS while `offset*` properties report correct values. - // Interestingly, in some cases IE 9 doesn't suffer from this issue. - !support.reliableTrDimensions() && nodeName( elem, "tr" ) || - - // Fall back to offsetWidth/offsetHeight when value is "auto" - // This happens for inline elements with no explicit setting (gh-3571) - val === "auto" || - - // Support: Android <=4.1 - 4.3 only - // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) - !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) && - - // Make sure the element is visible & connected - elem.getClientRects().length ) { - - isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; - - // Where available, offsetWidth/offsetHeight approximate border box dimensions. - // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the - // retrieved value as a content box dimension. - valueIsBorderBox = offsetProp in elem; - if ( valueIsBorderBox ) { - val = elem[ offsetProp ]; - } - } - - // Normalize "" and auto - val = parseFloat( val ) || 0; - - // Adjust for the element's box model - return ( val + - boxModelAdjustment( - elem, - dimension, - extra || ( isBorderBox ? "border" : "content" ), - valueIsBorderBox, - styles, - - // Provide the current computed size to request scroll gutter calculation (gh-3589) - val - ) - ) + "px"; -} - -jQuery.extend( { - - // Add in style property hooks for overriding the default - // behavior of getting and setting a style property - cssHooks: { - opacity: { - get: function( elem, computed ) { - if ( computed ) { - - // We should always get a number back from opacity - var ret = curCSS( elem, "opacity" ); - return ret === "" ? "1" : ret; - } - } - } - }, - - // Don't automatically add "px" to these possibly-unitless properties - cssNumber: { - "animationIterationCount": true, - "columnCount": true, - "fillOpacity": true, - "flexGrow": true, - "flexShrink": true, - "fontWeight": true, - "gridArea": true, - "gridColumn": true, - "gridColumnEnd": true, - "gridColumnStart": true, - "gridRow": true, - "gridRowEnd": true, - "gridRowStart": true, - "lineHeight": true, - "opacity": true, - "order": true, - "orphans": true, - "widows": true, - "zIndex": true, - "zoom": true - }, - - // Add in properties whose names you wish to fix before - // setting or getting the value - cssProps: {}, - - // Get and set the style property on a DOM Node - style: function( elem, name, value, extra ) { - - // Don't set styles on text and comment nodes - if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { - return; - } - - // Make sure that we're working with the right name - var ret, type, hooks, - origName = camelCase( name ), - isCustomProp = rcustomProp.test( name ), - style = elem.style; - - // Make sure that we're working with the right name. We don't - // want to query the value if it is a CSS custom property - // since they are user-defined. - if ( !isCustomProp ) { - name = finalPropName( origName ); - } - - // Gets hook for the prefixed version, then unprefixed version - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // Check if we're setting a value - if ( value !== undefined ) { - type = typeof value; - - // Convert "+=" or "-=" to relative numbers (#7345) - if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { - value = adjustCSS( elem, name, ret ); - - // Fixes bug #9237 - type = "number"; - } - - // Make sure that null and NaN values aren't set (#7116) - if ( value == null || value !== value ) { - return; - } - - // If a number was passed in, add the unit (except for certain CSS properties) - // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append - // "px" to a few hardcoded values. - if ( type === "number" && !isCustomProp ) { - value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); - } - - // background-* props affect original clone's values - if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { - style[ name ] = "inherit"; - } - - // If a hook was provided, use that value, otherwise just set the specified value - if ( !hooks || !( "set" in hooks ) || - ( value = hooks.set( elem, value, extra ) ) !== undefined ) { - - if ( isCustomProp ) { - style.setProperty( name, value ); - } else { - style[ name ] = value; - } - } - - } else { - - // If a hook was provided get the non-computed value from there - if ( hooks && "get" in hooks && - ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { - - return ret; - } - - // Otherwise just get the value from the style object - return style[ name ]; - } - }, - - css: function( elem, name, extra, styles ) { - var val, num, hooks, - origName = camelCase( name ), - isCustomProp = rcustomProp.test( name ); - - // Make sure that we're working with the right name. We don't - // want to modify the value if it is a CSS custom property - // since they are user-defined. - if ( !isCustomProp ) { - name = finalPropName( origName ); - } - - // Try prefixed name followed by the unprefixed name - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // If a hook was provided get the computed value from there - if ( hooks && "get" in hooks ) { - val = hooks.get( elem, true, extra ); - } - - // Otherwise, if a way to get the computed value exists, use that - if ( val === undefined ) { - val = curCSS( elem, name, styles ); - } - - // Convert "normal" to computed value - if ( val === "normal" && name in cssNormalTransform ) { - val = cssNormalTransform[ name ]; - } - - // Make numeric if forced or a qualifier was provided and val looks numeric - if ( extra === "" || extra ) { - num = parseFloat( val ); - return extra === true || isFinite( num ) ? num || 0 : val; - } - - return val; - } -} ); - -jQuery.each( [ "height", "width" ], function( _i, dimension ) { - jQuery.cssHooks[ dimension ] = { - get: function( elem, computed, extra ) { - if ( computed ) { - - // Certain elements can have dimension info if we invisibly show them - // but it must have a current display style that would benefit - return rdisplayswap.test( jQuery.css( elem, "display" ) ) && - - // Support: Safari 8+ - // Table columns in Safari have non-zero offsetWidth & zero - // getBoundingClientRect().width unless display is changed. - // Support: IE <=11 only - // Running getBoundingClientRect on a disconnected node - // in IE throws an error. - ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? - swap( elem, cssShow, function() { - return getWidthOrHeight( elem, dimension, extra ); - } ) : - getWidthOrHeight( elem, dimension, extra ); - } - }, - - set: function( elem, value, extra ) { - var matches, - styles = getStyles( elem ), - - // Only read styles.position if the test has a chance to fail - // to avoid forcing a reflow. - scrollboxSizeBuggy = !support.scrollboxSize() && - styles.position === "absolute", - - // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991) - boxSizingNeeded = scrollboxSizeBuggy || extra, - isBorderBox = boxSizingNeeded && - jQuery.css( elem, "boxSizing", false, styles ) === "border-box", - subtract = extra ? - boxModelAdjustment( - elem, - dimension, - extra, - isBorderBox, - styles - ) : - 0; - - // Account for unreliable border-box dimensions by comparing offset* to computed and - // faking a content-box to get border and padding (gh-3699) - if ( isBorderBox && scrollboxSizeBuggy ) { - subtract -= Math.ceil( - elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - - parseFloat( styles[ dimension ] ) - - boxModelAdjustment( elem, dimension, "border", false, styles ) - - 0.5 - ); - } - - // Convert to pixels if value adjustment is needed - if ( subtract && ( matches = rcssNum.exec( value ) ) && - ( matches[ 3 ] || "px" ) !== "px" ) { - - elem.style[ dimension ] = value; - value = jQuery.css( elem, dimension ); - } - - return setPositiveNumber( elem, value, subtract ); - } - }; -} ); - -jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, - function( elem, computed ) { - if ( computed ) { - return ( parseFloat( curCSS( elem, "marginLeft" ) ) || - elem.getBoundingClientRect().left - - swap( elem, { marginLeft: 0 }, function() { - return elem.getBoundingClientRect().left; - } ) - ) + "px"; - } - } -); - -// These hooks are used by animate to expand properties -jQuery.each( { - margin: "", - padding: "", - border: "Width" -}, function( prefix, suffix ) { - jQuery.cssHooks[ prefix + suffix ] = { - expand: function( value ) { - var i = 0, - expanded = {}, - - // Assumes a single number if not a string - parts = typeof value === "string" ? value.split( " " ) : [ value ]; - - for ( ; i < 4; i++ ) { - expanded[ prefix + cssExpand[ i ] + suffix ] = - parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; - } - - return expanded; - } - }; - - if ( prefix !== "margin" ) { - jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; - } -} ); - -jQuery.fn.extend( { - css: function( name, value ) { - return access( this, function( elem, name, value ) { - var styles, len, - map = {}, - i = 0; - - if ( Array.isArray( name ) ) { - styles = getStyles( elem ); - len = name.length; - - for ( ; i < len; i++ ) { - map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); - } - - return map; - } - - return value !== undefined ? - jQuery.style( elem, name, value ) : - jQuery.css( elem, name ); - }, name, value, arguments.length > 1 ); - } -} ); - - -function Tween( elem, options, prop, end, easing ) { - return new Tween.prototype.init( elem, options, prop, end, easing ); -} -jQuery.Tween = Tween; - -Tween.prototype = { - constructor: Tween, - init: function( elem, options, prop, end, easing, unit ) { - this.elem = elem; - this.prop = prop; - this.easing = easing || jQuery.easing._default; - this.options = options; - this.start = this.now = this.cur(); - this.end = end; - this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); - }, - cur: function() { - var hooks = Tween.propHooks[ this.prop ]; - - return hooks && hooks.get ? - hooks.get( this ) : - Tween.propHooks._default.get( this ); - }, - run: function( percent ) { - var eased, - hooks = Tween.propHooks[ this.prop ]; - - if ( this.options.duration ) { - this.pos = eased = jQuery.easing[ this.easing ]( - percent, this.options.duration * percent, 0, 1, this.options.duration - ); - } else { - this.pos = eased = percent; - } - this.now = ( this.end - this.start ) * eased + this.start; - - if ( this.options.step ) { - this.options.step.call( this.elem, this.now, this ); - } - - if ( hooks && hooks.set ) { - hooks.set( this ); - } else { - Tween.propHooks._default.set( this ); - } - return this; - } -}; - -Tween.prototype.init.prototype = Tween.prototype; - -Tween.propHooks = { - _default: { - get: function( tween ) { - var result; - - // Use a property on the element directly when it is not a DOM element, - // or when there is no matching style property that exists. - if ( tween.elem.nodeType !== 1 || - tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { - return tween.elem[ tween.prop ]; - } - - // Passing an empty string as a 3rd parameter to .css will automatically - // attempt a parseFloat and fallback to a string if the parse fails. - // Simple values such as "10px" are parsed to Float; - // complex values such as "rotate(1rad)" are returned as-is. - result = jQuery.css( tween.elem, tween.prop, "" ); - - // Empty strings, null, undefined and "auto" are converted to 0. - return !result || result === "auto" ? 0 : result; - }, - set: function( tween ) { - - // Use step hook for back compat. - // Use cssHook if its there. - // Use .style if available and use plain properties where available. - if ( jQuery.fx.step[ tween.prop ] ) { - jQuery.fx.step[ tween.prop ]( tween ); - } else if ( tween.elem.nodeType === 1 && ( - jQuery.cssHooks[ tween.prop ] || - tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) { - jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); - } else { - tween.elem[ tween.prop ] = tween.now; - } - } - } -}; - -// Support: IE <=9 only -// Panic based approach to setting things on disconnected nodes -Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { - set: function( tween ) { - if ( tween.elem.nodeType && tween.elem.parentNode ) { - tween.elem[ tween.prop ] = tween.now; - } - } -}; - -jQuery.easing = { - linear: function( p ) { - return p; - }, - swing: function( p ) { - return 0.5 - Math.cos( p * Math.PI ) / 2; - }, - _default: "swing" -}; - -jQuery.fx = Tween.prototype.init; - -// Back compat <1.8 extension point -jQuery.fx.step = {}; - - - - -var - fxNow, inProgress, - rfxtypes = /^(?:toggle|show|hide)$/, - rrun = /queueHooks$/; - -function schedule() { - if ( inProgress ) { - if ( document.hidden === false && window.requestAnimationFrame ) { - window.requestAnimationFrame( schedule ); - } else { - window.setTimeout( schedule, jQuery.fx.interval ); - } - - jQuery.fx.tick(); - } -} - -// Animations created synchronously will run synchronously -function createFxNow() { - window.setTimeout( function() { - fxNow = undefined; - } ); - return ( fxNow = Date.now() ); -} - -// Generate parameters to create a standard animation -function genFx( type, includeWidth ) { - var which, - i = 0, - attrs = { height: type }; - - // If we include width, step value is 1 to do all cssExpand values, - // otherwise step value is 2 to skip over Left and Right - includeWidth = includeWidth ? 1 : 0; - for ( ; i < 4; i += 2 - includeWidth ) { - which = cssExpand[ i ]; - attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; - } - - if ( includeWidth ) { - attrs.opacity = attrs.width = type; - } - - return attrs; -} - -function createTween( value, prop, animation ) { - var tween, - collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), - index = 0, - length = collection.length; - for ( ; index < length; index++ ) { - if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { - - // We're done with this property - return tween; - } - } -} - -function defaultPrefilter( elem, props, opts ) { - var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, - isBox = "width" in props || "height" in props, - anim = this, - orig = {}, - style = elem.style, - hidden = elem.nodeType && isHiddenWithinTree( elem ), - dataShow = dataPriv.get( elem, "fxshow" ); - - // Queue-skipping animations hijack the fx hooks - if ( !opts.queue ) { - hooks = jQuery._queueHooks( elem, "fx" ); - if ( hooks.unqueued == null ) { - hooks.unqueued = 0; - oldfire = hooks.empty.fire; - hooks.empty.fire = function() { - if ( !hooks.unqueued ) { - oldfire(); - } - }; - } - hooks.unqueued++; - - anim.always( function() { - - // Ensure the complete handler is called before this completes - anim.always( function() { - hooks.unqueued--; - if ( !jQuery.queue( elem, "fx" ).length ) { - hooks.empty.fire(); - } - } ); - } ); - } - - // Detect show/hide animations - for ( prop in props ) { - value = props[ prop ]; - if ( rfxtypes.test( value ) ) { - delete props[ prop ]; - toggle = toggle || value === "toggle"; - if ( value === ( hidden ? "hide" : "show" ) ) { - - // Pretend to be hidden if this is a "show" and - // there is still data from a stopped show/hide - if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { - hidden = true; - - // Ignore all other no-op show/hide data - } else { - continue; - } - } - orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); - } - } - - // Bail out if this is a no-op like .hide().hide() - propTween = !jQuery.isEmptyObject( props ); - if ( !propTween && jQuery.isEmptyObject( orig ) ) { - return; - } - - // Restrict "overflow" and "display" styles during box animations - if ( isBox && elem.nodeType === 1 ) { - - // Support: IE <=9 - 11, Edge 12 - 15 - // Record all 3 overflow attributes because IE does not infer the shorthand - // from identically-valued overflowX and overflowY and Edge just mirrors - // the overflowX value there. - opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; - - // Identify a display type, preferring old show/hide data over the CSS cascade - restoreDisplay = dataShow && dataShow.display; - if ( restoreDisplay == null ) { - restoreDisplay = dataPriv.get( elem, "display" ); - } - display = jQuery.css( elem, "display" ); - if ( display === "none" ) { - if ( restoreDisplay ) { - display = restoreDisplay; - } else { - - // Get nonempty value(s) by temporarily forcing visibility - showHide( [ elem ], true ); - restoreDisplay = elem.style.display || restoreDisplay; - display = jQuery.css( elem, "display" ); - showHide( [ elem ] ); - } - } - - // Animate inline elements as inline-block - if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { - if ( jQuery.css( elem, "float" ) === "none" ) { - - // Restore the original display value at the end of pure show/hide animations - if ( !propTween ) { - anim.done( function() { - style.display = restoreDisplay; - } ); - if ( restoreDisplay == null ) { - display = style.display; - restoreDisplay = display === "none" ? "" : display; - } - } - style.display = "inline-block"; - } - } - } - - if ( opts.overflow ) { - style.overflow = "hidden"; - anim.always( function() { - style.overflow = opts.overflow[ 0 ]; - style.overflowX = opts.overflow[ 1 ]; - style.overflowY = opts.overflow[ 2 ]; - } ); - } - - // Implement show/hide animations - propTween = false; - for ( prop in orig ) { - - // General show/hide setup for this element animation - if ( !propTween ) { - if ( dataShow ) { - if ( "hidden" in dataShow ) { - hidden = dataShow.hidden; - } - } else { - dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); - } - - // Store hidden/visible for toggle so `.stop().toggle()` "reverses" - if ( toggle ) { - dataShow.hidden = !hidden; - } - - // Show elements before animating them - if ( hidden ) { - showHide( [ elem ], true ); - } - - /* eslint-disable no-loop-func */ - - anim.done( function() { - - /* eslint-enable no-loop-func */ - - // The final step of a "hide" animation is actually hiding the element - if ( !hidden ) { - showHide( [ elem ] ); - } - dataPriv.remove( elem, "fxshow" ); - for ( prop in orig ) { - jQuery.style( elem, prop, orig[ prop ] ); - } - } ); - } - - // Per-property setup - propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); - if ( !( prop in dataShow ) ) { - dataShow[ prop ] = propTween.start; - if ( hidden ) { - propTween.end = propTween.start; - propTween.start = 0; - } - } - } -} - -function propFilter( props, specialEasing ) { - var index, name, easing, value, hooks; - - // camelCase, specialEasing and expand cssHook pass - for ( index in props ) { - name = camelCase( index ); - easing = specialEasing[ name ]; - value = props[ index ]; - if ( Array.isArray( value ) ) { - easing = value[ 1 ]; - value = props[ index ] = value[ 0 ]; - } - - if ( index !== name ) { - props[ name ] = value; - delete props[ index ]; - } - - hooks = jQuery.cssHooks[ name ]; - if ( hooks && "expand" in hooks ) { - value = hooks.expand( value ); - delete props[ name ]; - - // Not quite $.extend, this won't overwrite existing keys. - // Reusing 'index' because we have the correct "name" - for ( index in value ) { - if ( !( index in props ) ) { - props[ index ] = value[ index ]; - specialEasing[ index ] = easing; - } - } - } else { - specialEasing[ name ] = easing; - } - } -} - -function Animation( elem, properties, options ) { - var result, - stopped, - index = 0, - length = Animation.prefilters.length, - deferred = jQuery.Deferred().always( function() { - - // Don't match elem in the :animated selector - delete tick.elem; - } ), - tick = function() { - if ( stopped ) { - return false; - } - var currentTime = fxNow || createFxNow(), - remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), - - // Support: Android 2.3 only - // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) - temp = remaining / animation.duration || 0, - percent = 1 - temp, - index = 0, - length = animation.tweens.length; - - for ( ; index < length; index++ ) { - animation.tweens[ index ].run( percent ); - } - - deferred.notifyWith( elem, [ animation, percent, remaining ] ); - - // If there's more to do, yield - if ( percent < 1 && length ) { - return remaining; - } - - // If this was an empty animation, synthesize a final progress notification - if ( !length ) { - deferred.notifyWith( elem, [ animation, 1, 0 ] ); - } - - // Resolve the animation and report its conclusion - deferred.resolveWith( elem, [ animation ] ); - return false; - }, - animation = deferred.promise( { - elem: elem, - props: jQuery.extend( {}, properties ), - opts: jQuery.extend( true, { - specialEasing: {}, - easing: jQuery.easing._default - }, options ), - originalProperties: properties, - originalOptions: options, - startTime: fxNow || createFxNow(), - duration: options.duration, - tweens: [], - createTween: function( prop, end ) { - var tween = jQuery.Tween( elem, animation.opts, prop, end, - animation.opts.specialEasing[ prop ] || animation.opts.easing ); - animation.tweens.push( tween ); - return tween; - }, - stop: function( gotoEnd ) { - var index = 0, - - // If we are going to the end, we want to run all the tweens - // otherwise we skip this part - length = gotoEnd ? animation.tweens.length : 0; - if ( stopped ) { - return this; - } - stopped = true; - for ( ; index < length; index++ ) { - animation.tweens[ index ].run( 1 ); - } - - // Resolve when we played the last frame; otherwise, reject - if ( gotoEnd ) { - deferred.notifyWith( elem, [ animation, 1, 0 ] ); - deferred.resolveWith( elem, [ animation, gotoEnd ] ); - } else { - deferred.rejectWith( elem, [ animation, gotoEnd ] ); - } - return this; - } - } ), - props = animation.props; - - propFilter( props, animation.opts.specialEasing ); - - for ( ; index < length; index++ ) { - result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); - if ( result ) { - if ( isFunction( result.stop ) ) { - jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = - result.stop.bind( result ); - } - return result; - } - } - - jQuery.map( props, createTween, animation ); - - if ( isFunction( animation.opts.start ) ) { - animation.opts.start.call( elem, animation ); - } - - // Attach callbacks from options - animation - .progress( animation.opts.progress ) - .done( animation.opts.done, animation.opts.complete ) - .fail( animation.opts.fail ) - .always( animation.opts.always ); - - jQuery.fx.timer( - jQuery.extend( tick, { - elem: elem, - anim: animation, - queue: animation.opts.queue - } ) - ); - - return animation; -} - -jQuery.Animation = jQuery.extend( Animation, { - - tweeners: { - "*": [ function( prop, value ) { - var tween = this.createTween( prop, value ); - adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); - return tween; - } ] - }, - - tweener: function( props, callback ) { - if ( isFunction( props ) ) { - callback = props; - props = [ "*" ]; - } else { - props = props.match( rnothtmlwhite ); - } - - var prop, - index = 0, - length = props.length; - - for ( ; index < length; index++ ) { - prop = props[ index ]; - Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; - Animation.tweeners[ prop ].unshift( callback ); - } - }, - - prefilters: [ defaultPrefilter ], - - prefilter: function( callback, prepend ) { - if ( prepend ) { - Animation.prefilters.unshift( callback ); - } else { - Animation.prefilters.push( callback ); - } - } -} ); - -jQuery.speed = function( speed, easing, fn ) { - var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { - complete: fn || !fn && easing || - isFunction( speed ) && speed, - duration: speed, - easing: fn && easing || easing && !isFunction( easing ) && easing - }; - - // Go to the end state if fx are off - if ( jQuery.fx.off ) { - opt.duration = 0; - - } else { - if ( typeof opt.duration !== "number" ) { - if ( opt.duration in jQuery.fx.speeds ) { - opt.duration = jQuery.fx.speeds[ opt.duration ]; - - } else { - opt.duration = jQuery.fx.speeds._default; - } - } - } - - // Normalize opt.queue - true/undefined/null -> "fx" - if ( opt.queue == null || opt.queue === true ) { - opt.queue = "fx"; - } - - // Queueing - opt.old = opt.complete; - - opt.complete = function() { - if ( isFunction( opt.old ) ) { - opt.old.call( this ); - } - - if ( opt.queue ) { - jQuery.dequeue( this, opt.queue ); - } - }; - - return opt; -}; - -jQuery.fn.extend( { - fadeTo: function( speed, to, easing, callback ) { - - // Show any hidden elements after setting opacity to 0 - return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() - - // Animate to the value specified - .end().animate( { opacity: to }, speed, easing, callback ); - }, - animate: function( prop, speed, easing, callback ) { - var empty = jQuery.isEmptyObject( prop ), - optall = jQuery.speed( speed, easing, callback ), - doAnimation = function() { - - // Operate on a copy of prop so per-property easing won't be lost - var anim = Animation( this, jQuery.extend( {}, prop ), optall ); - - // Empty animations, or finishing resolves immediately - if ( empty || dataPriv.get( this, "finish" ) ) { - anim.stop( true ); - } - }; - - doAnimation.finish = doAnimation; - - return empty || optall.queue === false ? - this.each( doAnimation ) : - this.queue( optall.queue, doAnimation ); - }, - stop: function( type, clearQueue, gotoEnd ) { - var stopQueue = function( hooks ) { - var stop = hooks.stop; - delete hooks.stop; - stop( gotoEnd ); - }; - - if ( typeof type !== "string" ) { - gotoEnd = clearQueue; - clearQueue = type; - type = undefined; - } - if ( clearQueue ) { - this.queue( type || "fx", [] ); - } - - return this.each( function() { - var dequeue = true, - index = type != null && type + "queueHooks", - timers = jQuery.timers, - data = dataPriv.get( this ); - - if ( index ) { - if ( data[ index ] && data[ index ].stop ) { - stopQueue( data[ index ] ); - } - } else { - for ( index in data ) { - if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { - stopQueue( data[ index ] ); - } - } - } - - for ( index = timers.length; index--; ) { - if ( timers[ index ].elem === this && - ( type == null || timers[ index ].queue === type ) ) { - - timers[ index ].anim.stop( gotoEnd ); - dequeue = false; - timers.splice( index, 1 ); - } - } - - // Start the next in the queue if the last step wasn't forced. - // Timers currently will call their complete callbacks, which - // will dequeue but only if they were gotoEnd. - if ( dequeue || !gotoEnd ) { - jQuery.dequeue( this, type ); - } - } ); - }, - finish: function( type ) { - if ( type !== false ) { - type = type || "fx"; - } - return this.each( function() { - var index, - data = dataPriv.get( this ), - queue = data[ type + "queue" ], - hooks = data[ type + "queueHooks" ], - timers = jQuery.timers, - length = queue ? queue.length : 0; - - // Enable finishing flag on private data - data.finish = true; - - // Empty the queue first - jQuery.queue( this, type, [] ); - - if ( hooks && hooks.stop ) { - hooks.stop.call( this, true ); - } - - // Look for any active animations, and finish them - for ( index = timers.length; index--; ) { - if ( timers[ index ].elem === this && timers[ index ].queue === type ) { - timers[ index ].anim.stop( true ); - timers.splice( index, 1 ); - } - } - - // Look for any animations in the old queue and finish them - for ( index = 0; index < length; index++ ) { - if ( queue[ index ] && queue[ index ].finish ) { - queue[ index ].finish.call( this ); - } - } - - // Turn off finishing flag - delete data.finish; - } ); - } -} ); - -jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) { - var cssFn = jQuery.fn[ name ]; - jQuery.fn[ name ] = function( speed, easing, callback ) { - return speed == null || typeof speed === "boolean" ? - cssFn.apply( this, arguments ) : - this.animate( genFx( name, true ), speed, easing, callback ); - }; -} ); - -// Generate shortcuts for custom animations -jQuery.each( { - slideDown: genFx( "show" ), - slideUp: genFx( "hide" ), - slideToggle: genFx( "toggle" ), - fadeIn: { opacity: "show" }, - fadeOut: { opacity: "hide" }, - fadeToggle: { opacity: "toggle" } -}, function( name, props ) { - jQuery.fn[ name ] = function( speed, easing, callback ) { - return this.animate( props, speed, easing, callback ); - }; -} ); - -jQuery.timers = []; -jQuery.fx.tick = function() { - var timer, - i = 0, - timers = jQuery.timers; - - fxNow = Date.now(); - - for ( ; i < timers.length; i++ ) { - timer = timers[ i ]; - - // Run the timer and safely remove it when done (allowing for external removal) - if ( !timer() && timers[ i ] === timer ) { - timers.splice( i--, 1 ); - } - } - - if ( !timers.length ) { - jQuery.fx.stop(); - } - fxNow = undefined; -}; - -jQuery.fx.timer = function( timer ) { - jQuery.timers.push( timer ); - jQuery.fx.start(); -}; - -jQuery.fx.interval = 13; -jQuery.fx.start = function() { - if ( inProgress ) { - return; - } - - inProgress = true; - schedule(); -}; - -jQuery.fx.stop = function() { - inProgress = null; -}; - -jQuery.fx.speeds = { - slow: 600, - fast: 200, - - // Default speed - _default: 400 -}; - - -// Based off of the plugin by Clint Helfers, with permission. -// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ -jQuery.fn.delay = function( time, type ) { - time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; - type = type || "fx"; - - return this.queue( type, function( next, hooks ) { - var timeout = window.setTimeout( next, time ); - hooks.stop = function() { - window.clearTimeout( timeout ); - }; - } ); -}; - - -( function() { - var input = document.createElement( "input" ), - select = document.createElement( "select" ), - opt = select.appendChild( document.createElement( "option" ) ); - - input.type = "checkbox"; - - // Support: Android <=4.3 only - // Default value for a checkbox should be "on" - support.checkOn = input.value !== ""; - - // Support: IE <=11 only - // Must access selectedIndex to make default options select - support.optSelected = opt.selected; - - // Support: IE <=11 only - // An input loses its value after becoming a radio - input = document.createElement( "input" ); - input.value = "t"; - input.type = "radio"; - support.radioValue = input.value === "t"; -} )(); - - -var boolHook, - attrHandle = jQuery.expr.attrHandle; - -jQuery.fn.extend( { - attr: function( name, value ) { - return access( this, jQuery.attr, name, value, arguments.length > 1 ); - }, - - removeAttr: function( name ) { - return this.each( function() { - jQuery.removeAttr( this, name ); - } ); - } -} ); - -jQuery.extend( { - attr: function( elem, name, value ) { - var ret, hooks, - nType = elem.nodeType; - - // Don't get/set attributes on text, comment and attribute nodes - if ( nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - // Fallback to prop when attributes are not supported - if ( typeof elem.getAttribute === "undefined" ) { - return jQuery.prop( elem, name, value ); - } - - // Attribute hooks are determined by the lowercase version - // Grab necessary hook if one is defined - if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { - hooks = jQuery.attrHooks[ name.toLowerCase() ] || - ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); - } - - if ( value !== undefined ) { - if ( value === null ) { - jQuery.removeAttr( elem, name ); - return; - } - - if ( hooks && "set" in hooks && - ( ret = hooks.set( elem, value, name ) ) !== undefined ) { - return ret; - } - - elem.setAttribute( name, value + "" ); - return value; - } - - if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { - return ret; - } - - ret = jQuery.find.attr( elem, name ); - - // Non-existent attributes return null, we normalize to undefined - return ret == null ? undefined : ret; - }, - - attrHooks: { - type: { - set: function( elem, value ) { - if ( !support.radioValue && value === "radio" && - nodeName( elem, "input" ) ) { - var val = elem.value; - elem.setAttribute( "type", value ); - if ( val ) { - elem.value = val; - } - return value; - } - } - } - }, - - removeAttr: function( elem, value ) { - var name, - i = 0, - - // Attribute names can contain non-HTML whitespace characters - // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 - attrNames = value && value.match( rnothtmlwhite ); - - if ( attrNames && elem.nodeType === 1 ) { - while ( ( name = attrNames[ i++ ] ) ) { - elem.removeAttribute( name ); - } - } - } -} ); - -// Hooks for boolean attributes -boolHook = { - set: function( elem, value, name ) { - if ( value === false ) { - - // Remove boolean attributes when set to false - jQuery.removeAttr( elem, name ); - } else { - elem.setAttribute( name, name ); - } - return name; - } -}; - -jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) { - var getter = attrHandle[ name ] || jQuery.find.attr; - - attrHandle[ name ] = function( elem, name, isXML ) { - var ret, handle, - lowercaseName = name.toLowerCase(); - - if ( !isXML ) { - - // Avoid an infinite loop by temporarily removing this function from the getter - handle = attrHandle[ lowercaseName ]; - attrHandle[ lowercaseName ] = ret; - ret = getter( elem, name, isXML ) != null ? - lowercaseName : - null; - attrHandle[ lowercaseName ] = handle; - } - return ret; - }; -} ); - - - - -var rfocusable = /^(?:input|select|textarea|button)$/i, - rclickable = /^(?:a|area)$/i; - -jQuery.fn.extend( { - prop: function( name, value ) { - return access( this, jQuery.prop, name, value, arguments.length > 1 ); - }, - - removeProp: function( name ) { - return this.each( function() { - delete this[ jQuery.propFix[ name ] || name ]; - } ); - } -} ); - -jQuery.extend( { - prop: function( elem, name, value ) { - var ret, hooks, - nType = elem.nodeType; - - // Don't get/set properties on text, comment and attribute nodes - if ( nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { - - // Fix name and attach hooks - name = jQuery.propFix[ name ] || name; - hooks = jQuery.propHooks[ name ]; - } - - if ( value !== undefined ) { - if ( hooks && "set" in hooks && - ( ret = hooks.set( elem, value, name ) ) !== undefined ) { - return ret; - } - - return ( elem[ name ] = value ); - } - - if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { - return ret; - } - - return elem[ name ]; - }, - - propHooks: { - tabIndex: { - get: function( elem ) { - - // Support: IE <=9 - 11 only - // elem.tabIndex doesn't always return the - // correct value when it hasn't been explicitly set - // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ - // Use proper attribute retrieval(#12072) - var tabindex = jQuery.find.attr( elem, "tabindex" ); - - if ( tabindex ) { - return parseInt( tabindex, 10 ); - } - - if ( - rfocusable.test( elem.nodeName ) || - rclickable.test( elem.nodeName ) && - elem.href - ) { - return 0; - } - - return -1; - } - } - }, - - propFix: { - "for": "htmlFor", - "class": "className" - } -} ); - -// Support: IE <=11 only -// Accessing the selectedIndex property -// forces the browser to respect setting selected -// on the option -// The getter ensures a default option is selected -// when in an optgroup -// eslint rule "no-unused-expressions" is disabled for this code -// since it considers such accessions noop -if ( !support.optSelected ) { - jQuery.propHooks.selected = { - get: function( elem ) { - - /* eslint no-unused-expressions: "off" */ - - var parent = elem.parentNode; - if ( parent && parent.parentNode ) { - parent.parentNode.selectedIndex; - } - return null; - }, - set: function( elem ) { - - /* eslint no-unused-expressions: "off" */ - - var parent = elem.parentNode; - if ( parent ) { - parent.selectedIndex; - - if ( parent.parentNode ) { - parent.parentNode.selectedIndex; - } - } - } - }; -} - -jQuery.each( [ - "tabIndex", - "readOnly", - "maxLength", - "cellSpacing", - "cellPadding", - "rowSpan", - "colSpan", - "useMap", - "frameBorder", - "contentEditable" -], function() { - jQuery.propFix[ this.toLowerCase() ] = this; -} ); - - - - - // Strip and collapse whitespace according to HTML spec - // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace - function stripAndCollapse( value ) { - var tokens = value.match( rnothtmlwhite ) || []; - return tokens.join( " " ); - } - - -function getClass( elem ) { - return elem.getAttribute && elem.getAttribute( "class" ) || ""; -} - -function classesToArray( value ) { - if ( Array.isArray( value ) ) { - return value; - } - if ( typeof value === "string" ) { - return value.match( rnothtmlwhite ) || []; - } - return []; -} - -jQuery.fn.extend( { - addClass: function( value ) { - var classes, elem, cur, curValue, clazz, j, finalValue, - i = 0; - - if ( isFunction( value ) ) { - return this.each( function( j ) { - jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); - } ); - } - - classes = classesToArray( value ); - - if ( classes.length ) { - while ( ( elem = this[ i++ ] ) ) { - curValue = getClass( elem ); - cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); - - if ( cur ) { - j = 0; - while ( ( clazz = classes[ j++ ] ) ) { - if ( cur.indexOf( " " + clazz + " " ) < 0 ) { - cur += clazz + " "; - } - } - - // Only assign if different to avoid unneeded rendering. - finalValue = stripAndCollapse( cur ); - if ( curValue !== finalValue ) { - elem.setAttribute( "class", finalValue ); - } - } - } - } - - return this; - }, - - removeClass: function( value ) { - var classes, elem, cur, curValue, clazz, j, finalValue, - i = 0; - - if ( isFunction( value ) ) { - return this.each( function( j ) { - jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); - } ); - } - - if ( !arguments.length ) { - return this.attr( "class", "" ); - } - - classes = classesToArray( value ); - - if ( classes.length ) { - while ( ( elem = this[ i++ ] ) ) { - curValue = getClass( elem ); - - // This expression is here for better compressibility (see addClass) - cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); - - if ( cur ) { - j = 0; - while ( ( clazz = classes[ j++ ] ) ) { - - // Remove *all* instances - while ( cur.indexOf( " " + clazz + " " ) > -1 ) { - cur = cur.replace( " " + clazz + " ", " " ); - } - } - - // Only assign if different to avoid unneeded rendering. - finalValue = stripAndCollapse( cur ); - if ( curValue !== finalValue ) { - elem.setAttribute( "class", finalValue ); - } - } - } - } - - return this; - }, - - toggleClass: function( value, stateVal ) { - var type = typeof value, - isValidValue = type === "string" || Array.isArray( value ); - - if ( typeof stateVal === "boolean" && isValidValue ) { - return stateVal ? this.addClass( value ) : this.removeClass( value ); - } - - if ( isFunction( value ) ) { - return this.each( function( i ) { - jQuery( this ).toggleClass( - value.call( this, i, getClass( this ), stateVal ), - stateVal - ); - } ); - } - - return this.each( function() { - var className, i, self, classNames; - - if ( isValidValue ) { - - // Toggle individual class names - i = 0; - self = jQuery( this ); - classNames = classesToArray( value ); - - while ( ( className = classNames[ i++ ] ) ) { - - // Check each className given, space separated list - if ( self.hasClass( className ) ) { - self.removeClass( className ); - } else { - self.addClass( className ); - } - } - - // Toggle whole class name - } else if ( value === undefined || type === "boolean" ) { - className = getClass( this ); - if ( className ) { - - // Store className if set - dataPriv.set( this, "__className__", className ); - } - - // If the element has a class name or if we're passed `false`, - // then remove the whole classname (if there was one, the above saved it). - // Otherwise bring back whatever was previously saved (if anything), - // falling back to the empty string if nothing was stored. - if ( this.setAttribute ) { - this.setAttribute( "class", - className || value === false ? - "" : - dataPriv.get( this, "__className__" ) || "" - ); - } - } - } ); - }, - - hasClass: function( selector ) { - var className, elem, - i = 0; - - className = " " + selector + " "; - while ( ( elem = this[ i++ ] ) ) { - if ( elem.nodeType === 1 && - ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { - return true; - } - } - - return false; - } -} ); - - - - -var rreturn = /\r/g; - -jQuery.fn.extend( { - val: function( value ) { - var hooks, ret, valueIsFunction, - elem = this[ 0 ]; - - if ( !arguments.length ) { - if ( elem ) { - hooks = jQuery.valHooks[ elem.type ] || - jQuery.valHooks[ elem.nodeName.toLowerCase() ]; - - if ( hooks && - "get" in hooks && - ( ret = hooks.get( elem, "value" ) ) !== undefined - ) { - return ret; - } - - ret = elem.value; - - // Handle most common string cases - if ( typeof ret === "string" ) { - return ret.replace( rreturn, "" ); - } - - // Handle cases where value is null/undef or number - return ret == null ? "" : ret; - } - - return; - } - - valueIsFunction = isFunction( value ); - - return this.each( function( i ) { - var val; - - if ( this.nodeType !== 1 ) { - return; - } - - if ( valueIsFunction ) { - val = value.call( this, i, jQuery( this ).val() ); - } else { - val = value; - } - - // Treat null/undefined as ""; convert numbers to string - if ( val == null ) { - val = ""; - - } else if ( typeof val === "number" ) { - val += ""; - - } else if ( Array.isArray( val ) ) { - val = jQuery.map( val, function( value ) { - return value == null ? "" : value + ""; - } ); - } - - hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; - - // If set returns undefined, fall back to normal setting - if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { - this.value = val; - } - } ); - } -} ); - -jQuery.extend( { - valHooks: { - option: { - get: function( elem ) { - - var val = jQuery.find.attr( elem, "value" ); - return val != null ? - val : - - // Support: IE <=10 - 11 only - // option.text throws exceptions (#14686, #14858) - // Strip and collapse whitespace - // https://html.spec.whatwg.org/#strip-and-collapse-whitespace - stripAndCollapse( jQuery.text( elem ) ); - } - }, - select: { - get: function( elem ) { - var value, option, i, - options = elem.options, - index = elem.selectedIndex, - one = elem.type === "select-one", - values = one ? null : [], - max = one ? index + 1 : options.length; - - if ( index < 0 ) { - i = max; - - } else { - i = one ? index : 0; - } - - // Loop through all the selected options - for ( ; i < max; i++ ) { - option = options[ i ]; - - // Support: IE <=9 only - // IE8-9 doesn't update selected after form reset (#2551) - if ( ( option.selected || i === index ) && - - // Don't return options that are disabled or in a disabled optgroup - !option.disabled && - ( !option.parentNode.disabled || - !nodeName( option.parentNode, "optgroup" ) ) ) { - - // Get the specific value for the option - value = jQuery( option ).val(); - - // We don't need an array for one selects - if ( one ) { - return value; - } - - // Multi-Selects return an array - values.push( value ); - } - } - - return values; - }, - - set: function( elem, value ) { - var optionSet, option, - options = elem.options, - values = jQuery.makeArray( value ), - i = options.length; - - while ( i-- ) { - option = options[ i ]; - - /* eslint-disable no-cond-assign */ - - if ( option.selected = - jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 - ) { - optionSet = true; - } - - /* eslint-enable no-cond-assign */ - } - - // Force browsers to behave consistently when non-matching value is set - if ( !optionSet ) { - elem.selectedIndex = -1; - } - return values; - } - } - } -} ); - -// Radios and checkboxes getter/setter -jQuery.each( [ "radio", "checkbox" ], function() { - jQuery.valHooks[ this ] = { - set: function( elem, value ) { - if ( Array.isArray( value ) ) { - return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); - } - } - }; - if ( !support.checkOn ) { - jQuery.valHooks[ this ].get = function( elem ) { - return elem.getAttribute( "value" ) === null ? "on" : elem.value; - }; - } -} ); - - - - -// Return jQuery for attributes-only inclusion - - -support.focusin = "onfocusin" in window; - - -var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, - stopPropagationCallback = function( e ) { - e.stopPropagation(); - }; - -jQuery.extend( jQuery.event, { - - trigger: function( event, data, elem, onlyHandlers ) { - - var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, - eventPath = [ elem || document ], - type = hasOwn.call( event, "type" ) ? event.type : event, - namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; - - cur = lastElement = tmp = elem = elem || document; - - // Don't do events on text and comment nodes - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; - } - - // focus/blur morphs to focusin/out; ensure we're not firing them right now - if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { - return; - } - - if ( type.indexOf( "." ) > -1 ) { - - // Namespaced trigger; create a regexp to match event type in handle() - namespaces = type.split( "." ); - type = namespaces.shift(); - namespaces.sort(); - } - ontype = type.indexOf( ":" ) < 0 && "on" + type; - - // Caller can pass in a jQuery.Event object, Object, or just an event type string - event = event[ jQuery.expando ] ? - event : - new jQuery.Event( type, typeof event === "object" && event ); - - // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) - event.isTrigger = onlyHandlers ? 2 : 3; - event.namespace = namespaces.join( "." ); - event.rnamespace = event.namespace ? - new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : - null; - - // Clean up the event in case it is being reused - event.result = undefined; - if ( !event.target ) { - event.target = elem; - } - - // Clone any incoming data and prepend the event, creating the handler arg list - data = data == null ? - [ event ] : - jQuery.makeArray( data, [ event ] ); - - // Allow special events to draw outside the lines - special = jQuery.event.special[ type ] || {}; - if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { - return; - } - - // Determine event propagation path in advance, per W3C events spec (#9951) - // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) - if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) { - - bubbleType = special.delegateType || type; - if ( !rfocusMorph.test( bubbleType + type ) ) { - cur = cur.parentNode; - } - for ( ; cur; cur = cur.parentNode ) { - eventPath.push( cur ); - tmp = cur; - } - - // Only add window if we got to document (e.g., not plain obj or detached DOM) - if ( tmp === ( elem.ownerDocument || document ) ) { - eventPath.push( tmp.defaultView || tmp.parentWindow || window ); - } - } - - // Fire handlers on the event path - i = 0; - while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { - lastElement = cur; - event.type = i > 1 ? - bubbleType : - special.bindType || type; - - // jQuery handler - handle = ( dataPriv.get( cur, "events" ) || Object.create( null ) )[ event.type ] && - dataPriv.get( cur, "handle" ); - if ( handle ) { - handle.apply( cur, data ); - } - - // Native handler - handle = ontype && cur[ ontype ]; - if ( handle && handle.apply && acceptData( cur ) ) { - event.result = handle.apply( cur, data ); - if ( event.result === false ) { - event.preventDefault(); - } - } - } - event.type = type; - - // If nobody prevented the default action, do it now - if ( !onlyHandlers && !event.isDefaultPrevented() ) { - - if ( ( !special._default || - special._default.apply( eventPath.pop(), data ) === false ) && - acceptData( elem ) ) { - - // Call a native DOM method on the target with the same name as the event. - // Don't do default actions on window, that's where global variables be (#6170) - if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) { - - // Don't re-trigger an onFOO event when we call its FOO() method - tmp = elem[ ontype ]; - - if ( tmp ) { - elem[ ontype ] = null; - } - - // Prevent re-triggering of the same event, since we already bubbled it above - jQuery.event.triggered = type; - - if ( event.isPropagationStopped() ) { - lastElement.addEventListener( type, stopPropagationCallback ); - } - - elem[ type ](); - - if ( event.isPropagationStopped() ) { - lastElement.removeEventListener( type, stopPropagationCallback ); - } - - jQuery.event.triggered = undefined; - - if ( tmp ) { - elem[ ontype ] = tmp; - } - } - } - } - - return event.result; - }, - - // Piggyback on a donor event to simulate a different one - // Used only for `focus(in | out)` events - simulate: function( type, elem, event ) { - var e = jQuery.extend( - new jQuery.Event(), - event, - { - type: type, - isSimulated: true - } - ); - - jQuery.event.trigger( e, null, elem ); - } - -} ); - -jQuery.fn.extend( { - - trigger: function( type, data ) { - return this.each( function() { - jQuery.event.trigger( type, data, this ); - } ); - }, - triggerHandler: function( type, data ) { - var elem = this[ 0 ]; - if ( elem ) { - return jQuery.event.trigger( type, data, elem, true ); - } - } -} ); - - -// Support: Firefox <=44 -// Firefox doesn't have focus(in | out) events -// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 -// -// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 -// focus(in | out) events fire after focus & blur events, -// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order -// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 -if ( !support.focusin ) { - jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { - - // Attach a single capturing handler on the document while someone wants focusin/focusout - var handler = function( event ) { - jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); - }; - - jQuery.event.special[ fix ] = { - setup: function() { - - // Handle: regular nodes (via `this.ownerDocument`), window - // (via `this.document`) & document (via `this`). - var doc = this.ownerDocument || this.document || this, - attaches = dataPriv.access( doc, fix ); - - if ( !attaches ) { - doc.addEventListener( orig, handler, true ); - } - dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); - }, - teardown: function() { - var doc = this.ownerDocument || this.document || this, - attaches = dataPriv.access( doc, fix ) - 1; - - if ( !attaches ) { - doc.removeEventListener( orig, handler, true ); - dataPriv.remove( doc, fix ); - - } else { - dataPriv.access( doc, fix, attaches ); - } - } - }; - } ); -} -var location = window.location; - -var nonce = { guid: Date.now() }; - -var rquery = ( /\?/ ); - - - -// Cross-browser xml parsing -jQuery.parseXML = function( data ) { - var xml, parserErrorElem; - if ( !data || typeof data !== "string" ) { - return null; - } - - // Support: IE 9 - 11 only - // IE throws on parseFromString with invalid input. - try { - xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); - } catch ( e ) {} - - parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ]; - if ( !xml || parserErrorElem ) { - jQuery.error( "Invalid XML: " + ( - parserErrorElem ? - jQuery.map( parserErrorElem.childNodes, function( el ) { - return el.textContent; - } ).join( "\n" ) : - data - ) ); - } - return xml; -}; - - -var - rbracket = /\[\]$/, - rCRLF = /\r?\n/g, - rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, - rsubmittable = /^(?:input|select|textarea|keygen)/i; - -function buildParams( prefix, obj, traditional, add ) { - var name; - - if ( Array.isArray( obj ) ) { - - // Serialize array item. - jQuery.each( obj, function( i, v ) { - if ( traditional || rbracket.test( prefix ) ) { - - // Treat each array item as a scalar. - add( prefix, v ); - - } else { - - // Item is non-scalar (array or object), encode its numeric index. - buildParams( - prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", - v, - traditional, - add - ); - } - } ); - - } else if ( !traditional && toType( obj ) === "object" ) { - - // Serialize object item. - for ( name in obj ) { - buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); - } - - } else { - - // Serialize scalar item. - add( prefix, obj ); - } -} - -// Serialize an array of form elements or a set of -// key/values into a query string -jQuery.param = function( a, traditional ) { - var prefix, - s = [], - add = function( key, valueOrFunction ) { - - // If value is a function, invoke it and use its return value - var value = isFunction( valueOrFunction ) ? - valueOrFunction() : - valueOrFunction; - - s[ s.length ] = encodeURIComponent( key ) + "=" + - encodeURIComponent( value == null ? "" : value ); - }; - - if ( a == null ) { - return ""; - } - - // If an array was passed in, assume that it is an array of form elements. - if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { - - // Serialize the form elements - jQuery.each( a, function() { - add( this.name, this.value ); - } ); - - } else { - - // If traditional, encode the "old" way (the way 1.3.2 or older - // did it), otherwise encode params recursively. - for ( prefix in a ) { - buildParams( prefix, a[ prefix ], traditional, add ); - } - } - - // Return the resulting serialization - return s.join( "&" ); -}; - -jQuery.fn.extend( { - serialize: function() { - return jQuery.param( this.serializeArray() ); - }, - serializeArray: function() { - return this.map( function() { - - // Can add propHook for "elements" to filter or add form elements - var elements = jQuery.prop( this, "elements" ); - return elements ? jQuery.makeArray( elements ) : this; - } ).filter( function() { - var type = this.type; - - // Use .is( ":disabled" ) so that fieldset[disabled] works - return this.name && !jQuery( this ).is( ":disabled" ) && - rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && - ( this.checked || !rcheckableType.test( type ) ); - } ).map( function( _i, elem ) { - var val = jQuery( this ).val(); - - if ( val == null ) { - return null; - } - - if ( Array.isArray( val ) ) { - return jQuery.map( val, function( val ) { - return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; - } ); - } - - return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; - } ).get(); - } -} ); - - -var - r20 = /%20/g, - rhash = /#.*$/, - rantiCache = /([?&])_=[^&]*/, - rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, - - // #7653, #8125, #8152: local protocol detection - rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, - rnoContent = /^(?:GET|HEAD)$/, - rprotocol = /^\/\//, - - /* Prefilters - * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) - * 2) These are called: - * - BEFORE asking for a transport - * - AFTER param serialization (s.data is a string if s.processData is true) - * 3) key is the dataType - * 4) the catchall symbol "*" can be used - * 5) execution will start with transport dataType and THEN continue down to "*" if needed - */ - prefilters = {}, - - /* Transports bindings - * 1) key is the dataType - * 2) the catchall symbol "*" can be used - * 3) selection will start with transport dataType and THEN go to "*" if needed - */ - transports = {}, - - // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression - allTypes = "*/".concat( "*" ), - - // Anchor tag for parsing the document origin - originAnchor = document.createElement( "a" ); - -originAnchor.href = location.href; - -// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport -function addToPrefiltersOrTransports( structure ) { - - // dataTypeExpression is optional and defaults to "*" - return function( dataTypeExpression, func ) { - - if ( typeof dataTypeExpression !== "string" ) { - func = dataTypeExpression; - dataTypeExpression = "*"; - } - - var dataType, - i = 0, - dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; - - if ( isFunction( func ) ) { - - // For each dataType in the dataTypeExpression - while ( ( dataType = dataTypes[ i++ ] ) ) { - - // Prepend if requested - if ( dataType[ 0 ] === "+" ) { - dataType = dataType.slice( 1 ) || "*"; - ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); - - // Otherwise append - } else { - ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); - } - } - } - }; -} - -// Base inspection function for prefilters and transports -function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { - - var inspected = {}, - seekingTransport = ( structure === transports ); - - function inspect( dataType ) { - var selected; - inspected[ dataType ] = true; - jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { - var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); - if ( typeof dataTypeOrTransport === "string" && - !seekingTransport && !inspected[ dataTypeOrTransport ] ) { - - options.dataTypes.unshift( dataTypeOrTransport ); - inspect( dataTypeOrTransport ); - return false; - } else if ( seekingTransport ) { - return !( selected = dataTypeOrTransport ); - } - } ); - return selected; - } - - return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); -} - -// A special extend for ajax options -// that takes "flat" options (not to be deep extended) -// Fixes #9887 -function ajaxExtend( target, src ) { - var key, deep, - flatOptions = jQuery.ajaxSettings.flatOptions || {}; - - for ( key in src ) { - if ( src[ key ] !== undefined ) { - ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; - } - } - if ( deep ) { - jQuery.extend( true, target, deep ); - } - - return target; -} - -/* Handles responses to an ajax request: - * - finds the right dataType (mediates between content-type and expected dataType) - * - returns the corresponding response - */ -function ajaxHandleResponses( s, jqXHR, responses ) { - - var ct, type, finalDataType, firstDataType, - contents = s.contents, - dataTypes = s.dataTypes; - - // Remove auto dataType and get content-type in the process - while ( dataTypes[ 0 ] === "*" ) { - dataTypes.shift(); - if ( ct === undefined ) { - ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); - } - } - - // Check if we're dealing with a known content-type - if ( ct ) { - for ( type in contents ) { - if ( contents[ type ] && contents[ type ].test( ct ) ) { - dataTypes.unshift( type ); - break; - } - } - } - - // Check to see if we have a response for the expected dataType - if ( dataTypes[ 0 ] in responses ) { - finalDataType = dataTypes[ 0 ]; - } else { - - // Try convertible dataTypes - for ( type in responses ) { - if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { - finalDataType = type; - break; - } - if ( !firstDataType ) { - firstDataType = type; - } - } - - // Or just use first one - finalDataType = finalDataType || firstDataType; - } - - // If we found a dataType - // We add the dataType to the list if needed - // and return the corresponding response - if ( finalDataType ) { - if ( finalDataType !== dataTypes[ 0 ] ) { - dataTypes.unshift( finalDataType ); - } - return responses[ finalDataType ]; - } -} - -/* Chain conversions given the request and the original response - * Also sets the responseXXX fields on the jqXHR instance - */ -function ajaxConvert( s, response, jqXHR, isSuccess ) { - var conv2, current, conv, tmp, prev, - converters = {}, - - // Work with a copy of dataTypes in case we need to modify it for conversion - dataTypes = s.dataTypes.slice(); - - // Create converters map with lowercased keys - if ( dataTypes[ 1 ] ) { - for ( conv in s.converters ) { - converters[ conv.toLowerCase() ] = s.converters[ conv ]; - } - } - - current = dataTypes.shift(); - - // Convert to each sequential dataType - while ( current ) { - - if ( s.responseFields[ current ] ) { - jqXHR[ s.responseFields[ current ] ] = response; - } - - // Apply the dataFilter if provided - if ( !prev && isSuccess && s.dataFilter ) { - response = s.dataFilter( response, s.dataType ); - } - - prev = current; - current = dataTypes.shift(); - - if ( current ) { - - // There's only work to do if current dataType is non-auto - if ( current === "*" ) { - - current = prev; - - // Convert response if prev dataType is non-auto and differs from current - } else if ( prev !== "*" && prev !== current ) { - - // Seek a direct converter - conv = converters[ prev + " " + current ] || converters[ "* " + current ]; - - // If none found, seek a pair - if ( !conv ) { - for ( conv2 in converters ) { - - // If conv2 outputs current - tmp = conv2.split( " " ); - if ( tmp[ 1 ] === current ) { - - // If prev can be converted to accepted input - conv = converters[ prev + " " + tmp[ 0 ] ] || - converters[ "* " + tmp[ 0 ] ]; - if ( conv ) { - - // Condense equivalence converters - if ( conv === true ) { - conv = converters[ conv2 ]; - - // Otherwise, insert the intermediate dataType - } else if ( converters[ conv2 ] !== true ) { - current = tmp[ 0 ]; - dataTypes.unshift( tmp[ 1 ] ); - } - break; - } - } - } - } - - // Apply converter (if not an equivalence) - if ( conv !== true ) { - - // Unless errors are allowed to bubble, catch and return them - if ( conv && s.throws ) { - response = conv( response ); - } else { - try { - response = conv( response ); - } catch ( e ) { - return { - state: "parsererror", - error: conv ? e : "No conversion from " + prev + " to " + current - }; - } - } - } - } - } - } - - return { state: "success", data: response }; -} - -jQuery.extend( { - - // Counter for holding the number of active queries - active: 0, - - // Last-Modified header cache for next request - lastModified: {}, - etag: {}, - - ajaxSettings: { - url: location.href, - type: "GET", - isLocal: rlocalProtocol.test( location.protocol ), - global: true, - processData: true, - async: true, - contentType: "application/x-www-form-urlencoded; charset=UTF-8", - - /* - timeout: 0, - data: null, - dataType: null, - username: null, - password: null, - cache: null, - throws: false, - traditional: false, - headers: {}, - */ - - accepts: { - "*": allTypes, - text: "text/plain", - html: "text/html", - xml: "application/xml, text/xml", - json: "application/json, text/javascript" - }, - - contents: { - xml: /\bxml\b/, - html: /\bhtml/, - json: /\bjson\b/ - }, - - responseFields: { - xml: "responseXML", - text: "responseText", - json: "responseJSON" - }, - - // Data converters - // Keys separate source (or catchall "*") and destination types with a single space - converters: { - - // Convert anything to text - "* text": String, - - // Text to html (true = no transformation) - "text html": true, - - // Evaluate text as a json expression - "text json": JSON.parse, - - // Parse text as xml - "text xml": jQuery.parseXML - }, - - // For options that shouldn't be deep extended: - // you can add your own custom options here if - // and when you create one that shouldn't be - // deep extended (see ajaxExtend) - flatOptions: { - url: true, - context: true - } - }, - - // Creates a full fledged settings object into target - // with both ajaxSettings and settings fields. - // If target is omitted, writes into ajaxSettings. - ajaxSetup: function( target, settings ) { - return settings ? - - // Building a settings object - ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : - - // Extending ajaxSettings - ajaxExtend( jQuery.ajaxSettings, target ); - }, - - ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), - ajaxTransport: addToPrefiltersOrTransports( transports ), - - // Main method - ajax: function( url, options ) { - - // If url is an object, simulate pre-1.5 signature - if ( typeof url === "object" ) { - options = url; - url = undefined; - } - - // Force options to be an object - options = options || {}; - - var transport, - - // URL without anti-cache param - cacheURL, - - // Response headers - responseHeadersString, - responseHeaders, - - // timeout handle - timeoutTimer, - - // Url cleanup var - urlAnchor, - - // Request state (becomes false upon send and true upon completion) - completed, - - // To know if global events are to be dispatched - fireGlobals, - - // Loop variable - i, - - // uncached part of the url - uncached, - - // Create the final options object - s = jQuery.ajaxSetup( {}, options ), - - // Callbacks context - callbackContext = s.context || s, - - // Context for global events is callbackContext if it is a DOM node or jQuery collection - globalEventContext = s.context && - ( callbackContext.nodeType || callbackContext.jquery ) ? - jQuery( callbackContext ) : - jQuery.event, - - // Deferreds - deferred = jQuery.Deferred(), - completeDeferred = jQuery.Callbacks( "once memory" ), - - // Status-dependent callbacks - statusCode = s.statusCode || {}, - - // Headers (they are sent all at once) - requestHeaders = {}, - requestHeadersNames = {}, - - // Default abort message - strAbort = "canceled", - - // Fake xhr - jqXHR = { - readyState: 0, - - // Builds headers hashtable if needed - getResponseHeader: function( key ) { - var match; - if ( completed ) { - if ( !responseHeaders ) { - responseHeaders = {}; - while ( ( match = rheaders.exec( responseHeadersString ) ) ) { - responseHeaders[ match[ 1 ].toLowerCase() + " " ] = - ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] ) - .concat( match[ 2 ] ); - } - } - match = responseHeaders[ key.toLowerCase() + " " ]; - } - return match == null ? null : match.join( ", " ); - }, - - // Raw string - getAllResponseHeaders: function() { - return completed ? responseHeadersString : null; - }, - - // Caches the header - setRequestHeader: function( name, value ) { - if ( completed == null ) { - name = requestHeadersNames[ name.toLowerCase() ] = - requestHeadersNames[ name.toLowerCase() ] || name; - requestHeaders[ name ] = value; - } - return this; - }, - - // Overrides response content-type header - overrideMimeType: function( type ) { - if ( completed == null ) { - s.mimeType = type; - } - return this; - }, - - // Status-dependent callbacks - statusCode: function( map ) { - var code; - if ( map ) { - if ( completed ) { - - // Execute the appropriate callbacks - jqXHR.always( map[ jqXHR.status ] ); - } else { - - // Lazy-add the new callbacks in a way that preserves old ones - for ( code in map ) { - statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; - } - } - } - return this; - }, - - // Cancel the request - abort: function( statusText ) { - var finalText = statusText || strAbort; - if ( transport ) { - transport.abort( finalText ); - } - done( 0, finalText ); - return this; - } - }; - - // Attach deferreds - deferred.promise( jqXHR ); - - // Add protocol if not provided (prefilters might expect it) - // Handle falsy url in the settings object (#10093: consistency with old signature) - // We also use the url parameter if available - s.url = ( ( url || s.url || location.href ) + "" ) - .replace( rprotocol, location.protocol + "//" ); - - // Alias method option to type as per ticket #12004 - s.type = options.method || options.type || s.method || s.type; - - // Extract dataTypes list - s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; - - // A cross-domain request is in order when the origin doesn't match the current origin. - if ( s.crossDomain == null ) { - urlAnchor = document.createElement( "a" ); - - // Support: IE <=8 - 11, Edge 12 - 15 - // IE throws exception on accessing the href property if url is malformed, - // e.g. http://example.com:80x/ - try { - urlAnchor.href = s.url; - - // Support: IE <=8 - 11 only - // Anchor's host property isn't correctly set when s.url is relative - urlAnchor.href = urlAnchor.href; - s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== - urlAnchor.protocol + "//" + urlAnchor.host; - } catch ( e ) { - - // If there is an error parsing the URL, assume it is crossDomain, - // it can be rejected by the transport if it is invalid - s.crossDomain = true; - } - } - - // Convert data if not already a string - if ( s.data && s.processData && typeof s.data !== "string" ) { - s.data = jQuery.param( s.data, s.traditional ); - } - - // Apply prefilters - inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); - - // If request was aborted inside a prefilter, stop there - if ( completed ) { - return jqXHR; - } - - // We can fire global events as of now if asked to - // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) - fireGlobals = jQuery.event && s.global; - - // Watch for a new set of requests - if ( fireGlobals && jQuery.active++ === 0 ) { - jQuery.event.trigger( "ajaxStart" ); - } - - // Uppercase the type - s.type = s.type.toUpperCase(); - - // Determine if request has content - s.hasContent = !rnoContent.test( s.type ); - - // Save the URL in case we're toying with the If-Modified-Since - // and/or If-None-Match header later on - // Remove hash to simplify url manipulation - cacheURL = s.url.replace( rhash, "" ); - - // More options handling for requests with no content - if ( !s.hasContent ) { - - // Remember the hash so we can put it back - uncached = s.url.slice( cacheURL.length ); - - // If data is available and should be processed, append data to url - if ( s.data && ( s.processData || typeof s.data === "string" ) ) { - cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; - - // #9682: remove data so that it's not used in an eventual retry - delete s.data; - } - - // Add or update anti-cache param if needed - if ( s.cache === false ) { - cacheURL = cacheURL.replace( rantiCache, "$1" ); - uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) + - uncached; - } - - // Put hash and anti-cache on the URL that will be requested (gh-1732) - s.url = cacheURL + uncached; - - // Change '%20' to '+' if this is encoded form body content (gh-2658) - } else if ( s.data && s.processData && - ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { - s.data = s.data.replace( r20, "+" ); - } - - // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. - if ( s.ifModified ) { - if ( jQuery.lastModified[ cacheURL ] ) { - jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); - } - if ( jQuery.etag[ cacheURL ] ) { - jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); - } - } - - // Set the correct header, if data is being sent - if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { - jqXHR.setRequestHeader( "Content-Type", s.contentType ); - } - - // Set the Accepts header for the server, depending on the dataType - jqXHR.setRequestHeader( - "Accept", - s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? - s.accepts[ s.dataTypes[ 0 ] ] + - ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : - s.accepts[ "*" ] - ); - - // Check for headers option - for ( i in s.headers ) { - jqXHR.setRequestHeader( i, s.headers[ i ] ); - } - - // Allow custom headers/mimetypes and early abort - if ( s.beforeSend && - ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { - - // Abort if not done already and return - return jqXHR.abort(); - } - - // Aborting is no longer a cancellation - strAbort = "abort"; - - // Install callbacks on deferreds - completeDeferred.add( s.complete ); - jqXHR.done( s.success ); - jqXHR.fail( s.error ); - - // Get transport - transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); - - // If no transport, we auto-abort - if ( !transport ) { - done( -1, "No Transport" ); - } else { - jqXHR.readyState = 1; - - // Send global event - if ( fireGlobals ) { - globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); - } - - // If request was aborted inside ajaxSend, stop there - if ( completed ) { - return jqXHR; - } - - // Timeout - if ( s.async && s.timeout > 0 ) { - timeoutTimer = window.setTimeout( function() { - jqXHR.abort( "timeout" ); - }, s.timeout ); - } - - try { - completed = false; - transport.send( requestHeaders, done ); - } catch ( e ) { - - // Rethrow post-completion exceptions - if ( completed ) { - throw e; - } - - // Propagate others as results - done( -1, e ); - } - } - - // Callback for when everything is done - function done( status, nativeStatusText, responses, headers ) { - var isSuccess, success, error, response, modified, - statusText = nativeStatusText; - - // Ignore repeat invocations - if ( completed ) { - return; - } - - completed = true; - - // Clear timeout if it exists - if ( timeoutTimer ) { - window.clearTimeout( timeoutTimer ); - } - - // Dereference transport for early garbage collection - // (no matter how long the jqXHR object will be used) - transport = undefined; - - // Cache response headers - responseHeadersString = headers || ""; - - // Set readyState - jqXHR.readyState = status > 0 ? 4 : 0; - - // Determine if successful - isSuccess = status >= 200 && status < 300 || status === 304; - - // Get response data - if ( responses ) { - response = ajaxHandleResponses( s, jqXHR, responses ); - } - - // Use a noop converter for missing script but not if jsonp - if ( !isSuccess && - jQuery.inArray( "script", s.dataTypes ) > -1 && - jQuery.inArray( "json", s.dataTypes ) < 0 ) { - s.converters[ "text script" ] = function() {}; - } - - // Convert no matter what (that way responseXXX fields are always set) - response = ajaxConvert( s, response, jqXHR, isSuccess ); - - // If successful, handle type chaining - if ( isSuccess ) { - - // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. - if ( s.ifModified ) { - modified = jqXHR.getResponseHeader( "Last-Modified" ); - if ( modified ) { - jQuery.lastModified[ cacheURL ] = modified; - } - modified = jqXHR.getResponseHeader( "etag" ); - if ( modified ) { - jQuery.etag[ cacheURL ] = modified; - } - } - - // if no content - if ( status === 204 || s.type === "HEAD" ) { - statusText = "nocontent"; - - // if not modified - } else if ( status === 304 ) { - statusText = "notmodified"; - - // If we have data, let's convert it - } else { - statusText = response.state; - success = response.data; - error = response.error; - isSuccess = !error; - } - } else { - - // Extract error from statusText and normalize for non-aborts - error = statusText; - if ( status || !statusText ) { - statusText = "error"; - if ( status < 0 ) { - status = 0; - } - } - } - - // Set data for the fake xhr object - jqXHR.status = status; - jqXHR.statusText = ( nativeStatusText || statusText ) + ""; - - // Success/Error - if ( isSuccess ) { - deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); - } else { - deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); - } - - // Status-dependent callbacks - jqXHR.statusCode( statusCode ); - statusCode = undefined; - - if ( fireGlobals ) { - globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", - [ jqXHR, s, isSuccess ? success : error ] ); - } - - // Complete - completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); - - if ( fireGlobals ) { - globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); - - // Handle the global AJAX counter - if ( !( --jQuery.active ) ) { - jQuery.event.trigger( "ajaxStop" ); - } - } - } - - return jqXHR; - }, - - getJSON: function( url, data, callback ) { - return jQuery.get( url, data, callback, "json" ); - }, - - getScript: function( url, callback ) { - return jQuery.get( url, undefined, callback, "script" ); - } -} ); - -jQuery.each( [ "get", "post" ], function( _i, method ) { - jQuery[ method ] = function( url, data, callback, type ) { - - // Shift arguments if data argument was omitted - if ( isFunction( data ) ) { - type = type || callback; - callback = data; - data = undefined; - } - - // The url can be an options object (which then must have .url) - return jQuery.ajax( jQuery.extend( { - url: url, - type: method, - dataType: type, - data: data, - success: callback - }, jQuery.isPlainObject( url ) && url ) ); - }; -} ); - -jQuery.ajaxPrefilter( function( s ) { - var i; - for ( i in s.headers ) { - if ( i.toLowerCase() === "content-type" ) { - s.contentType = s.headers[ i ] || ""; - } - } -} ); - - -jQuery._evalUrl = function( url, options, doc ) { - return jQuery.ajax( { - url: url, - - // Make this explicit, since user can override this through ajaxSetup (#11264) - type: "GET", - dataType: "script", - cache: true, - async: false, - global: false, - - // Only evaluate the response if it is successful (gh-4126) - // dataFilter is not invoked for failure responses, so using it instead - // of the default converter is kludgy but it works. - converters: { - "text script": function() {} - }, - dataFilter: function( response ) { - jQuery.globalEval( response, options, doc ); - } - } ); -}; - - -jQuery.fn.extend( { - wrapAll: function( html ) { - var wrap; - - if ( this[ 0 ] ) { - if ( isFunction( html ) ) { - html = html.call( this[ 0 ] ); - } - - // The elements to wrap the target around - wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); - - if ( this[ 0 ].parentNode ) { - wrap.insertBefore( this[ 0 ] ); - } - - wrap.map( function() { - var elem = this; - - while ( elem.firstElementChild ) { - elem = elem.firstElementChild; - } - - return elem; - } ).append( this ); - } - - return this; - }, - - wrapInner: function( html ) { - if ( isFunction( html ) ) { - return this.each( function( i ) { - jQuery( this ).wrapInner( html.call( this, i ) ); - } ); - } - - return this.each( function() { - var self = jQuery( this ), - contents = self.contents(); - - if ( contents.length ) { - contents.wrapAll( html ); - - } else { - self.append( html ); - } - } ); - }, - - wrap: function( html ) { - var htmlIsFunction = isFunction( html ); - - return this.each( function( i ) { - jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html ); - } ); - }, - - unwrap: function( selector ) { - this.parent( selector ).not( "body" ).each( function() { - jQuery( this ).replaceWith( this.childNodes ); - } ); - return this; - } -} ); - - -jQuery.expr.pseudos.hidden = function( elem ) { - return !jQuery.expr.pseudos.visible( elem ); -}; -jQuery.expr.pseudos.visible = function( elem ) { - return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); -}; - - - - -jQuery.ajaxSettings.xhr = function() { - try { - return new window.XMLHttpRequest(); - } catch ( e ) {} -}; - -var xhrSuccessStatus = { - - // File protocol always yields status code 0, assume 200 - 0: 200, - - // Support: IE <=9 only - // #1450: sometimes IE returns 1223 when it should be 204 - 1223: 204 - }, - xhrSupported = jQuery.ajaxSettings.xhr(); - -support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); -support.ajax = xhrSupported = !!xhrSupported; - -jQuery.ajaxTransport( function( options ) { - var callback, errorCallback; - - // Cross domain only allowed if supported through XMLHttpRequest - if ( support.cors || xhrSupported && !options.crossDomain ) { - return { - send: function( headers, complete ) { - var i, - xhr = options.xhr(); - - xhr.open( - options.type, - options.url, - options.async, - options.username, - options.password - ); - - // Apply custom fields if provided - if ( options.xhrFields ) { - for ( i in options.xhrFields ) { - xhr[ i ] = options.xhrFields[ i ]; - } - } - - // Override mime type if needed - if ( options.mimeType && xhr.overrideMimeType ) { - xhr.overrideMimeType( options.mimeType ); - } - - // X-Requested-With header - // For cross-domain requests, seeing as conditions for a preflight are - // akin to a jigsaw puzzle, we simply never set it to be sure. - // (it can always be set on a per-request basis or even using ajaxSetup) - // For same-domain requests, won't change header if already provided. - if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { - headers[ "X-Requested-With" ] = "XMLHttpRequest"; - } - - // Set headers - for ( i in headers ) { - xhr.setRequestHeader( i, headers[ i ] ); - } - - // Callback - callback = function( type ) { - return function() { - if ( callback ) { - callback = errorCallback = xhr.onload = - xhr.onerror = xhr.onabort = xhr.ontimeout = - xhr.onreadystatechange = null; - - if ( type === "abort" ) { - xhr.abort(); - } else if ( type === "error" ) { - - // Support: IE <=9 only - // On a manual native abort, IE9 throws - // errors on any property access that is not readyState - if ( typeof xhr.status !== "number" ) { - complete( 0, "error" ); - } else { - complete( - - // File: protocol always yields status 0; see #8605, #14207 - xhr.status, - xhr.statusText - ); - } - } else { - complete( - xhrSuccessStatus[ xhr.status ] || xhr.status, - xhr.statusText, - - // Support: IE <=9 only - // IE9 has no XHR2 but throws on binary (trac-11426) - // For XHR2 non-text, let the caller handle it (gh-2498) - ( xhr.responseType || "text" ) !== "text" || - typeof xhr.responseText !== "string" ? - { binary: xhr.response } : - { text: xhr.responseText }, - xhr.getAllResponseHeaders() - ); - } - } - }; - }; - - // Listen to events - xhr.onload = callback(); - errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" ); - - // Support: IE 9 only - // Use onreadystatechange to replace onabort - // to handle uncaught aborts - if ( xhr.onabort !== undefined ) { - xhr.onabort = errorCallback; - } else { - xhr.onreadystatechange = function() { - - // Check readyState before timeout as it changes - if ( xhr.readyState === 4 ) { - - // Allow onerror to be called first, - // but that will not handle a native abort - // Also, save errorCallback to a variable - // as xhr.onerror cannot be accessed - window.setTimeout( function() { - if ( callback ) { - errorCallback(); - } - } ); - } - }; - } - - // Create the abort callback - callback = callback( "abort" ); - - try { - - // Do send the request (this may raise an exception) - xhr.send( options.hasContent && options.data || null ); - } catch ( e ) { - - // #14683: Only rethrow if this hasn't been notified as an error yet - if ( callback ) { - throw e; - } - } - }, - - abort: function() { - if ( callback ) { - callback(); - } - } - }; - } -} ); - - - - -// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) -jQuery.ajaxPrefilter( function( s ) { - if ( s.crossDomain ) { - s.contents.script = false; - } -} ); - -// Install script dataType -jQuery.ajaxSetup( { - accepts: { - script: "text/javascript, application/javascript, " + - "application/ecmascript, application/x-ecmascript" - }, - contents: { - script: /\b(?:java|ecma)script\b/ - }, - converters: { - "text script": function( text ) { - jQuery.globalEval( text ); - return text; - } - } -} ); - -// Handle cache's special case and crossDomain -jQuery.ajaxPrefilter( "script", function( s ) { - if ( s.cache === undefined ) { - s.cache = false; - } - if ( s.crossDomain ) { - s.type = "GET"; - } -} ); - -// Bind script tag hack transport -jQuery.ajaxTransport( "script", function( s ) { - - // This transport only deals with cross domain or forced-by-attrs requests - if ( s.crossDomain || s.scriptAttrs ) { - var script, callback; - return { - send: function( _, complete ) { - script = jQuery( " - - - - - - - - - - - - - - - -
- - -
-
- - - - - - - \ No newline at end of file diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index ed26adfe..00000000 --- a/docs/index.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - YRoots — YRoots documentation - - - - - - - - - - - - - - - - - - - -
-
-
- - -
- -
-

YRoots

-

A fast-working package for finding the roots of multivariate systems of equations.

-
-

How YRoots Works

-

YRoots harnesses the properties of Chebyshev polynomial approximation to quickly and precisely find and -return the roots of various systems of functions.

-

Given a list of smooth, continuous functions and a compact search interval, YRoots generates an accurate -approximation for each function on the interval and recursively uses numerical methods to zero in on any -roots contained in the interval.

-

See this YRoots tutorial -for the needed syntax and set-up as well as examples on how to use the code with different function systems.

-

See this YRoots demo -for a more detailed demonstration of the code's capabilities on solving more challenging problems.

-
-
-

Getting Started with YRoots

-

Getting started with YRoots is quick and simple. To learn how to use the solver, navigate to the -yroots.solve() page for the documentation and examples.

-

Some users may wish to use two special YRoots class objects, MultiCheb and MultiPower, built for faster -function evaluations of Chebyshev-based or power-based polynomials. To learn how to use these, see the -corresponding documentation.

-
-
- - -
- -
-
- -
-
- - - - - - - diff --git a/docs/modules.html b/docs/modules.html deleted file mode 100644 index fad3ee5b..00000000 --- a/docs/modules.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - Modules — YRoots documentation - - - - - - - - - - - - - - - - - - - -
- - -
-
- - - - - - - \ No newline at end of file diff --git a/docs/objects.inv b/docs/objects.inv deleted file mode 100644 index 7322ffc206139bedd94188f33d982dd354e69384..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 435 zcmV;k0ZjfQAX9K?X>NERX>N99Zgg*Qc_4OWa&u{KZXhxWBOp+6Z)#;@bUGkeQg3f` za|$CMR%LQ?X>V>iAPOTORA^-&a%F8{X>Md?av*PJAarPHb0B7EY-J#6b0A}HZE$jB zb8}^6Aa!$TZf78RY-wUH3V7OulRa<4AQ*&qeg#rHw1X{m%~o~l5GiV=P8G&9Mgm@B za2o!7v5on#tz@!&+#NiCT@PSQ{n4?;nT}oGweI1@C9%-g)T>EgSi8gTps3}b@EhLG zbXJO|XIvo{nn5;PvG(T-;>!BkjE{9w@C3`cLW6J$BqyRi4#M(r;<14WVvLVR@nP}= zf2`j`CpBevxv;VAp#_Sod*C?COVXyH60YdkVlM^LF1@^>#GBffLb?)?R(K~KEU5+ifHy1Sub3(@>EF;AQO$y4u9uS|L d?fkD+fEz}7+Lggsn=|Km{6sDc{R0&ifIlZr$~^!8 diff --git a/docs/py-modindex.html b/docs/py-modindex.html deleted file mode 100644 index 1199065b..00000000 --- a/docs/py-modindex.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - Python Module Index — YRoots documentation - - - - - - - - - - - - - - - - - - - - - -
-
-
- - -
- - -

Python Module Index

- -
- y -
- - - - - - - - - - -
 
- y
- yroots -
    - yroots.ChebyshevSubdivisionSolver -
- - -
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/search.html b/docs/search.html deleted file mode 100644 index 8215af35..00000000 --- a/docs/search.html +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - Search — YRoots documentation - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
- - -
- -

Search

- - - - -

- Searching for multiple words only shows matches that contain - all words. -

- - -
- - - -
- - - -
- -
- - -
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/searchindex.js b/docs/searchindex.js deleted file mode 100644 index 85edaf5a..00000000 --- a/docs/searchindex.js +++ /dev/null @@ -1 +0,0 @@ -Search.setIndex({"docnames": ["ChebyshevApproximator", "CombinedSolver", "MultiCheb", "MultiPower", "index", "modules"], "filenames": ["ChebyshevApproximator.rst", "CombinedSolver.rst", "MultiCheb.rst", "MultiPower.rst", "index.rst", "modules.rst"], "titles": ["yroots.approximate", "yroots.solve()", "MultiCheb", "MultiPower", "YRoots", "Modules"], "terms": {"chebyshevsubdivisionsolv": [], "boundingintervallinearsystem": [], "ms": [], "error": [0, 1], "finalstep": [], "linear": [], "fals": 1, "find": [1, 4], "smaller": [], "region": [], "which": [0, 1], "ani": [1, 4], "root": [1, 4], "must": [], "paramet": [0, 1, 2, 3], "list": [0, 1, 2, 3, 4], "numpi": [0, 1, 2, 3], "arrai": [0, 1, 2, 3], "The": [0, 1], "coeffici": [0, 2, 3], "tensor": [2, 3], "each": [0, 1, 4], "chebyshev": [0, 1, 2, 4], "polynomi": [0, 1, 2, 3, 4], "maximum": 0, "approxim": [1, 2, 3, 4, 5], "bool": [1, 2, 3], "whether": [1, 2, 3], "algorithm": [], "final": 0, "step": [], "zoom": [], "point": 1, "assum": [], "zero": [0, 1, 2, 3, 4], "function": [0, 1, 2, 3, 4], "should": 1, "shrink": 1, "interv": [0, 1, 4], "us": [0, 1, 2, 3, 4], "standard": [], "method": 4, "even": 1, "dim": [], "4": [1, 2, 3], "rather": 1, "than": 1, "halfspac": [], "intersect": [], "return": [0, 1, 4], "newinterv": [], "trackedinterv": [], "where": 1, "chang": [], "ha": 1, "shrunk": [], "suffici": [], "should_stop": [], "continu": [0, 1, 4], "subdivid": 1, "after": 0, "perform": 1, "throwout": [], "thrown": [], "out": [], "entir": [], "doe": [], "contain": [0, 1, 2, 3, 4], "class": [4, 5], "solveropt": [], "set": [], "run": 1, "check": [], "transform": 1, "subdivis": [], "solvepolyrecurs": [], "exact": 1, "default": [0, 1, 2, 3], "transformchebinplacend": [], "minim": 1, "constant_check": [], "true": [2, 3], "constant": [], "term": [2, 3], "low_dim_quadratic_check": [], "quadrat": [], "2": [0, 1, 3], "3": [0, 1, 2, 3], "all_dim_quadratic_check": [], "maxzoomcount": [], "int": [], "number": 1, "allow": [], "befor": [], "prevent": [], "infinit": 1, "infintesim": [], "level": [], "depth": [], "given": [1, 4], "split": [], "x": [0, 1, 2], "y": [0, 1, 2, 3], "exactli": [], "float": [0, 1], "numba": [], "split_nonumba": [], "without": [], "track": 1, "properti": [0, 1, 4], "pass": [], "through": [], "solver": [4, 5], "topinterv": [], "origin": [], "current": [], "lower": [0, 1], "bound": [0, 1], "upper": [0, 1], "dimens": [0, 1, 3], "order": [0, 1], "alpha": [], "beta": [], "valu": 0, "all": [0, 1, 2, 3], "undergon": [], "ndim": [], "consist": [], "empti": [], "known": [], "box": 1, "end": [], "canthrowoutfinalstep": [], "solv": [4, 5], "occur": [], "possibleduplicateroot": [], "multipl": [], "found": 1, "would": [], "have": [0, 2], "been": [], "just": 1, "one": 0, "possibleextraroot": [], "dure": [2, 3], "nexttransformpoint": [], "midpoint": [], "next": [], "addtransform": [], "subinterv": [], "add": [], "updat": [], "being": [], "reduc": [], "canthrowout": [], "ensur": [], "an": [0, 1, 2, 3, 4], "cannot": [], "copi": [], "deep": [], "preserv": [], "dimsiz": [], "get": [0, 1, 5], "length": [], "along": 0, "getfinalinterv": [], "report": [], "calcul": 0, "appli": [], "record": [], "finalinterv": [], "type": [], "getfinalpoint": [], "getintervalforcombin": [], "combin": [], "getlasttransform": [], "last": [], "underw": [], "ispoint": [], "determin": 0, "essenti": [], "0": [0, 1, 2, 3], "overlapswith": [], "otherinterv": [], "overlap": [], "less": [], "other": 1, "everi": [], "otherwis": [], "size": [], "volum": [], "startfinalstep": [], "prepar": [], "save": [], "its": [], "transformchebinplace1d": [], "coeff": [2, 3], "recurs": [0, 1, 4], "column": [2, 3], "matrix": 0, "c": [], "from": 0, "previou": [], "two": 4, "entrywis": [], "entri": [], "thu": [], "enabl": [], "while": [], "onli": [0, 1, 2, 3], "retain": [], "three": [], "memori": [], "time": [0, 1], "doubl": [], "scaler": [], "shift": [], "transformedcoeff": [], "new": [], "follow": [], "transformchebinplace1derrorfre": [], "thi": [2, 3], "ident": [], "except": [], "more": [], "care": [], "call": 1, "precis": [1, 4], "addit": [], "transformchebinplace1derrorfreesplit": [], "betasign": [], "5": [0, 1, 2, 3], "special": 4, "case": [], "comput": [], "when": 1, "1": [0, 1, 2, 3], "singl": 1, "index": [2, 3], "higher": 1, "twoprod": [], "b": [0, 1], "twoprodwithsplit": [], "a1": [], "a2": [], "alreadi": [], "twoprod_nonumba": [], "usin": [], "twosum": [], "twosum_nonumba": [], "chebtransform1d": [], "m": [], "transformdim": [], "particular": 1, "transformed_m": [], "find_vertic": [], "a_ub": [], "b_ub": [], "associ": 0, "feasibl": [], "insid": [], "feed": [], "first": [1, 2], "half": [], "portion": [], "http": [], "doc": [], "scipi": [], "org": [], "refer": [], "gener": [0, 1, 4], "spatial": [], "halfspaceintersect": [], "html": [], "np": [0, 1, 3], "vstack": [], "A": [1, 4], "hstack": [], "err": [], "const": [], "t": [], "reshap": [], "tell": [], "variabl": [], "how": 5, "program": [], "proceed": [], "so": 3, "code": 1, "said": [], "wa": [], "clearli": [], "happen": [], "ar": [0, 1], "tini": [], "kept": [], "ran": [], "fail": [], "instead": [2, 3], "nd": [], "vertic": [], "hyper": [], "polygon": [], "cube": [], "getinverseord": [], "matric": [], "need": [], "getsubdivisioninterv": [], "helper": [], "take": 1, "arrang": [], "result": 1, "had": [], "bee": [], "For": [], "exampl": [0, 1, 2, 3, 4], "were": [], "6": [0, 3], "7": 1, "correspond": 4, "currm": [], "appear": [], "invord": [], "numer": 4, "getlinearterm": [], "fact": [], "locat": [], "shape": [], "look": [], "ravel": [], "getsubdivisiondim": [], "decid": [], "what": 0, "alldim": [], "ith": [], "row": [2, 3], "give": [], "i": [2, 3], "iter": [], "complet": [], "allm": [], "allerror": [], "allinterv": [], "gettransformpoint": [], "gettransformationerror": [], "In": [], "element": [], "involv": [], "n": [0, 2, 3], "equal": [], "degre": [0, 3], "isexteriorinterv": [], "originalinterv": [], "exterior": [], "linearcheck1": [], "totalerr": [], "reduct": [], "mai": [0, 1, 4], "possibl": [], "can": [2, 3], "absolut": 0, "sum": [], "greater": [], "rest": [], "remain": [], "plu": [], "solvechebyshevsubdivis": [], "returnboundingbox": 1, "polish": [], "initi": [], "combinedsolv": [], "max": [], "option": 1, "If": [0, 1, 2, 3], "around": [], "well": [0, 1], "done": [], "system": [1, 4], "boundingbox": 1, "lie": 1, "inform": 1, "about": [], "we": [], "desir": [], "boundingboxesinterior": [], "interior": [], "boundingboxesexterior": [], "transformcheb": [], "xhat": [], "offset": [], "transformchebtointerv": [], "do": [], "newm": [], "newerror": [], "trimm": [], "standardallowederrorincreas": [], "1e": 0, "16": [0, 1], "neglig": [], "trim": [], "place": [], "highest": [], "long": 1, "introduc": [], "increas": [], "largest": [], "zoominonintervalit": [], "One": [], "boundingintervalinearsystem": [], "Then": [], "valid": [0, 1], "significantli": [], "subdivi": [], "modul": 1, "search": [1, 4], "page": 4, "combined_solv": 1, "func": 1, "vector": [], "r": [], "dinens": [], "py": [], "chebyshevapproxim": 0, "chebapproxim": 0, "f": [0, 1, 2, 3], "absapproxtol": 0, "10": 0, "relapproxtol": 0, "wish": 4, "toler": 0, "converg": 0, "rel": 0, "chebyshevblockcopi": [], "expand": [], "evalu": [0, 2, 3, 4], "full": [], "fft": 0, "interpol": [], "getapproxerror": [], "deg": [], "epsilon": [], "rho": [], "includ": [0, 1], "rate": [], "approxerror": [], "unus": [], "getchebyshevdegre": [], "minimum": [], "reliabl": 0, "start": 5, "8": 1, "guess": [], "until": 1, "getfinaldegre": [], "chebdegre": [], "2n": [], "fulli": [], "3n": [], "cutoff": [], "epsval": [], "twice": [], "least": [], "magnitud": [], "geometr": 0, "machin": [], "reach": [], "practic": [], "usual": [], "slowli": [], "decreas": [], "thei": [], "fast": 4, "hasconverg": [], "coeff2": [], "tol": [], "within": 0, "interval_approximate_nd": [], "retsupnorm": [], "dimension": [2, 3], "grid": [], "achiev": [], "sup": [], "norm": [], "supnorm": 0, "startedconverg": [], "coefflist": [], "sequenc": [], "your": [], "process": [], "computation": [], "stabl": [], "equat": [1, 4], "develop": [], "quickli": [0, 4], "packag": 4, "aim": [], "extend": [], "scope": [], "necessarili": [], "also": 1, "problem": [], "It": [], "accomplish": [], "narrow": [], "spectral": [], "home": 5, "yroot": [2, 3, 5], "indic": [], "param": [], "tranform": [], "multi": [], "main": [], "finder": [], "findvertic": [], "high": [], "autofunct": [], "quadraticcheck": [], "multicheb": [0, 1, 4, 5], "multipow": [0, 1, 4, 5], "degrevlex": [], "lead_term": [], "none": [], "clean_zero": [2, 3], "superclass": [], "attribut": [], "applic": [], "both": [], "subclass": [], "repres": [2, 3], "object": [0, 1, 4], "string": [0, 1], "total": [], "lead_coeff": [], "ndarrai": [], "tupl": [], "accept": 1, "like": [], "input": [0, 1], "extra": [2, 3], "etc": [], "remov": [2, 3], "clean_coeff": [], "match_siz": [], "match": [], "monomiallist": [], "creat": [0, 1], "monomi": [], "make": [], "up": [], "monsort": [], "update_lead_term": [], "__call__": [], "certain": [], "__eq__": [], "__ne__": [], "power": [3, 4], "coeffic": [], "grobner": [], "lead": [2, 3], "__add__": [], "__sub__": [], "subtract": [], "mon_mult": [], "multipli": [], "basi": [2, 3], "__mul__": [], "quadratic_check_2d": [], "test_coeff": [], "subinterval_check": [], "min": [], "part": 1, "compar": [], "There": [], "extreme_valu": [], "other_sum": [], "short": [], "circuit": [], "finish": [], "faster": [1, 2, 3, 4], "soon": [], "guarante": [0, 1], "never": [], "quadratic_check_3d": [], "mask": [], "guarente": [], "unit": [], "quadratic_check_nd": [], "test_coeff_in": [], "examin": 0, "distanc": [], "drop": [], "off": [], "see": 4, "elimin": [], "represent": [0, 1, 2, 3], "repeat": [], "seen": [], "past": [], "those": [], "appropri": [], "welcom": [], "rootfind": 1, "har": 4, "multivari": 4, "smooth": [0, 1, 4], "compact": 4, "inher": [], "stabil": [], "accur": 4, "highli": [], "complic": [], "easi": [], "simpli": [], "document": 4, "provid": [], "slightli": [], "detail": [], "variou": 4, "emploi": [], "advanc": [], "user": [0, 1, 4], "built": 4, "base": 4, "work": [0, 1, 5], "lambda": [0, 1], "below": [], "same": 1, "dimenion": [], "li": [], "z": [0, 1], "x4": [], "g": [0, 1], "h": 1, "m1": 1, "m2": 1, "02": 1, "31": 1, "43": 1, "19": 1, "06": 1, "44": 1, "exp": 1, "1376": 1, "print": [0, 1, 2, 3], "46764373e": 1, "01": [0, 1], "44089210e": 1, "55111512e": 1, "17": 1, "98956615": 1, "12372817": 1, "06810064": 1, "03420242": 1, "note": [0, 1], "simpl": [1, 4], "exist": 1, "stuck": [0, 1], "kernel": 1, "crash": 1, "restrict": [0, 1], "callabl": [0, 1, 2, 3], "python": [0, 1, 2, 3], "consid": 0, "approx": 0, "00000000e": 0, "00": 0, "11022302e": 0, "8014584982224306e": 0, "24": 0, "sqrt": 0, "42352509e": 0, "9": 0, "49016725e": 0, "89803345e": 0, "24418041e": 0, "24418045e": 0, "22090244e": 0, "11": [0, 3], "insuffici": 1, "further": 1, "subregion": 1, "specif": 1, "coefficient_matrix": 0, "To": [2, 3, 4], "t_2": 2, "1t_3": 2, "kind": 2, "j": [2, 3], "t_i": 2, "t_j": 2, "super": [], "3x": 3, "5x": 3, "62x": 3, "11x": 3, "03y": 3, "58": 3, "03": 3, "62": 3, "forth": 3, "verbos": 1, "compil": 1, "mean": 1, "upon": 1, "import": 1, "As": 1, "veri": 1, "sever": 1, "second": 1, "longer": 1, "due": 1, "onc": 1, "howev": 1, "again": 1, "normal": 1, "speed": 1, "thereaft": 1, "progress": 1, "output": 1, "termin": 1, "some": 4, "quick": 4, "learn": 4, "navig": 4}, "objects": {"yroots.ChebyshevApproximator": [[0, 0, 1, "", "chebApproximate"]], "yroots.Combined_Solver": [[1, 0, 1, "", "solve"]], "yroots.polynomial": [[2, 1, 1, "", "MultiCheb"], [3, 1, 1, "", "MultiPower"]]}, "objtypes": {"0": "py:function", "1": "py:class"}, "objnames": {"0": ["py", "function", "Python function"], "1": ["py", "class", "Python class"]}, "titleterms": {"welcom": [], "yroot": [0, 1, 4], "s": [], "document": [], "indic": [], "tabl": [], "what": [], "rootfind": [], "content": 5, "modul": 5, "chebyshevsubdivisionsolv": [], "combined_solv": [], "chebyshevapproxim": [], "solver": 1, "function": [], "main": [], "approxim": 0, "gener": [], "degre": [], "finder": [], "final": [], "determin": [], "error": [], "calcul": [], "solvechebyshevsubdivis": [], "solvepolyrecurs": [], "zoominonintervalit": [], "boundingintervallinearsystem": [], "linear": [], "check": [], "findvertic": [], "transformchebinplace1d": [], "trackedinterv": [], "class": [2, 3], "solveropt": [], "gettransformationerror": [], "getsubdivisiondim": [], "getsubdivisioninterv": [], "trimm": [], "high": [], "level": [], "process": [], "autofunct": [], "interv": [], "shrink": [], "coeffici": [], "matrix": [], "transform": [], "subdivis": [], "quadraticcheck": [], "polynomi": [], "multicheb": 2, "multipow": 3, "chebapproxim": [], "interval_approximate_nd": [], "getchebyshevdegre": [], "getfinaldegre": [], "getapproxerror": [], "how": 4, "work": 4, "get": 4, "start": 4, "solv": 1}, "envversion": {"sphinx.domains.c": 2, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 6, "sphinx.domains.index": 1, "sphinx.domains.javascript": 2, "sphinx.domains.math": 2, "sphinx.domains.python": 3, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx": 56}}) \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index fbc019f7..9d76b3fc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,6 +21,9 @@ dependencies = [ dev = [ "pytest>=9.0.3", ] +docs = [ + "sphinx>=8.0", +] [tool.hatch.build.targets.wheel] packages = ["yroots"] \ No newline at end of file From b837523eca20b9ae07817225dacac94633ca6413 Mon Sep 17 00:00:00 2001 From: JarvisRAs Date: Tue, 26 May 2026 14:11:32 -0600 Subject: [PATCH 25/36] Regenerate uv.lock to include sphinx docs group --- uv.lock | 265 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 265 insertions(+) diff --git a/uv.lock b/uv.lock index b803cca3..0f9fca4b 100644 --- a/uv.lock +++ b/uv.lock @@ -2,6 +2,74 @@ version = 1 revision = 3 requires-python = ">=3.14" +[[package]] +name = "alabaster" +version = "1.0.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/a6/f8/d9c74d0daf3f742840fd818d69cfae176fa332022fd44e3469487d5a9420/alabaster-1.0.0.tar.gz", hash = "sha256:c00dca57bca26fa62a6d7d0a9fcce65f3e026e9bfe33e9c538fd3fbb2144fd9e", size = 24210, upload-time = "2024-07-26T18:15:03.762Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7e/b3/6b4067be973ae96ba0d615946e314c5ae35f9f993eca561b356540bb0c2b/alabaster-1.0.0-py3-none-any.whl", hash = "sha256:fc6786402dc3fcb2de3cabd5fe455a2db534b371124f1f21de8731783dec828b", size = 13929, upload-time = "2024-07-26T18:15:02.05Z" }, +] + +[[package]] +name = "babel" +version = "2.18.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/7d/b2/51899539b6ceeeb420d40ed3cd4b7a40519404f9baf3d4ac99dc413a834b/babel-2.18.0.tar.gz", hash = "sha256:b80b99a14bd085fcacfa15c9165f651fbb3406e66cc603abf11c5750937c992d", size = 9959554, upload-time = "2026-02-01T12:30:56.078Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/77/f5/21d2de20e8b8b0408f0681956ca2c69f1320a3848ac50e6e7f39c6159675/babel-2.18.0-py3-none-any.whl", hash = "sha256:e2b422b277c2b9a9630c1d7903c2a00d0830c409c59ac8cae9081c92f1aeba35", size = 10196845, upload-time = "2026-02-01T12:30:53.445Z" }, +] + +[[package]] +name = "certifi" +version = "2026.5.20" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f3/ce/ee2ecad540810a79593028e88299baeae54d346cc7a0d94b6199988b89b1/certifi-2026.5.20.tar.gz", hash = "sha256:69dea482ab64caa7b9f6aba1c6bf48bb6a5448d1c0f1b17ab42ad8c763a5344d", size = 135422, upload-time = "2026-05-20T11:46:50.073Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/59/8c/57e832b7af6d7c5abe66eb3fbe3a3a32f4d11ea23a1aa7131371035be991/certifi-2026.5.20-py3-none-any.whl", hash = "sha256:3c52e209ba0a4ad7aebe60436a4ab349c39e1e602e8c134221e546902ad25897", size = 134134, upload-time = "2026-05-20T11:46:48.578Z" }, +] + +[[package]] +name = "charset-normalizer" +version = "3.4.7" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/e7/a1/67fe25fac3c7642725500a3f6cfe5821ad557c3abb11c9d20d12c7008d3e/charset_normalizer-3.4.7.tar.gz", hash = "sha256:ae89db9e5f98a11a4bf50407d4363e7b09b31e55bc117b4f7d80aab97ba009e5", size = 144271, upload-time = "2026-04-02T09:28:39.342Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/97/c8/c67cb8c70e19ef1960b97b22ed2a1567711de46c4ddf19799923adc836c2/charset_normalizer-3.4.7-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:c36c333c39be2dbca264d7803333c896ab8fa7d4d6f0ab7edb7dfd7aea6e98c0", size = 309234, upload-time = "2026-04-02T09:27:07.194Z" }, + { url = "https://files.pythonhosted.org/packages/99/85/c091fdee33f20de70d6c8b522743b6f831a2f1cd3ff86de4c6a827c48a76/charset_normalizer-3.4.7-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1c2aed2e5e41f24ea8ef1590b8e848a79b56f3a5564a65ceec43c9d692dc7d8a", size = 208042, upload-time = "2026-04-02T09:27:08.749Z" }, + { url = "https://files.pythonhosted.org/packages/87/1c/ab2ce611b984d2fd5d86a5a8a19c1ae26acac6bad967da4967562c75114d/charset_normalizer-3.4.7-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:54523e136b8948060c0fa0bc7b1b50c32c186f2fceee897a495406bb6e311d2b", size = 228706, upload-time = "2026-04-02T09:27:09.951Z" }, + { url = "https://files.pythonhosted.org/packages/a8/29/2b1d2cb00bf085f59d29eb773ce58ec2d325430f8c216804a0a5cd83cbca/charset_normalizer-3.4.7-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:715479b9a2802ecac752a3b0efa2b0b60285cf962ee38414211abdfccc233b41", size = 224727, upload-time = "2026-04-02T09:27:11.175Z" }, + { url = "https://files.pythonhosted.org/packages/47/5c/032c2d5a07fe4d4855fea851209cca2b6f03ebeb6d4e3afdb3358386a684/charset_normalizer-3.4.7-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bd6c2a1c7573c64738d716488d2cdd3c00e340e4835707d8fdb8dc1a66ef164e", size = 215882, upload-time = "2026-04-02T09:27:12.446Z" }, + { url = "https://files.pythonhosted.org/packages/2c/c2/356065d5a8b78ed04499cae5f339f091946a6a74f91e03476c33f0ab7100/charset_normalizer-3.4.7-cp314-cp314-manylinux_2_31_armv7l.whl", hash = "sha256:c45e9440fb78f8ddabcf714b68f936737a121355bf59f3907f4e17721b9d1aae", size = 200860, upload-time = "2026-04-02T09:27:13.721Z" }, + { url = "https://files.pythonhosted.org/packages/0c/cd/a32a84217ced5039f53b29f460962abb2d4420def55afabe45b1c3c7483d/charset_normalizer-3.4.7-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:3534e7dcbdcf757da6b85a0bbf5b6868786d5982dd959b065e65481644817a18", size = 211564, upload-time = "2026-04-02T09:27:15.272Z" }, + { url = "https://files.pythonhosted.org/packages/44/86/58e6f13ce26cc3b8f4a36b94a0f22ae2f00a72534520f4ae6857c4b81f89/charset_normalizer-3.4.7-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:e8ac484bf18ce6975760921bb6148041faa8fef0547200386ea0b52b5d27bf7b", size = 211276, upload-time = "2026-04-02T09:27:16.834Z" }, + { url = "https://files.pythonhosted.org/packages/8f/fe/d17c32dc72e17e155e06883efa84514ca375f8a528ba2546bee73fc4df81/charset_normalizer-3.4.7-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:a5fe03b42827c13cdccd08e6c0247b6a6d4b5e3cdc53fd1749f5896adcdc2356", size = 201238, upload-time = "2026-04-02T09:27:18.229Z" }, + { url = "https://files.pythonhosted.org/packages/6a/29/f33daa50b06525a237451cdb6c69da366c381a3dadcd833fa5676bc468b3/charset_normalizer-3.4.7-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:2d6eb928e13016cea4f1f21d1e10c1cebd5a421bc57ddf5b1142ae3f86824fab", size = 230189, upload-time = "2026-04-02T09:27:19.445Z" }, + { url = "https://files.pythonhosted.org/packages/b6/6e/52c84015394a6a0bdcd435210a7e944c5f94ea1055f5cc5d56c5fe368e7b/charset_normalizer-3.4.7-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:e74327fb75de8986940def6e8dee4f127cc9752bee7355bb323cc5b2659b6d46", size = 211352, upload-time = "2026-04-02T09:27:20.79Z" }, + { url = "https://files.pythonhosted.org/packages/8c/d7/4353be581b373033fb9198bf1da3cf8f09c1082561e8e922aa7b39bf9fe8/charset_normalizer-3.4.7-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:d6038d37043bced98a66e68d3aa2b6a35505dc01328cd65217cefe82f25def44", size = 227024, upload-time = "2026-04-02T09:27:22.063Z" }, + { url = "https://files.pythonhosted.org/packages/30/45/99d18aa925bd1740098ccd3060e238e21115fffbfdcb8f3ece837d0ace6c/charset_normalizer-3.4.7-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:7579e913a5339fb8fa133f6bbcfd8e6749696206cf05acdbdca71a1b436d8e72", size = 217869, upload-time = "2026-04-02T09:27:23.486Z" }, + { url = "https://files.pythonhosted.org/packages/5c/05/5ee478aa53f4bb7996482153d4bfe1b89e0f087f0ab6b294fcf92d595873/charset_normalizer-3.4.7-cp314-cp314-win32.whl", hash = "sha256:5b77459df20e08151cd6f8b9ef8ef1f961ef73d85c21a555c7eed5b79410ec10", size = 148541, upload-time = "2026-04-02T09:27:25.146Z" }, + { url = "https://files.pythonhosted.org/packages/48/77/72dcb0921b2ce86420b2d79d454c7022bf5be40202a2a07906b9f2a35c97/charset_normalizer-3.4.7-cp314-cp314-win_amd64.whl", hash = "sha256:92a0a01ead5e668468e952e4238cccd7c537364eb7d851ab144ab6627dbbe12f", size = 159634, upload-time = "2026-04-02T09:27:26.642Z" }, + { url = "https://files.pythonhosted.org/packages/c6/a3/c2369911cd72f02386e4e340770f6e158c7980267da16af8f668217abaa0/charset_normalizer-3.4.7-cp314-cp314-win_arm64.whl", hash = "sha256:67f6279d125ca0046a7fd386d01b311c6363844deac3e5b069b514ba3e63c246", size = 148384, upload-time = "2026-04-02T09:27:28.271Z" }, + { url = "https://files.pythonhosted.org/packages/94/09/7e8a7f73d24dba1f0035fbbf014d2c36828fc1bf9c88f84093e57d315935/charset_normalizer-3.4.7-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:effc3f449787117233702311a1b7d8f59cba9ced946ba727bdc329ec69028e24", size = 330133, upload-time = "2026-04-02T09:27:29.474Z" }, + { url = "https://files.pythonhosted.org/packages/8d/da/96975ddb11f8e977f706f45cddd8540fd8242f71ecdb5d18a80723dcf62c/charset_normalizer-3.4.7-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:fbccdc05410c9ee21bbf16a35f4c1d16123dcdeb8a1d38f33654fa21d0234f79", size = 216257, upload-time = "2026-04-02T09:27:30.793Z" }, + { url = "https://files.pythonhosted.org/packages/e5/e8/1d63bf8ef2d388e95c64b2098f45f84758f6d102a087552da1485912637b/charset_normalizer-3.4.7-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:733784b6d6def852c814bce5f318d25da2ee65dd4839a0718641c696e09a2960", size = 234851, upload-time = "2026-04-02T09:27:32.44Z" }, + { url = "https://files.pythonhosted.org/packages/9b/40/e5ff04233e70da2681fa43969ad6f66ca5611d7e669be0246c4c7aaf6dc8/charset_normalizer-3.4.7-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a89c23ef8d2c6b27fd200a42aa4ac72786e7c60d40efdc76e6011260b6e949c4", size = 233393, upload-time = "2026-04-02T09:27:34.03Z" }, + { url = "https://files.pythonhosted.org/packages/be/c1/06c6c49d5a5450f76899992f1ee40b41d076aee9279b49cf9974d2f313d5/charset_normalizer-3.4.7-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6c114670c45346afedc0d947faf3c7f701051d2518b943679c8ff88befe14f8e", size = 223251, upload-time = "2026-04-02T09:27:35.369Z" }, + { url = "https://files.pythonhosted.org/packages/2b/9f/f2ff16fb050946169e3e1f82134d107e5d4ae72647ec8a1b1446c148480f/charset_normalizer-3.4.7-cp314-cp314t-manylinux_2_31_armv7l.whl", hash = "sha256:a180c5e59792af262bf263b21a3c49353f25945d8d9f70628e73de370d55e1e1", size = 206609, upload-time = "2026-04-02T09:27:36.661Z" }, + { url = "https://files.pythonhosted.org/packages/69/d5/a527c0cd8d64d2eab7459784fb4169a0ac76e5a6fc5237337982fd61347e/charset_normalizer-3.4.7-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:3c9a494bc5ec77d43cea229c4f6db1e4d8fe7e1bbffa8b6f0f0032430ff8ab44", size = 220014, upload-time = "2026-04-02T09:27:38.019Z" }, + { url = "https://files.pythonhosted.org/packages/7e/80/8a7b8104a3e203074dc9aa2c613d4b726c0e136bad1cc734594b02867972/charset_normalizer-3.4.7-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:8d828b6667a32a728a1ad1d93957cdf37489c57b97ae6c4de2860fa749b8fc1e", size = 218979, upload-time = "2026-04-02T09:27:39.37Z" }, + { url = "https://files.pythonhosted.org/packages/02/9a/b759b503d507f375b2b5c153e4d2ee0a75aa215b7f2489cf314f4541f2c0/charset_normalizer-3.4.7-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:cf1493cd8607bec4d8a7b9b004e699fcf8f9103a9284cc94962cb73d20f9d4a3", size = 209238, upload-time = "2026-04-02T09:27:40.722Z" }, + { url = "https://files.pythonhosted.org/packages/c2/4e/0f3f5d47b86bdb79256e7290b26ac847a2832d9a4033f7eb2cd4bcf4bb5b/charset_normalizer-3.4.7-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:0c96c3b819b5c3e9e165495db84d41914d6894d55181d2d108cc1a69bfc9cce0", size = 236110, upload-time = "2026-04-02T09:27:42.33Z" }, + { url = "https://files.pythonhosted.org/packages/96/23/bce28734eb3ed2c91dcf93abeb8a5cf393a7b2749725030bb630e554fdd8/charset_normalizer-3.4.7-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:752a45dc4a6934060b3b0dab47e04edc3326575f82be64bc4fc293914566503e", size = 219824, upload-time = "2026-04-02T09:27:43.924Z" }, + { url = "https://files.pythonhosted.org/packages/2c/6f/6e897c6984cc4d41af319b077f2f600fc8214eb2fe2d6bcb79141b882400/charset_normalizer-3.4.7-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:8778f0c7a52e56f75d12dae53ae320fae900a8b9b4164b981b9c5ce059cd1fcb", size = 233103, upload-time = "2026-04-02T09:27:45.348Z" }, + { url = "https://files.pythonhosted.org/packages/76/22/ef7bd0fe480a0ae9b656189ec00744b60933f68b4f42a7bb06589f6f576a/charset_normalizer-3.4.7-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:ce3412fbe1e31eb81ea42f4169ed94861c56e643189e1e75f0041f3fe7020abe", size = 225194, upload-time = "2026-04-02T09:27:46.706Z" }, + { url = "https://files.pythonhosted.org/packages/c5/a7/0e0ab3e0b5bc1219bd80a6a0d4d72ca74d9250cb2382b7c699c147e06017/charset_normalizer-3.4.7-cp314-cp314t-win32.whl", hash = "sha256:c03a41a8784091e67a39648f70c5f97b5b6a37f216896d44d2cdcb82615339a0", size = 159827, upload-time = "2026-04-02T09:27:48.053Z" }, + { url = "https://files.pythonhosted.org/packages/7a/1d/29d32e0fb40864b1f878c7f5a0b343ae676c6e2b271a2d55cc3a152391da/charset_normalizer-3.4.7-cp314-cp314t-win_amd64.whl", hash = "sha256:03853ed82eeebbce3c2abfdbc98c96dc205f32a79627688ac9a27370ea61a49c", size = 174168, upload-time = "2026-04-02T09:27:49.795Z" }, + { url = "https://files.pythonhosted.org/packages/de/32/d92444ad05c7a6e41fb2036749777c163baf7a0301a040cb672d6b2b1ae9/charset_normalizer-3.4.7-cp314-cp314t-win_arm64.whl", hash = "sha256:c35abb8bfff0185efac5878da64c45dafd2b37fb0383add1be155a763c1f083d", size = 153018, upload-time = "2026-04-02T09:27:51.116Z" }, + { url = "https://files.pythonhosted.org/packages/db/8f/61959034484a4a7c527811f4721e75d02d653a35afb0b6054474d8185d4c/charset_normalizer-3.4.7-py3-none-any.whl", hash = "sha256:3dce51d0f5e7951f8bb4900c257dad282f49190fdbebecd4ba99bcc41fef404d", size = 61958, upload-time = "2026-04-02T09:28:37.794Z" }, +] + [[package]] name = "colorama" version = "0.4.6" @@ -53,6 +121,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/e7/05/c19819d5e3d95294a6f5947fb9b9629efb316b96de511b418c53d245aae6/cycler-0.12.1-py3-none-any.whl", hash = "sha256:85cef7cff222d8644161529808465972e51340599459b8ac3ccbac5a854e0d30", size = 8321, upload-time = "2023-10-07T05:32:16.783Z" }, ] +[[package]] +name = "docutils" +version = "0.22.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/ae/b6/03bb70946330e88ffec97aefd3ea75ba575cb2e762061e0e62a213befee8/docutils-0.22.4.tar.gz", hash = "sha256:4db53b1fde9abecbb74d91230d32ab626d94f6badfc575d6db9194a49df29968", size = 2291750, upload-time = "2025-12-18T19:00:26.443Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/02/10/5da547df7a391dcde17f59520a231527b8571e6f46fc8efb02ccb370ab12/docutils-0.22.4-py3-none-any.whl", hash = "sha256:d0013f540772d1420576855455d050a2180186c91c15779301ac2ccb3eeb68de", size = 633196, upload-time = "2025-12-18T19:00:18.077Z" }, +] + [[package]] name = "fonttools" version = "4.63.0" @@ -78,6 +155,24 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/2c/47/c99d5268f354002ce80f8d029cd9d7d872969da1de8b93d32de4dc56d6f4/fonttools-4.63.0-py3-none-any.whl", hash = "sha256:445af2eab030a16b9171ea8bdda7ebf7d96bda2df88ee182a464252f6e05e20d", size = 1164562, upload-time = "2026-05-14T12:04:29.092Z" }, ] +[[package]] +name = "idna" +version = "3.16" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/1a/88/bcf9709822fe69d02c2a6a77956c98ce6ea8ca8767a9aadcedc7eb6a2390/idna-3.16.tar.gz", hash = "sha256:d7a6da03db833450fca25d2358ac9ff06cd624577a4aea3a596d5c0f77b8e03d", size = 203770, upload-time = "2026-05-22T00:16:18.781Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/94/16/70255075a9859a0e3adb789b68ceb0e210dec03934245fd98d248226572f/idna-3.16-py3-none-any.whl", hash = "sha256:cc246e3a3f89580c3a951b5ad298ca4638078b2cdd4f115654332b5c26daded5", size = 74165, upload-time = "2026-05-22T00:16:16.698Z" }, +] + +[[package]] +name = "imagesize" +version = "2.0.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/6c/e6/7bf14eeb8f8b7251141944835abd42eb20a658d89084b7e1f3e5fe394090/imagesize-2.0.0.tar.gz", hash = "sha256:8e8358c4a05c304f1fccf7ff96f036e7243a189e9e42e90851993c558cfe9ee3", size = 1773045, upload-time = "2026-03-03T14:18:29.941Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/5f/53/fb7122b71361a0d121b669dcf3d31244ef75badbbb724af388948de543e2/imagesize-2.0.0-py2.py3-none-any.whl", hash = "sha256:5667c5bbb57ab3f1fa4bc366f4fbc971db3d5ed011fd2715fd8001f782718d96", size = 9441, upload-time = "2026-03-03T14:18:27.892Z" }, +] + [[package]] name = "iniconfig" version = "2.3.0" @@ -87,6 +182,18 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484, upload-time = "2025-10-18T21:55:41.639Z" }, ] +[[package]] +name = "jinja2" +version = "3.1.6" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "markupsafe" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/df/bf/f7da0350254c0ed7c72f3e33cef02e048281fec7ecec5f032d4aac52226b/jinja2-3.1.6.tar.gz", hash = "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d", size = 245115, upload-time = "2025-03-05T20:05:02.478Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67", size = 134899, upload-time = "2025-03-05T20:05:00.369Z" }, +] + [[package]] name = "kiwisolver" version = "1.5.0" @@ -141,6 +248,36 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/4f/79/d3bbab197e86e0ff4f9c07122895b66a3e0d024247fcff7f12c473cb36d9/llvmlite-0.47.0-cp314-cp314t-win_amd64.whl", hash = "sha256:6842cf6f707ec4be3d985a385ad03f72b2d724439e118fcbe99b2929964f0453", size = 39153839, upload-time = "2026-03-31T18:29:51.004Z" }, ] +[[package]] +name = "markupsafe" +version = "3.0.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/7e/99/7690b6d4034fffd95959cbe0c02de8deb3098cc577c67bb6a24fe5d7caa7/markupsafe-3.0.3.tar.gz", hash = "sha256:722695808f4b6457b320fdc131280796bdceb04ab50fe1795cd540799ebe1698", size = 80313, upload-time = "2025-09-27T18:37:40.426Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/33/8a/8e42d4838cd89b7dde187011e97fe6c3af66d8c044997d2183fbd6d31352/markupsafe-3.0.3-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:eaa9599de571d72e2daf60164784109f19978b327a3910d3e9de8c97b5b70cfe", size = 11619, upload-time = "2025-09-27T18:37:06.342Z" }, + { url = "https://files.pythonhosted.org/packages/b5/64/7660f8a4a8e53c924d0fa05dc3a55c9cee10bbd82b11c5afb27d44b096ce/markupsafe-3.0.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:c47a551199eb8eb2121d4f0f15ae0f923d31350ab9280078d1e5f12b249e0026", size = 12029, upload-time = "2025-09-27T18:37:07.213Z" }, + { url = "https://files.pythonhosted.org/packages/da/ef/e648bfd021127bef5fa12e1720ffed0c6cbb8310c8d9bea7266337ff06de/markupsafe-3.0.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f34c41761022dd093b4b6896d4810782ffbabe30f2d443ff5f083e0cbbb8c737", size = 24408, upload-time = "2025-09-27T18:37:09.572Z" }, + { url = "https://files.pythonhosted.org/packages/41/3c/a36c2450754618e62008bf7435ccb0f88053e07592e6028a34776213d877/markupsafe-3.0.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:457a69a9577064c05a97c41f4e65148652db078a3a509039e64d3467b9e7ef97", size = 23005, upload-time = "2025-09-27T18:37:10.58Z" }, + { url = "https://files.pythonhosted.org/packages/bc/20/b7fdf89a8456b099837cd1dc21974632a02a999ec9bf7ca3e490aacd98e7/markupsafe-3.0.3-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:e8afc3f2ccfa24215f8cb28dcf43f0113ac3c37c2f0f0806d8c70e4228c5cf4d", size = 22048, upload-time = "2025-09-27T18:37:11.547Z" }, + { url = "https://files.pythonhosted.org/packages/9a/a7/591f592afdc734f47db08a75793a55d7fbcc6902a723ae4cfbab61010cc5/markupsafe-3.0.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:ec15a59cf5af7be74194f7ab02d0f59a62bdcf1a537677ce67a2537c9b87fcda", size = 23821, upload-time = "2025-09-27T18:37:12.48Z" }, + { url = "https://files.pythonhosted.org/packages/7d/33/45b24e4f44195b26521bc6f1a82197118f74df348556594bd2262bda1038/markupsafe-3.0.3-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:0eb9ff8191e8498cca014656ae6b8d61f39da5f95b488805da4bb029cccbfbaf", size = 21606, upload-time = "2025-09-27T18:37:13.485Z" }, + { url = "https://files.pythonhosted.org/packages/ff/0e/53dfaca23a69fbfbbf17a4b64072090e70717344c52eaaaa9c5ddff1e5f0/markupsafe-3.0.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:2713baf880df847f2bece4230d4d094280f4e67b1e813eec43b4c0e144a34ffe", size = 23043, upload-time = "2025-09-27T18:37:14.408Z" }, + { url = "https://files.pythonhosted.org/packages/46/11/f333a06fc16236d5238bfe74daccbca41459dcd8d1fa952e8fbd5dccfb70/markupsafe-3.0.3-cp314-cp314-win32.whl", hash = "sha256:729586769a26dbceff69f7a7dbbf59ab6572b99d94576a5592625d5b411576b9", size = 14747, upload-time = "2025-09-27T18:37:15.36Z" }, + { url = "https://files.pythonhosted.org/packages/28/52/182836104b33b444e400b14f797212f720cbc9ed6ba34c800639d154e821/markupsafe-3.0.3-cp314-cp314-win_amd64.whl", hash = "sha256:bdc919ead48f234740ad807933cdf545180bfbe9342c2bb451556db2ed958581", size = 15341, upload-time = "2025-09-27T18:37:16.496Z" }, + { url = "https://files.pythonhosted.org/packages/6f/18/acf23e91bd94fd7b3031558b1f013adfa21a8e407a3fdb32745538730382/markupsafe-3.0.3-cp314-cp314-win_arm64.whl", hash = "sha256:5a7d5dc5140555cf21a6fefbdbf8723f06fcd2f63ef108f2854de715e4422cb4", size = 14073, upload-time = "2025-09-27T18:37:17.476Z" }, + { url = "https://files.pythonhosted.org/packages/3c/f0/57689aa4076e1b43b15fdfa646b04653969d50cf30c32a102762be2485da/markupsafe-3.0.3-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:1353ef0c1b138e1907ae78e2f6c63ff67501122006b0f9abad68fda5f4ffc6ab", size = 11661, upload-time = "2025-09-27T18:37:18.453Z" }, + { url = "https://files.pythonhosted.org/packages/89/c3/2e67a7ca217c6912985ec766c6393b636fb0c2344443ff9d91404dc4c79f/markupsafe-3.0.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:1085e7fbddd3be5f89cc898938f42c0b3c711fdcb37d75221de2666af647c175", size = 12069, upload-time = "2025-09-27T18:37:19.332Z" }, + { url = "https://files.pythonhosted.org/packages/f0/00/be561dce4e6ca66b15276e184ce4b8aec61fe83662cce2f7d72bd3249d28/markupsafe-3.0.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1b52b4fb9df4eb9ae465f8d0c228a00624de2334f216f178a995ccdcf82c4634", size = 25670, upload-time = "2025-09-27T18:37:20.245Z" }, + { url = "https://files.pythonhosted.org/packages/50/09/c419f6f5a92e5fadde27efd190eca90f05e1261b10dbd8cbcb39cd8ea1dc/markupsafe-3.0.3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:fed51ac40f757d41b7c48425901843666a6677e3e8eb0abcff09e4ba6e664f50", size = 23598, upload-time = "2025-09-27T18:37:21.177Z" }, + { url = "https://files.pythonhosted.org/packages/22/44/a0681611106e0b2921b3033fc19bc53323e0b50bc70cffdd19f7d679bb66/markupsafe-3.0.3-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:f190daf01f13c72eac4efd5c430a8de82489d9cff23c364c3ea822545032993e", size = 23261, upload-time = "2025-09-27T18:37:22.167Z" }, + { url = "https://files.pythonhosted.org/packages/5f/57/1b0b3f100259dc9fffe780cfb60d4be71375510e435efec3d116b6436d43/markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:e56b7d45a839a697b5eb268c82a71bd8c7f6c94d6fd50c3d577fa39a9f1409f5", size = 24835, upload-time = "2025-09-27T18:37:23.296Z" }, + { url = "https://files.pythonhosted.org/packages/26/6a/4bf6d0c97c4920f1597cc14dd720705eca0bf7c787aebc6bb4d1bead5388/markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:f3e98bb3798ead92273dc0e5fd0f31ade220f59a266ffd8a4f6065e0a3ce0523", size = 22733, upload-time = "2025-09-27T18:37:24.237Z" }, + { url = "https://files.pythonhosted.org/packages/14/c7/ca723101509b518797fedc2fdf79ba57f886b4aca8a7d31857ba3ee8281f/markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:5678211cb9333a6468fb8d8be0305520aa073f50d17f089b5b4b477ea6e67fdc", size = 23672, upload-time = "2025-09-27T18:37:25.271Z" }, + { url = "https://files.pythonhosted.org/packages/fb/df/5bd7a48c256faecd1d36edc13133e51397e41b73bb77e1a69deab746ebac/markupsafe-3.0.3-cp314-cp314t-win32.whl", hash = "sha256:915c04ba3851909ce68ccc2b8e2cd691618c4dc4c4232fb7982bca3f41fd8c3d", size = 14819, upload-time = "2025-09-27T18:37:26.285Z" }, + { url = "https://files.pythonhosted.org/packages/1a/8a/0402ba61a2f16038b48b39bccca271134be00c5c9f0f623208399333c448/markupsafe-3.0.3-cp314-cp314t-win_amd64.whl", hash = "sha256:4faffd047e07c38848ce017e8725090413cd80cbc23d86e55c587bf979e579c9", size = 15426, upload-time = "2025-09-27T18:37:27.316Z" }, + { url = "https://files.pythonhosted.org/packages/70/bc/6f1c2f612465f5fa89b95bead1f44dcb607670fd42891d8fdcd5d039f4f4/markupsafe-3.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:32001d6a8fc98c8cb5c947787c5d08b0a50663d139f1305bac5885d98d9b40fa", size = 14146, upload-time = "2025-09-27T18:37:28.327Z" }, +] + [[package]] name = "matplotlib" version = "3.10.9" @@ -329,6 +466,30 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/ec/57/56b9bcc3c9c6a792fcbaf139543cee77261f3651ca9da0c93f5c1221264b/python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427", size = 229892, upload-time = "2024-03-01T18:36:18.57Z" }, ] +[[package]] +name = "requests" +version = "2.34.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "certifi" }, + { name = "charset-normalizer" }, + { name = "idna" }, + { name = "urllib3" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ac/c3/e2a2b89f2d3e2179abd6d00ebd70bff6273f37fb3e0cc209f48b39d00cbf/requests-2.34.2.tar.gz", hash = "sha256:f288924cae4e29463698d6d60bc6a4da69c89185ad1e0bcc4104f584e960b9ed", size = 142856, upload-time = "2026-05-14T19:25:27.735Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a0/f4/c67b0b3f1b9245e8d266f0f112c500d50e5b4e83cb6f3b71b6528104182a/requests-2.34.2-py3-none-any.whl", hash = "sha256:2a0d60c172f83ac6ab31e4554906c0f3b3588d37b5cb939b1c061f4907e278e0", size = 73075, upload-time = "2026-05-14T19:25:26.443Z" }, +] + +[[package]] +name = "roman-numerals" +version = "4.1.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/ae/f9/41dc953bbeb056c17d5f7a519f50fdf010bd0553be2d630bc69d1e022703/roman_numerals-4.1.0.tar.gz", hash = "sha256:1af8b147eb1405d5839e78aeb93131690495fe9da5c91856cb33ad55a7f1e5b2", size = 9077, upload-time = "2025-12-17T18:25:34.381Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/04/54/6f679c435d28e0a568d8e8a7c0a93a09010818634c3c3907fc98d8983770/roman_numerals-4.1.0-py3-none-any.whl", hash = "sha256:647ba99caddc2cc1e55a51e4360689115551bf4476d90e8162cf8c345fe233c7", size = 7676, upload-time = "2025-12-17T18:25:33.098Z" }, +] + [[package]] name = "scipy" version = "1.17.1" @@ -369,6 +530,97 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/b7/ce/149a00dd41f10bc29e5921b496af8b574d8413afcd5e30dfa0ed46c2cc5e/six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274", size = 11050, upload-time = "2024-12-04T17:35:26.475Z" }, ] +[[package]] +name = "snowballstemmer" +version = "3.1.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/63/ee/67eef9600338e245ad7838230969a34c823ddbdbccc5e1fc43cd75b55bc9/snowballstemmer-3.1.0.tar.gz", hash = "sha256:fd9e34526b23340cd23ffea6c9f9760974ecc2c2ac9e1d81401443ccdb2a801f", size = 122523, upload-time = "2026-05-24T19:04:19.691Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/49/83/ddbf4533c62dd32667ef1238952abef155f3d3391f5be69a352ad1638a42/snowballstemmer-3.1.0-py3-none-any.whl", hash = "sha256:17e6d1da216aa07db6dad37139ea70cf13c4b2e9a096f6e64a9648fc657d3154", size = 104550, upload-time = "2026-05-24T19:04:18.026Z" }, +] + +[[package]] +name = "sphinx" +version = "9.1.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "alabaster" }, + { name = "babel" }, + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "docutils" }, + { name = "imagesize" }, + { name = "jinja2" }, + { name = "packaging" }, + { name = "pygments" }, + { name = "requests" }, + { name = "roman-numerals" }, + { name = "snowballstemmer" }, + { name = "sphinxcontrib-applehelp" }, + { name = "sphinxcontrib-devhelp" }, + { name = "sphinxcontrib-htmlhelp" }, + { name = "sphinxcontrib-jsmath" }, + { name = "sphinxcontrib-qthelp" }, + { name = "sphinxcontrib-serializinghtml" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/cd/bd/f08eb0f4eed5c83f1ba2a3bd18f7745a2b1525fad70660a1c00224ec468a/sphinx-9.1.0.tar.gz", hash = "sha256:7741722357dd75f8190766926071fed3bdc211c74dd2d7d4df5404da95930ddb", size = 8718324, upload-time = "2025-12-31T15:09:27.646Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/73/f7/b1884cb3188ab181fc81fa00c266699dab600f927a964df02ec3d5d1916a/sphinx-9.1.0-py3-none-any.whl", hash = "sha256:c84fdd4e782504495fe4f2c0b3413d6c2bf388589bb352d439b2a3bb99991978", size = 3921742, upload-time = "2025-12-31T15:09:25.561Z" }, +] + +[[package]] +name = "sphinxcontrib-applehelp" +version = "2.0.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/ba/6e/b837e84a1a704953c62ef8776d45c3e8d759876b4a84fe14eba2859106fe/sphinxcontrib_applehelp-2.0.0.tar.gz", hash = "sha256:2f29ef331735ce958efa4734873f084941970894c6090408b079c61b2e1c06d1", size = 20053, upload-time = "2024-07-29T01:09:00.465Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/5d/85/9ebeae2f76e9e77b952f4b274c27238156eae7979c5421fba91a28f4970d/sphinxcontrib_applehelp-2.0.0-py3-none-any.whl", hash = "sha256:4cd3f0ec4ac5dd9c17ec65e9ab272c9b867ea77425228e68ecf08d6b28ddbdb5", size = 119300, upload-time = "2024-07-29T01:08:58.99Z" }, +] + +[[package]] +name = "sphinxcontrib-devhelp" +version = "2.0.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f6/d2/5beee64d3e4e747f316bae86b55943f51e82bb86ecd325883ef65741e7da/sphinxcontrib_devhelp-2.0.0.tar.gz", hash = "sha256:411f5d96d445d1d73bb5d52133377b4248ec79db5c793ce7dbe59e074b4dd1ad", size = 12967, upload-time = "2024-07-29T01:09:23.417Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/35/7a/987e583882f985fe4d7323774889ec58049171828b58c2217e7f79cdf44e/sphinxcontrib_devhelp-2.0.0-py3-none-any.whl", hash = "sha256:aefb8b83854e4b0998877524d1029fd3e6879210422ee3780459e28a1f03a8a2", size = 82530, upload-time = "2024-07-29T01:09:21.945Z" }, +] + +[[package]] +name = "sphinxcontrib-htmlhelp" +version = "2.1.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/43/93/983afd9aa001e5201eab16b5a444ed5b9b0a7a010541e0ddfbbfd0b2470c/sphinxcontrib_htmlhelp-2.1.0.tar.gz", hash = "sha256:c9e2916ace8aad64cc13a0d233ee22317f2b9025b9cf3295249fa985cc7082e9", size = 22617, upload-time = "2024-07-29T01:09:37.889Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0a/7b/18a8c0bcec9182c05a0b3ec2a776bba4ead82750a55ff798e8d406dae604/sphinxcontrib_htmlhelp-2.1.0-py3-none-any.whl", hash = "sha256:166759820b47002d22914d64a075ce08f4c46818e17cfc9470a9786b759b19f8", size = 98705, upload-time = "2024-07-29T01:09:36.407Z" }, +] + +[[package]] +name = "sphinxcontrib-jsmath" +version = "1.0.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/b2/e8/9ed3830aeed71f17c026a07a5097edcf44b692850ef215b161b8ad875729/sphinxcontrib-jsmath-1.0.1.tar.gz", hash = "sha256:a9925e4a4587247ed2191a22df5f6970656cb8ca2bd6284309578f2153e0c4b8", size = 5787, upload-time = "2019-01-21T16:10:16.347Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c2/42/4c8646762ee83602e3fb3fbe774c2fac12f317deb0b5dbeeedd2d3ba4b77/sphinxcontrib_jsmath-1.0.1-py2.py3-none-any.whl", hash = "sha256:2ec2eaebfb78f3f2078e73666b1415417a116cc848b72e5172e596c871103178", size = 5071, upload-time = "2019-01-21T16:10:14.333Z" }, +] + +[[package]] +name = "sphinxcontrib-qthelp" +version = "2.0.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/68/bc/9104308fc285eb3e0b31b67688235db556cd5b0ef31d96f30e45f2e51cae/sphinxcontrib_qthelp-2.0.0.tar.gz", hash = "sha256:4fe7d0ac8fc171045be623aba3e2a8f613f8682731f9153bb2e40ece16b9bbab", size = 17165, upload-time = "2024-07-29T01:09:56.435Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/27/83/859ecdd180cacc13b1f7e857abf8582a64552ea7a061057a6c716e790fce/sphinxcontrib_qthelp-2.0.0-py3-none-any.whl", hash = "sha256:b18a828cdba941ccd6ee8445dbe72ffa3ef8cbe7505d8cd1fa0d42d3f2d5f3eb", size = 88743, upload-time = "2024-07-29T01:09:54.885Z" }, +] + +[[package]] +name = "sphinxcontrib-serializinghtml" +version = "2.0.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/3b/44/6716b257b0aa6bfd51a1b31665d1c205fb12cb5ad56de752dfa15657de2f/sphinxcontrib_serializinghtml-2.0.0.tar.gz", hash = "sha256:e9d912827f872c029017a53f0ef2180b327c3f7fd23c87229f7a8e8b70031d4d", size = 16080, upload-time = "2024-07-29T01:10:09.332Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/52/a7/d2782e4e3f77c8450f727ba74a8f12756d5ba823d81b941f1b04da9d033a/sphinxcontrib_serializinghtml-2.0.0-py3-none-any.whl", hash = "sha256:6e2cb0eef194e10c27ec0023bfeb25badbbb5868244cf5bc5bdc04e4464bf331", size = 92072, upload-time = "2024-07-29T01:10:08.203Z" }, +] + [[package]] name = "sympy" version = "1.14.0" @@ -381,6 +633,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/a2/09/77d55d46fd61b4a135c444fc97158ef34a095e5681d0a6c10b75bf356191/sympy-1.14.0-py3-none-any.whl", hash = "sha256:e091cc3e99d2141a0ba2847328f5479b05d94a6635cb96148ccb3f34671bd8f5", size = 6299353, upload-time = "2025-04-27T18:04:59.103Z" }, ] +[[package]] +name = "urllib3" +version = "2.7.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/53/0c/06f8b233b8fd13b9e5ee11424ef85419ba0d8ba0b3138bf360be2ff56953/urllib3-2.7.0.tar.gz", hash = "sha256:231e0ec3b63ceb14667c67be60f2f2c40a518cb38b03af60abc813da26505f4c", size = 433602, upload-time = "2026-05-07T16:13:18.596Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7f/3e/5db95bcf282c52709639744ca2a8b149baccf648e39c8cc87553df9eae0c/urllib3-2.7.0-py3-none-any.whl", hash = "sha256:9fb4c81ebbb1ce9531cce37674bbc6f1360472bc18ca9a553ede278ef7276897", size = 131087, upload-time = "2026-05-07T16:13:17.151Z" }, +] + [[package]] name = "yroots" version = "0.1.0" @@ -398,6 +659,9 @@ dependencies = [ dev = [ { name = "pytest" }, ] +docs = [ + { name = "sphinx" }, +] [package.metadata] requires-dist = [ @@ -411,3 +675,4 @@ requires-dist = [ [package.metadata.requires-dev] dev = [{ name = "pytest", specifier = ">=9.0.3" }] +docs = [{ name = "sphinx", specifier = ">=8.0" }] From 1976109d0959587cf564b7991e160596b431004d Mon Sep 17 00:00:00 2001 From: JarvisRAs Date: Tue, 26 May 2026 14:17:20 -0600 Subject: [PATCH 26/36] Fix dependabot.yml --- .github/{workflows => }/dependabot.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{workflows => }/dependabot.yml (100%) diff --git a/.github/workflows/dependabot.yml b/.github/dependabot.yml similarity index 100% rename from .github/workflows/dependabot.yml rename to .github/dependabot.yml From 00adc41d3ae3e1521e928233b381d33e1d76b684 Mon Sep 17 00:00:00 2001 From: JarvisRAs Date: Tue, 26 May 2026 14:28:35 -0600 Subject: [PATCH 27/36] Update pyproject.toml --- pyproject.toml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 9d76b3fc..289c1a55 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,6 +6,14 @@ build-backend = "hatchling.build" name = "yroots" version = "0.1.0" description = "Numerical rootfinding for multivariate systems of equations" +license = "MIT" +authors = [{ name = "Tyler Jarvis", email = "jarvis@math.byu.edu" }] +keywords = ["rootfinding"] +classifiers = [ + "Development Status :: 2 - Pre-Alpha", + "Intended Audience :: Developers", + "Natural Language :: English", +] readme = "README.md" requires-python = ">=3.14" dependencies = [ @@ -17,6 +25,9 @@ dependencies = [ "sympy>=1.12", ] +[project.urls] +Repository = "https://github.com/tylerjarvis/RootFinding" + [dependency-groups] dev = [ "pytest>=9.0.3", From c569f56e7422ad85846f66f844a2160344aabed4 Mon Sep 17 00:00:00 2001 From: JarvisRAs Date: Tue, 26 May 2026 14:35:12 -0600 Subject: [PATCH 28/36] Update README --- README.md | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index e7c6bace..6f06881b 100644 --- a/README.md +++ b/README.md @@ -19,20 +19,33 @@ This project was supported in part by the National Science Foundation, grant num ### Requirements -At least: -* Python 3.14t -* Pip 26.1 -* Numpy 2.4.4 -* Numba 0.65.1 -* Scipy 1.17.1 -* Sympy 1.12 +* Python 3.14t (free-threaded build — see note below) +* NumPy ≥ 2.4.4 +* Numba ≥ 0.65.1 +* SciPy ≥ 1.17.1 +* SymPy ≥ 1.12 + +> **Why 3.14t?** YRoots requires the free-threaded build of Python 3.14, which runs without the Global Interpreter Lock (GIL) for better parallelism. The `t` suffix identifies this build — it is a different download from the standard Python 3.14. ## Installation +**With uv (recommended):** +``` +uv python install 3.14t +uv pip install git+https://github.com/tylerjarvis/RootFinding.git +``` +Or clone and install for development: + +``` +git clone https://github.com/tylerjarvis/RootFinding.git +cd RootFinding +uv sync +``` + +With pip (requires Python 3.14t already installed): `$ pip install git+https://github.com/tylerjarvis/RootFinding.git` The package can then by imported using `import yroots`. - (We are currently working on adding the yroots package to The Python Package Index) ## Usage From d4cea8a8abbffe11076afb92140733098e5d9567 Mon Sep 17 00:00:00 2001 From: JarvisRAs Date: Tue, 26 May 2026 14:36:39 -0600 Subject: [PATCH 29/36] Update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6f06881b..e30ca514 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ uv sync ``` With pip (requires Python 3.14t already installed): -`$ pip install git+https://github.com/tylerjarvis/RootFinding.git` +```pip install git+https://github.com/tylerjarvis/RootFinding.git``` The package can then by imported using `import yroots`. (We are currently working on adding the yroots package to The Python Package Index) From 4a7e35c853af4085543009826a20521360b2f064 Mon Sep 17 00:00:00 2001 From: JarvisRAs Date: Tue, 26 May 2026 14:45:15 -0600 Subject: [PATCH 30/36] Changed docs.yml to automatically update documentation page --- .github/workflows/docs.yml | 24 +++++++++++++++++++++++- README.md | 2 +- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index c9668a28..a3d61314 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,9 +1,16 @@ name: Docs + on: push: branches: ["main"] pull_request: branches: ["main"] + +permissions: + contents: read + pages: write + id-token: write + jobs: build: runs-on: ubuntu-latest @@ -17,4 +24,19 @@ jobs: - name: Install dependencies run: uv sync --frozen --group docs - name: Build docs - run: uv run sphinx-build docs/source docs/_build/html \ No newline at end of file + run: uv run sphinx-build docs/source docs/_build/html + - name: Upload pages artifact + uses: actions/upload-pages-artifact@v3 + with: + path: docs/_build/html + + deploy: + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/README.md b/README.md index e30ca514..bd3e3c80 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ This project was supported in part by the National Science Foundation, grant num ## Installation -**With uv (recommended):** +With uv (recommended): ``` uv python install 3.14t uv pip install git+https://github.com/tylerjarvis/RootFinding.git From c62cf49d7586ba08d5d11d462d7ccf07f9af7181 Mon Sep 17 00:00:00 2001 From: JarvisRAs Date: Tue, 26 May 2026 15:18:02 -0600 Subject: [PATCH 31/36] Updated instructions for CombinedNotebook --- CombinedNotebook.ipynb | 22 ++++++++++++---------- README.md | 14 ++++++-------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/CombinedNotebook.ipynb b/CombinedNotebook.ipynb index 930f4bf6..6f7e2c9c 100644 --- a/CombinedNotebook.ipynb +++ b/CombinedNotebook.ipynb @@ -41,19 +41,21 @@ "source": [ "## Setup YRoots\n", "\n", - "First, in a terminal (Linux/Unix/Mac), navigate to the directory in which you wish to install `yroots`, then download it from github with the following command:\n", + "In a terminal, clone the repository and enter the directory:\n", "\n", - " ```git\n", - " git clone https://github.com/tylerjarvis/RootFinding.git \n", - " ```\n", - " \n", - "Then make the `yroots` module availabe to Python, use the following command: \n", + " git clone https://github.com/tylerjarvis/RootFinding.git\n", + " cd RootFinding\n", "\n", - " ```\n", - " pip install -e ./RootFinding\n", - " ```\n", + "Install `yroots` and all its dependencies using [uv](https://docs.astral.sh/uv/):\n", "\n", - "In addition, you will need to have `numpy`, `numba`, and `scipy` installed in order to run YRoots. See the documentation for the corresponding packages to learn how to install any of these.\n", + " uv sync\n", + "\n", + "This installs Python 3.14t (the free-threaded build required by YRoots) along with `numpy`, `numba`, `scipy`, and all other dependencies into an isolated environment at `.venv/`.\n", + "To run this notebook, open it in your editor of choice (VS Code, JupyterLab, classic Jupyter) and select `.venv/bin/python` as the kernel.\n", + "\n", + "If you prefer plain `pip` and already have Python 3.14t with `pip` installed, you can install YRoots directly:\n", + "\n", + " pip install -e .\n", "\n", "Before proceeding in this tutorial, you will need to complete the above process and run the following import statements: " ] diff --git a/README.md b/README.md index bd3e3c80..c87ce8ee 100644 --- a/README.md +++ b/README.md @@ -13,11 +13,6 @@ This project was supported in part by the National Science Foundation, grant num - - - - - ### Requirements * Python 3.14t (free-threaded build — see note below) * NumPy ≥ 2.4.4 @@ -43,9 +38,12 @@ uv sync ``` With pip (requires Python 3.14t already installed): -```pip install git+https://github.com/tylerjarvis/RootFinding.git``` -The package can then by imported using `import yroots`. +``` +pip install git+https://github.com/tylerjarvis/RootFinding.git +``` + +The package can then be imported using `import yroots`. (We are currently working on adding the yroots package to The Python Package Index) ## Usage @@ -67,7 +65,7 @@ b = np.array([0,1]) #upper bounds on x and y yr.solve([f,g],a,b) ``` -If the system includes polynomials, there are specialized `Polynomial` objects which may be allow for faster solving. See [Combined Notebook](https://github.com/tylerjarvis/RootFinding/blob/main/CombinedNotebook.ipynb) for more details. +If the system includes polynomials, there are specialized `Polynomial` objects which may allow for faster solving. See [Combined Notebook](https://github.com/tylerjarvis/RootFinding/blob/main/CombinedNotebook.ipynb) for more details. ## Examples of Applications From 381fa66c26ea9318b54f69cf329e38ee9acf2b2e Mon Sep 17 00:00:00 2001 From: JarvisRAs Date: Tue, 26 May 2026 15:31:41 -0600 Subject: [PATCH 32/36] Move tests and test results --- .../Chebfun_results}/actualroots_1.4.csv | 0 .../Chebfun_results}/actualroots_1.5.csv | 0 .../Chebfun_results}/actualroots_6.2.csv | 0 .../Chebfun_results}/test_roots_1.1.csv | 0 .../Chebfun_results}/test_roots_1.2.csv | 0 .../Chebfun_results}/test_roots_1.3.csv | 0 .../Chebfun_results}/test_roots_1.4.csv | 0 .../Chebfun_results}/test_roots_1.5.csv | 0 .../Chebfun_results}/test_roots_10.1.csv | 0 .../Chebfun_results}/test_roots_2.1.csv | 0 .../Chebfun_results}/test_roots_2.2.csv | 0 .../Chebfun_results}/test_roots_2.3.csv | 0 .../Chebfun_results}/test_roots_2.4.csv | 0 .../Chebfun_results}/test_roots_2.5.csv | 0 .../Chebfun_results}/test_roots_3.1.csv | 0 .../Chebfun_results}/test_roots_3.2.csv | 0 .../Chebfun_results}/test_roots_4.1.csv | 0 .../Chebfun_results}/test_roots_4.2.csv | 0 .../Chebfun_results}/test_roots_5.1.csv | 0 .../Chebfun_results}/test_roots_6.1.csv | 0 .../Chebfun_results}/test_roots_6.2.csv | 0 .../Chebfun_results}/test_roots_6.3.csv | 0 .../Chebfun_results}/test_roots_7.1.csv | 0 .../Chebfun_results}/test_roots_7.2.csv | 0 .../Chebfun_results}/test_roots_7.3.csv | 0 .../Chebfun_results}/test_roots_7.4.csv | 0 .../Chebfun_results}/test_roots_8.1.csv | 0 .../Chebfun_results}/test_roots_8.2.csv | 0 .../Chebfun_results}/test_roots_9.1.csv | 0 .../Chebfun_results}/test_roots_9.2.csv | 0 .../Polished_results}/polished_1.1.npy | Bin .../Polished_results}/polished_1.2.npy | Bin .../Polished_results}/polished_1.3.npy | Bin .../Polished_results}/polished_1.4.npy | Bin .../Polished_results}/polished_1.5.npy | Bin .../Polished_results}/polished_10.1.npy | Bin .../Polished_results}/polished_2.1.npy | Bin .../Polished_results}/polished_2.2.npy | Bin .../Polished_results}/polished_2.3.npy | Bin .../Polished_results}/polished_2.4.npy | Bin .../Polished_results}/polished_2.5.npy | Bin .../Polished_results}/polished_3.1.npy | Bin .../Polished_results}/polished_3.2.npy | Bin .../Polished_results}/polished_4.1.npy | Bin .../Polished_results}/polished_4.2.npy | Bin .../Polished_results}/polished_5.1.npy | Bin .../Polished_results}/polished_6.1.npy | Bin .../Polished_results}/polished_6.2.npy | Bin .../Polished_results}/polished_6.3.npy | Bin .../Polished_results}/polished_7.1.npy | Bin .../Polished_results}/polished_7.2.npy | Bin .../Polished_results}/polished_7.3.npy | Bin .../Polished_results}/polished_7.4.npy | Bin .../Polished_results}/polished_8.1.npy | Bin .../Polished_results}/polished_8.2.npy | Bin .../Polished_results}/polished_9.1.npy | Bin .../Polished_results}/polished_9.2.npy | Bin chebfun2_suite.py => tests/chebfun2_suite.py | 0 tests/test_parallelization.py | 4 ++-- 59 files changed, 2 insertions(+), 2 deletions(-) rename {Chebfun_results => tests/Chebfun_results}/actualroots_1.4.csv (100%) rename {Chebfun_results => tests/Chebfun_results}/actualroots_1.5.csv (100%) rename {Chebfun_results => tests/Chebfun_results}/actualroots_6.2.csv (100%) rename {Chebfun_results => tests/Chebfun_results}/test_roots_1.1.csv (100%) rename {Chebfun_results => tests/Chebfun_results}/test_roots_1.2.csv (100%) rename {Chebfun_results => tests/Chebfun_results}/test_roots_1.3.csv (100%) rename {Chebfun_results => tests/Chebfun_results}/test_roots_1.4.csv (100%) rename {Chebfun_results => tests/Chebfun_results}/test_roots_1.5.csv (100%) rename {Chebfun_results => tests/Chebfun_results}/test_roots_10.1.csv (100%) rename {Chebfun_results => tests/Chebfun_results}/test_roots_2.1.csv (100%) rename {Chebfun_results => tests/Chebfun_results}/test_roots_2.2.csv (100%) rename {Chebfun_results => tests/Chebfun_results}/test_roots_2.3.csv (100%) rename {Chebfun_results => tests/Chebfun_results}/test_roots_2.4.csv (100%) rename {Chebfun_results => tests/Chebfun_results}/test_roots_2.5.csv (100%) rename {Chebfun_results => tests/Chebfun_results}/test_roots_3.1.csv (100%) rename {Chebfun_results => tests/Chebfun_results}/test_roots_3.2.csv (100%) rename {Chebfun_results => tests/Chebfun_results}/test_roots_4.1.csv (100%) rename {Chebfun_results => tests/Chebfun_results}/test_roots_4.2.csv (100%) rename {Chebfun_results => tests/Chebfun_results}/test_roots_5.1.csv (100%) rename {Chebfun_results => tests/Chebfun_results}/test_roots_6.1.csv (100%) rename {Chebfun_results => tests/Chebfun_results}/test_roots_6.2.csv (100%) rename {Chebfun_results => tests/Chebfun_results}/test_roots_6.3.csv (100%) rename {Chebfun_results => tests/Chebfun_results}/test_roots_7.1.csv (100%) rename {Chebfun_results => tests/Chebfun_results}/test_roots_7.2.csv (100%) rename {Chebfun_results => tests/Chebfun_results}/test_roots_7.3.csv (100%) rename {Chebfun_results => tests/Chebfun_results}/test_roots_7.4.csv (100%) rename {Chebfun_results => tests/Chebfun_results}/test_roots_8.1.csv (100%) rename {Chebfun_results => tests/Chebfun_results}/test_roots_8.2.csv (100%) rename {Chebfun_results => tests/Chebfun_results}/test_roots_9.1.csv (100%) rename {Chebfun_results => tests/Chebfun_results}/test_roots_9.2.csv (100%) rename {Polished_results => tests/Polished_results}/polished_1.1.npy (100%) rename {Polished_results => tests/Polished_results}/polished_1.2.npy (100%) rename {Polished_results => tests/Polished_results}/polished_1.3.npy (100%) rename {Polished_results => tests/Polished_results}/polished_1.4.npy (100%) rename {Polished_results => tests/Polished_results}/polished_1.5.npy (100%) rename {Polished_results => tests/Polished_results}/polished_10.1.npy (100%) rename {Polished_results => tests/Polished_results}/polished_2.1.npy (100%) rename {Polished_results => tests/Polished_results}/polished_2.2.npy (100%) rename {Polished_results => tests/Polished_results}/polished_2.3.npy (100%) rename {Polished_results => tests/Polished_results}/polished_2.4.npy (100%) rename {Polished_results => tests/Polished_results}/polished_2.5.npy (100%) rename {Polished_results => tests/Polished_results}/polished_3.1.npy (100%) rename {Polished_results => tests/Polished_results}/polished_3.2.npy (100%) rename {Polished_results => tests/Polished_results}/polished_4.1.npy (100%) rename {Polished_results => tests/Polished_results}/polished_4.2.npy (100%) rename {Polished_results => tests/Polished_results}/polished_5.1.npy (100%) rename {Polished_results => tests/Polished_results}/polished_6.1.npy (100%) rename {Polished_results => tests/Polished_results}/polished_6.2.npy (100%) rename {Polished_results => tests/Polished_results}/polished_6.3.npy (100%) rename {Polished_results => tests/Polished_results}/polished_7.1.npy (100%) rename {Polished_results => tests/Polished_results}/polished_7.2.npy (100%) rename {Polished_results => tests/Polished_results}/polished_7.3.npy (100%) rename {Polished_results => tests/Polished_results}/polished_7.4.npy (100%) rename {Polished_results => tests/Polished_results}/polished_8.1.npy (100%) rename {Polished_results => tests/Polished_results}/polished_8.2.npy (100%) rename {Polished_results => tests/Polished_results}/polished_9.1.npy (100%) rename {Polished_results => tests/Polished_results}/polished_9.2.npy (100%) rename chebfun2_suite.py => tests/chebfun2_suite.py (100%) diff --git a/Chebfun_results/actualroots_1.4.csv b/tests/Chebfun_results/actualroots_1.4.csv similarity index 100% rename from Chebfun_results/actualroots_1.4.csv rename to tests/Chebfun_results/actualroots_1.4.csv diff --git a/Chebfun_results/actualroots_1.5.csv b/tests/Chebfun_results/actualroots_1.5.csv similarity index 100% rename from Chebfun_results/actualroots_1.5.csv rename to tests/Chebfun_results/actualroots_1.5.csv diff --git a/Chebfun_results/actualroots_6.2.csv b/tests/Chebfun_results/actualroots_6.2.csv similarity index 100% rename from Chebfun_results/actualroots_6.2.csv rename to tests/Chebfun_results/actualroots_6.2.csv diff --git a/Chebfun_results/test_roots_1.1.csv b/tests/Chebfun_results/test_roots_1.1.csv similarity index 100% rename from Chebfun_results/test_roots_1.1.csv rename to tests/Chebfun_results/test_roots_1.1.csv diff --git a/Chebfun_results/test_roots_1.2.csv b/tests/Chebfun_results/test_roots_1.2.csv similarity index 100% rename from Chebfun_results/test_roots_1.2.csv rename to tests/Chebfun_results/test_roots_1.2.csv diff --git a/Chebfun_results/test_roots_1.3.csv b/tests/Chebfun_results/test_roots_1.3.csv similarity index 100% rename from Chebfun_results/test_roots_1.3.csv rename to tests/Chebfun_results/test_roots_1.3.csv diff --git a/Chebfun_results/test_roots_1.4.csv b/tests/Chebfun_results/test_roots_1.4.csv similarity index 100% rename from Chebfun_results/test_roots_1.4.csv rename to tests/Chebfun_results/test_roots_1.4.csv diff --git a/Chebfun_results/test_roots_1.5.csv b/tests/Chebfun_results/test_roots_1.5.csv similarity index 100% rename from Chebfun_results/test_roots_1.5.csv rename to tests/Chebfun_results/test_roots_1.5.csv diff --git a/Chebfun_results/test_roots_10.1.csv b/tests/Chebfun_results/test_roots_10.1.csv similarity index 100% rename from Chebfun_results/test_roots_10.1.csv rename to tests/Chebfun_results/test_roots_10.1.csv diff --git a/Chebfun_results/test_roots_2.1.csv b/tests/Chebfun_results/test_roots_2.1.csv similarity index 100% rename from Chebfun_results/test_roots_2.1.csv rename to tests/Chebfun_results/test_roots_2.1.csv diff --git a/Chebfun_results/test_roots_2.2.csv b/tests/Chebfun_results/test_roots_2.2.csv similarity index 100% rename from Chebfun_results/test_roots_2.2.csv rename to tests/Chebfun_results/test_roots_2.2.csv diff --git a/Chebfun_results/test_roots_2.3.csv b/tests/Chebfun_results/test_roots_2.3.csv similarity index 100% rename from Chebfun_results/test_roots_2.3.csv rename to tests/Chebfun_results/test_roots_2.3.csv diff --git a/Chebfun_results/test_roots_2.4.csv b/tests/Chebfun_results/test_roots_2.4.csv similarity index 100% rename from Chebfun_results/test_roots_2.4.csv rename to tests/Chebfun_results/test_roots_2.4.csv diff --git a/Chebfun_results/test_roots_2.5.csv b/tests/Chebfun_results/test_roots_2.5.csv similarity index 100% rename from Chebfun_results/test_roots_2.5.csv rename to tests/Chebfun_results/test_roots_2.5.csv diff --git a/Chebfun_results/test_roots_3.1.csv b/tests/Chebfun_results/test_roots_3.1.csv similarity index 100% rename from Chebfun_results/test_roots_3.1.csv rename to tests/Chebfun_results/test_roots_3.1.csv diff --git a/Chebfun_results/test_roots_3.2.csv b/tests/Chebfun_results/test_roots_3.2.csv similarity index 100% rename from Chebfun_results/test_roots_3.2.csv rename to tests/Chebfun_results/test_roots_3.2.csv diff --git a/Chebfun_results/test_roots_4.1.csv b/tests/Chebfun_results/test_roots_4.1.csv similarity index 100% rename from Chebfun_results/test_roots_4.1.csv rename to tests/Chebfun_results/test_roots_4.1.csv diff --git a/Chebfun_results/test_roots_4.2.csv b/tests/Chebfun_results/test_roots_4.2.csv similarity index 100% rename from Chebfun_results/test_roots_4.2.csv rename to tests/Chebfun_results/test_roots_4.2.csv diff --git a/Chebfun_results/test_roots_5.1.csv b/tests/Chebfun_results/test_roots_5.1.csv similarity index 100% rename from Chebfun_results/test_roots_5.1.csv rename to tests/Chebfun_results/test_roots_5.1.csv diff --git a/Chebfun_results/test_roots_6.1.csv b/tests/Chebfun_results/test_roots_6.1.csv similarity index 100% rename from Chebfun_results/test_roots_6.1.csv rename to tests/Chebfun_results/test_roots_6.1.csv diff --git a/Chebfun_results/test_roots_6.2.csv b/tests/Chebfun_results/test_roots_6.2.csv similarity index 100% rename from Chebfun_results/test_roots_6.2.csv rename to tests/Chebfun_results/test_roots_6.2.csv diff --git a/Chebfun_results/test_roots_6.3.csv b/tests/Chebfun_results/test_roots_6.3.csv similarity index 100% rename from Chebfun_results/test_roots_6.3.csv rename to tests/Chebfun_results/test_roots_6.3.csv diff --git a/Chebfun_results/test_roots_7.1.csv b/tests/Chebfun_results/test_roots_7.1.csv similarity index 100% rename from Chebfun_results/test_roots_7.1.csv rename to tests/Chebfun_results/test_roots_7.1.csv diff --git a/Chebfun_results/test_roots_7.2.csv b/tests/Chebfun_results/test_roots_7.2.csv similarity index 100% rename from Chebfun_results/test_roots_7.2.csv rename to tests/Chebfun_results/test_roots_7.2.csv diff --git a/Chebfun_results/test_roots_7.3.csv b/tests/Chebfun_results/test_roots_7.3.csv similarity index 100% rename from Chebfun_results/test_roots_7.3.csv rename to tests/Chebfun_results/test_roots_7.3.csv diff --git a/Chebfun_results/test_roots_7.4.csv b/tests/Chebfun_results/test_roots_7.4.csv similarity index 100% rename from Chebfun_results/test_roots_7.4.csv rename to tests/Chebfun_results/test_roots_7.4.csv diff --git a/Chebfun_results/test_roots_8.1.csv b/tests/Chebfun_results/test_roots_8.1.csv similarity index 100% rename from Chebfun_results/test_roots_8.1.csv rename to tests/Chebfun_results/test_roots_8.1.csv diff --git a/Chebfun_results/test_roots_8.2.csv b/tests/Chebfun_results/test_roots_8.2.csv similarity index 100% rename from Chebfun_results/test_roots_8.2.csv rename to tests/Chebfun_results/test_roots_8.2.csv diff --git a/Chebfun_results/test_roots_9.1.csv b/tests/Chebfun_results/test_roots_9.1.csv similarity index 100% rename from Chebfun_results/test_roots_9.1.csv rename to tests/Chebfun_results/test_roots_9.1.csv diff --git a/Chebfun_results/test_roots_9.2.csv b/tests/Chebfun_results/test_roots_9.2.csv similarity index 100% rename from Chebfun_results/test_roots_9.2.csv rename to tests/Chebfun_results/test_roots_9.2.csv diff --git a/Polished_results/polished_1.1.npy b/tests/Polished_results/polished_1.1.npy similarity index 100% rename from Polished_results/polished_1.1.npy rename to tests/Polished_results/polished_1.1.npy diff --git a/Polished_results/polished_1.2.npy b/tests/Polished_results/polished_1.2.npy similarity index 100% rename from Polished_results/polished_1.2.npy rename to tests/Polished_results/polished_1.2.npy diff --git a/Polished_results/polished_1.3.npy b/tests/Polished_results/polished_1.3.npy similarity index 100% rename from Polished_results/polished_1.3.npy rename to tests/Polished_results/polished_1.3.npy diff --git a/Polished_results/polished_1.4.npy b/tests/Polished_results/polished_1.4.npy similarity index 100% rename from Polished_results/polished_1.4.npy rename to tests/Polished_results/polished_1.4.npy diff --git a/Polished_results/polished_1.5.npy b/tests/Polished_results/polished_1.5.npy similarity index 100% rename from Polished_results/polished_1.5.npy rename to tests/Polished_results/polished_1.5.npy diff --git a/Polished_results/polished_10.1.npy b/tests/Polished_results/polished_10.1.npy similarity index 100% rename from Polished_results/polished_10.1.npy rename to tests/Polished_results/polished_10.1.npy diff --git a/Polished_results/polished_2.1.npy b/tests/Polished_results/polished_2.1.npy similarity index 100% rename from Polished_results/polished_2.1.npy rename to tests/Polished_results/polished_2.1.npy diff --git a/Polished_results/polished_2.2.npy b/tests/Polished_results/polished_2.2.npy similarity index 100% rename from Polished_results/polished_2.2.npy rename to tests/Polished_results/polished_2.2.npy diff --git a/Polished_results/polished_2.3.npy b/tests/Polished_results/polished_2.3.npy similarity index 100% rename from Polished_results/polished_2.3.npy rename to tests/Polished_results/polished_2.3.npy diff --git a/Polished_results/polished_2.4.npy b/tests/Polished_results/polished_2.4.npy similarity index 100% rename from Polished_results/polished_2.4.npy rename to tests/Polished_results/polished_2.4.npy diff --git a/Polished_results/polished_2.5.npy b/tests/Polished_results/polished_2.5.npy similarity index 100% rename from Polished_results/polished_2.5.npy rename to tests/Polished_results/polished_2.5.npy diff --git a/Polished_results/polished_3.1.npy b/tests/Polished_results/polished_3.1.npy similarity index 100% rename from Polished_results/polished_3.1.npy rename to tests/Polished_results/polished_3.1.npy diff --git a/Polished_results/polished_3.2.npy b/tests/Polished_results/polished_3.2.npy similarity index 100% rename from Polished_results/polished_3.2.npy rename to tests/Polished_results/polished_3.2.npy diff --git a/Polished_results/polished_4.1.npy b/tests/Polished_results/polished_4.1.npy similarity index 100% rename from Polished_results/polished_4.1.npy rename to tests/Polished_results/polished_4.1.npy diff --git a/Polished_results/polished_4.2.npy b/tests/Polished_results/polished_4.2.npy similarity index 100% rename from Polished_results/polished_4.2.npy rename to tests/Polished_results/polished_4.2.npy diff --git a/Polished_results/polished_5.1.npy b/tests/Polished_results/polished_5.1.npy similarity index 100% rename from Polished_results/polished_5.1.npy rename to tests/Polished_results/polished_5.1.npy diff --git a/Polished_results/polished_6.1.npy b/tests/Polished_results/polished_6.1.npy similarity index 100% rename from Polished_results/polished_6.1.npy rename to tests/Polished_results/polished_6.1.npy diff --git a/Polished_results/polished_6.2.npy b/tests/Polished_results/polished_6.2.npy similarity index 100% rename from Polished_results/polished_6.2.npy rename to tests/Polished_results/polished_6.2.npy diff --git a/Polished_results/polished_6.3.npy b/tests/Polished_results/polished_6.3.npy similarity index 100% rename from Polished_results/polished_6.3.npy rename to tests/Polished_results/polished_6.3.npy diff --git a/Polished_results/polished_7.1.npy b/tests/Polished_results/polished_7.1.npy similarity index 100% rename from Polished_results/polished_7.1.npy rename to tests/Polished_results/polished_7.1.npy diff --git a/Polished_results/polished_7.2.npy b/tests/Polished_results/polished_7.2.npy similarity index 100% rename from Polished_results/polished_7.2.npy rename to tests/Polished_results/polished_7.2.npy diff --git a/Polished_results/polished_7.3.npy b/tests/Polished_results/polished_7.3.npy similarity index 100% rename from Polished_results/polished_7.3.npy rename to tests/Polished_results/polished_7.3.npy diff --git a/Polished_results/polished_7.4.npy b/tests/Polished_results/polished_7.4.npy similarity index 100% rename from Polished_results/polished_7.4.npy rename to tests/Polished_results/polished_7.4.npy diff --git a/Polished_results/polished_8.1.npy b/tests/Polished_results/polished_8.1.npy similarity index 100% rename from Polished_results/polished_8.1.npy rename to tests/Polished_results/polished_8.1.npy diff --git a/Polished_results/polished_8.2.npy b/tests/Polished_results/polished_8.2.npy similarity index 100% rename from Polished_results/polished_8.2.npy rename to tests/Polished_results/polished_8.2.npy diff --git a/Polished_results/polished_9.1.npy b/tests/Polished_results/polished_9.1.npy similarity index 100% rename from Polished_results/polished_9.1.npy rename to tests/Polished_results/polished_9.1.npy diff --git a/Polished_results/polished_9.2.npy b/tests/Polished_results/polished_9.2.npy similarity index 100% rename from Polished_results/polished_9.2.npy rename to tests/Polished_results/polished_9.2.npy diff --git a/chebfun2_suite.py b/tests/chebfun2_suite.py similarity index 100% rename from chebfun2_suite.py rename to tests/chebfun2_suite.py diff --git a/tests/test_parallelization.py b/tests/test_parallelization.py index 7b8255f0..78f9509c 100644 --- a/tests/test_parallelization.py +++ b/tests/test_parallelization.py @@ -29,7 +29,7 @@ MAX_CPU = 4 PARALLEL_DEPTH = 2 -POLISHED_DIR = os.path.join(os.path.dirname(__file__), "../Polished_results") +POLISHED_DIR = os.path.join(os.path.dirname(__file__), "./Polished_results") # --------------------------------------------------------------------------- @@ -37,7 +37,7 @@ # --------------------------------------------------------------------------- def load_polished(test_num): - """Load polished roots from ../Polished_results/polished_{test_num}.npy""" + """Load polished roots from ./Polished_results/polished_{test_num}.npy""" path = os.path.join(POLISHED_DIR, f"polished_{test_num}.npy") roots = np.load(path) if roots.ndim == 1: From 437597951fed121535e0115dd1defd13837fdebd Mon Sep 17 00:00:00 2001 From: JarvisRAs Date: Tue, 26 May 2026 15:52:01 -0600 Subject: [PATCH 33/36] Fixed test filepath --- tests/test_Combined_Solver.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/test_Combined_Solver.py b/tests/test_Combined_Solver.py index 3a3cd04b..26c7db08 100644 --- a/tests/test_Combined_Solver.py +++ b/tests/test_Combined_Solver.py @@ -227,8 +227,7 @@ def test_exact_option(): Then we make sure we got the same roots between the two, and that those roots are correct. """ - THIS_DIR = Path(__file__).resolve().parent # .../tests - ROOT_DIR = THIS_DIR.parent # repo root (if tests/ is at root) + ROOT_DIR = Path(__file__).resolve().parent actual_roots_path = ROOT_DIR / "Polished_results" / "polished_2.3.npy" chebfun_roots_path = ROOT_DIR / "Chebfun_results" / "test_roots_2.3.csv" From 7550770673696e6993c1325d03cdf50219c93363 Mon Sep 17 00:00:00 2001 From: JarvisRAs Date: Fri, 29 May 2026 15:32:50 -0600 Subject: [PATCH 34/36] Fix code so it catches singular roots as well --- tests/test_parallelization.py | 106 +++++++++++++-------------- yroots/ChebyshevSubdivisionSolver.py | 20 +++-- 2 files changed, 66 insertions(+), 60 deletions(-) diff --git a/tests/test_parallelization.py b/tests/test_parallelization.py index 78f9509c..d789d82a 100644 --- a/tests/test_parallelization.py +++ b/tests/test_parallelization.py @@ -225,49 +225,49 @@ def run_parallel(tc): a_max = [ 1, 1], tol = DEFAULT_TOL, ), - # dict( - # id = "4.2", - # desc = "Test 4.2 – high-degree polynomial system, 2 roots", - # f = lambda x, y: ( - # 90000*y**10 - 1440000*y**9 + - # (360000*x**4 + 720000*x**3 + 504400*x**2 + 144400*x + 9971200)*y**8 + - # (-4680000*x**4 - 9360000*x**3 - 6412800*x**2 - 1732800*x - 39554400)*y**7 + - # (540000*x**8 + 2160000*x**7 + 3817600*x**6 + 3892800*x**5 + 27577600*x**4 + - # 51187200*x**3 + 34257600*x**2 + 8952800*x + 100084400)*y**6 + - # (-5400000*x**8 - 21600000*x**7 - 37598400*x**6 - 37195200*x**5 - 95198400*x**4 - - # 153604800*x**3 - 100484000*x**2 - 26280800*x - 169378400)*y**5 + - # (360000*x**12 + 2160000*x**11 + 6266400*x**10 + 11532000*x**9 + 34831200*x**8 + - # 93892800*x**7 + 148644800*x**6 + 141984000*x**5 + 206976800*x**4 + 275671200*x**3 + - # 176534800*x**2 + 48374000*x + 194042000)*y**4 + - # (-2520000*x**12 - 15120000*x**11 - 42998400*x**10 - 76392000*x**9 - 128887200*x**8 - - # 223516800*x**7 - 300675200*x**6 - 274243200*x**5 - 284547200*x**4 - 303168000*x**3 - - # 190283200*x**2 - 57471200*x - 147677600)*y**3 + - # (90000*x**16 + 720000*x**15 + 3097600*x**14 + 9083200*x**13 + 23934400*x**12 + - # 58284800*x**11 + 117148800*x**10 + 182149600*x**9 + 241101600*x**8 + 295968000*x**7 + - # 320782400*x**6 + 276224000*x**5 + 236601600*x**4 + 200510400*x**3 + 123359200*x**2 + - # 43175600*x + 70248800)*y**2 + - # (-360000*x**16 - 2880000*x**15 - 11812800*x**14 - 32289600*x**13 - 66043200*x**12 - - # 107534400*x**11 - 148807200*x**10 - 184672800*x**9 - 205771200*x**8 - 196425600*x**7 - - # 166587200*x**6 - 135043200*x**5 - 107568800*x**4 - 73394400*x**3 - 44061600*x**2 - - # 18772000*x - 17896000)*y + - # (144400*x**18 + 1299600*x**17 + 5269600*x**16 + 12699200*x**15 + 21632000*x**14 + - # 32289600*x**13 + 48149600*x**12 + 63997600*x**11 + 67834400*x**10 + 61884000*x**9 + - # 55708800*x**8 + 45478400*x**7 + 32775200*x**6 + 26766400*x**5 + 21309200*x**4 + - # 11185200*x**3 + 6242400*x**2 + 3465600*x + 1708800) - # ), - # g = lambda x, y: 1e-4 * ( - # y**7 - 3*y**6 + - # (2*x**2 - x + 2)*y**5 + - # (x**3 - 6*x**2 + x + 2)*y**4 + - # (x**4 - 2*x**3 + 2*x**2 + x - 3)*y**3 + - # (2*x**5 - 3*x**4 + x**3 + 10*x**2 - x + 1)*y**2 + - # (-x**5 + 3*x**4 + 4*x**3 - 12*x**2)*y + - # (x**7 - 3*x**5 - x**4 - 4*x**3 + 4*x**2) - # ), - # a_min = [-1, -1], - # a_max = [ 1, 1], - # tol = DEFAULT_TOL, - # ), + dict( + id = "4.2", + desc = "Test 4.2 – high-degree polynomial system, 2 roots", + f = lambda x, y: ( + 90000*y**10 - 1440000*y**9 + + (360000*x**4 + 720000*x**3 + 504400*x**2 + 144400*x + 9971200)*y**8 + + (-4680000*x**4 - 9360000*x**3 - 6412800*x**2 - 1732800*x - 39554400)*y**7 + + (540000*x**8 + 2160000*x**7 + 3817600*x**6 + 3892800*x**5 + 27577600*x**4 + + 51187200*x**3 + 34257600*x**2 + 8952800*x + 100084400)*y**6 + + (-5400000*x**8 - 21600000*x**7 - 37598400*x**6 - 37195200*x**5 - 95198400*x**4 - + 153604800*x**3 - 100484000*x**2 - 26280800*x - 169378400)*y**5 + + (360000*x**12 + 2160000*x**11 + 6266400*x**10 + 11532000*x**9 + 34831200*x**8 + + 93892800*x**7 + 148644800*x**6 + 141984000*x**5 + 206976800*x**4 + 275671200*x**3 + + 176534800*x**2 + 48374000*x + 194042000)*y**4 + + (-2520000*x**12 - 15120000*x**11 - 42998400*x**10 - 76392000*x**9 - 128887200*x**8 - + 223516800*x**7 - 300675200*x**6 - 274243200*x**5 - 284547200*x**4 - 303168000*x**3 - + 190283200*x**2 - 57471200*x - 147677600)*y**3 + + (90000*x**16 + 720000*x**15 + 3097600*x**14 + 9083200*x**13 + 23934400*x**12 + + 58284800*x**11 + 117148800*x**10 + 182149600*x**9 + 241101600*x**8 + 295968000*x**7 + + 320782400*x**6 + 276224000*x**5 + 236601600*x**4 + 200510400*x**3 + 123359200*x**2 + + 43175600*x + 70248800)*y**2 + + (-360000*x**16 - 2880000*x**15 - 11812800*x**14 - 32289600*x**13 - 66043200*x**12 - + 107534400*x**11 - 148807200*x**10 - 184672800*x**9 - 205771200*x**8 - 196425600*x**7 - + 166587200*x**6 - 135043200*x**5 - 107568800*x**4 - 73394400*x**3 - 44061600*x**2 - + 18772000*x - 17896000)*y + + (144400*x**18 + 1299600*x**17 + 5269600*x**16 + 12699200*x**15 + 21632000*x**14 + + 32289600*x**13 + 48149600*x**12 + 63997600*x**11 + 67834400*x**10 + 61884000*x**9 + + 55708800*x**8 + 45478400*x**7 + 32775200*x**6 + 26766400*x**5 + 21309200*x**4 + + 11185200*x**3 + 6242400*x**2 + 3465600*x + 1708800) + ), + g = lambda x, y: 1e-4 * ( + y**7 - 3*y**6 + + (2*x**2 - x + 2)*y**5 + + (x**3 - 6*x**2 + x + 2)*y**4 + + (x**4 - 2*x**3 + 2*x**2 + x - 3)*y**3 + + (2*x**5 - 3*x**4 + x**3 + 10*x**2 - x + 1)*y**2 + + (-x**5 + 3*x**4 + 4*x**3 - 12*x**2)*y + + (x**7 - 3*x**5 - x**4 - 4*x**3 + 4*x**2) + ), + a_min = [-1, -1], + a_max = [ 1, 1], + tol = 1e-6, + ), dict( id = "5.1", desc = "Test 5.1 – trig system, 10 roots", @@ -277,15 +277,15 @@ def run_parallel(tc): a_max = [ 2, 2], tol = DEFAULT_TOL, ), - # dict( - # id = "6.1", - # desc = "Test 6.1 – line/circle system, 5 roots", - # f = lambda x, y: (y - 2*x) * (y + 0.5*x), - # g = lambda x, y: x * (x**2 + y**2 - 1), - # a_min = [-1, -1], - # a_max = [ 1, 1], - # tol = 2.220446049250313e-8, - # ), + dict( + id = "6.1", + desc = "Test 6.1 – line/circle system, 5 roots", + f = lambda x, y: (y - 2*x) * (y + 0.5*x), + g = lambda x, y: x * (x**2 + y**2 - 1), + a_min = [-1, -1], + a_max = [ 1, 1], + tol = 2.220446049250313e-8, + ), ] _ids = [tc["id"] for tc in TEST_CASES] @@ -314,8 +314,6 @@ def test_root_count(self, test_case): print(tc["polished"]) try: roots = run_serial(tc) - print(roots) - except RecursionError: pytest.fail(f"{tc['desc']}: serial solve() hit maximum recursion depth.") roots = np.atleast_2d(roots) diff --git a/yroots/ChebyshevSubdivisionSolver.py b/yroots/ChebyshevSubdivisionSolver.py index 2f608646..52190035 100644 --- a/yroots/ChebyshevSubdivisionSolver.py +++ b/yroots/ChebyshevSubdivisionSolver.py @@ -1289,15 +1289,13 @@ def finish_subdivision_state(state, childInterior, childExterior): else: return [trackedInterval], [] - # Combine all roots that converged to the same point. - allFoundRoots = set() + # Combine all roots that converged to the same point. Use interval overlap + # (not exact lower-bound match) so singular roots whose sub-intervals differ + # by floating-point noise still collapse to one. tempResults = [] - for result in resultsAll: - point = tuple(result.interval[:, 0]) - if point in allFoundRoots: + if any(result.overlapsWith(kept) for kept in tempResults): continue - allFoundRoots.add(point) tempResults.append(result) for result in tempResults: @@ -1878,6 +1876,16 @@ def solveChebyshevSubdivision(Ms, errors, verbose = False, returnBoundingBoxes = b1, b2 = solvePoly(Ms, originalInterval, errors, solverOptions) boundingIntervals = b1 + b2 + # Dedup overlapping final bounding intervals. The in-recursion merge only compares + # siblings on resultExterior, so singular roots reached from multiple recursion + # branches survive as separate interior intervals. Overlapping final boxes cannot + # enclose distinct roots, so collapse them here. + dedupedIntervals = [] + for interval in boundingIntervals: + if not any(interval.overlapsWith(kept) for kept in dedupedIntervals): + dedupedIntervals.append(interval) + boundingIntervals = dedupedIntervals + roots = [] hasDupRoots = False hasExtraRoots = False From 52913f103ed25af37056721bc0a11cd5195d0756 Mon Sep 17 00:00:00 2001 From: JarvisRAs Date: Fri, 29 May 2026 16:16:11 -0600 Subject: [PATCH 35/36] Docstring fixes --- yroots/ChebyshevApproximator.py | 31 ++++-- yroots/ChebyshevSubdivisionSolver.py | 158 ++++++++++++++++++++------- yroots/QuadraticCheck.py | 40 +++++-- yroots/polynomial.py | 68 +++++++++--- 4 files changed, 223 insertions(+), 74 deletions(-) diff --git a/yroots/ChebyshevApproximator.py b/yroots/ChebyshevApproximator.py index aa53c4fc..b2da9494 100644 --- a/yroots/ChebyshevApproximator.py +++ b/yroots/ChebyshevApproximator.py @@ -1,3 +1,10 @@ +"""Chebyshev approximation utilities used by :mod:`yroots.Combined_Solver`. + +Provides :func:`chebApproximate` (the public entry point) along with the +helpers it relies on to choose a degree per dimension, evaluate on the +Chebyshev grid via :func:`scipy.fftpack.dctn`, and estimate the approximation +error. +""" import numpy as np from numba import njit from yroots.polynomial import MultiCheb, MultiPower @@ -35,12 +42,12 @@ def interval_approximate_nd(f, degs, a, b, retSupNorm = False): ---------- f : function from R^n -> R The function to interpolate. + degs : list of ints + A list of the degree of interpolation in each dimension. a : numpy array The lower bound on the interval. b : numpy array The upper bound on the interval. - degs : list of ints - A list of the degree of interpolation in each dimension. retSupNorm : bool Whether to return the sup norm of the function. @@ -144,6 +151,11 @@ def getFinalDegree(coeff,tol,macheps = 2**-52): ---------- coeff : numpy array Absolute values of chebyshev coefficients. + tol : float + Tolerance below which a coefficient is treated as zero when deciding whether ``f`` is + effectively constant (in which case the returned degree is 0). + macheps : float + Machine epsilon used as the floor when computing ``epsVal``. Defaults to ``2**-52``. Returns ------- @@ -187,11 +199,16 @@ def checkConstantInDimension(f,a,b,currDim, relApproxTol, absApproxTol = 0): The upper bound on the interval. currDim : int The dimension being examined. - + relApproxTol : float + Relative tolerance passed to :func:`numpy.isclose`/:func:`numpy.allclose` when comparing + function evaluations to decide whether ``f`` varies along ``currDim``. + absApproxTol : float + Absolute tolerance passed to :func:`numpy.isclose`/:func:`numpy.allclose`. Defaults to 0. + Returns ------- is_constant : bool - Whether the dimension is constant in dimension currDim. Returns False if the test is + Whether ``f`` is constant in dimension ``currDim``. Returns False if the test is indeterminate or f is seen to vary with different values of x[dim]. Returns True otherwise. """ if isinstance(f,MultiPower) or isinstance(f,MultiCheb): # Points evaluated differently for these @@ -299,7 +316,7 @@ def getChebyshevDegrees(f, a, b, relApproxTol, absApproxTol = 0): coeff2, supNorm2 = interval_approximate_nd(f, degs, a, b, retSupNorm=True) tol = absApproxTol + max(supNorm, supNorm2) * relApproxTol if not hasConverged(coeff, coeff2, tol): - continue # Keed doubling if the coefficients have not fully converged. + continue # Keep doubling if the coefficients have not fully converged. # The coefficients have been shown to converge to 0. Get the exact degree where this occurs. coeffChunk = np.average(np.abs(coeff2), axis=tupleForChunk) @@ -371,7 +388,7 @@ def chebApproximate(f, a, b, relApproxTol=1e-10): -------- >>> f = lambda x,y,z: x**2 - y**2 + 3*x*y - >>> approx, error = yroots.approximate(f,[-1,-1,-1],[1,1,1]) + >>> approx, error = yroots.chebApproximate(f,[-1,-1,-1],[1,1,1]) >>> print(approx) [[[ 0.00000000e+00] [ 1.11022302e-16] @@ -386,7 +403,7 @@ def chebApproximate(f, a, b, relApproxTol=1e-10): 2.8014584982224306e-24 >>> g = np.sqrt - >>> approx = yroots.approximate(g,[0],[5])[0] + >>> approx = yroots.chebApproximate(g,[0],[5])[0] >>> print(approx) [ 1.42352509e+00 9.49016725e-01 -1.89803345e-01 ... -1.24418041e-10 1.24418045e-10 -6.22090244e-11] diff --git a/yroots/ChebyshevSubdivisionSolver.py b/yroots/ChebyshevSubdivisionSolver.py index 52190035..44f0e196 100644 --- a/yroots/ChebyshevSubdivisionSolver.py +++ b/yroots/ChebyshevSubdivisionSolver.py @@ -1,3 +1,11 @@ +"""Chebyshev subdivision root solver. + +Implements the recursive solver invoked by :func:`yroots.Combined_Solver.solve`. The +core entry point is :func:`solveChebyshevSubdivision`; the rest of the module +provides the supporting primitives (linear-system bounding, transformation of +Chebyshev coefficients, subdivision bookkeeping via :class:`TrackedInterval`, +and an optional multilevel parallel driver). +""" import numpy as np from numba import njit, float64 from numba.types import UniTuple @@ -7,13 +15,18 @@ import copy import warnings -# Edit number 1 from dataclasses import dataclass from concurrent.futures import ThreadPoolExecutor, wait, FIRST_COMPLETED -# Edit Edit @dataclass class SolveTask: + """One unit of work for the multilevel parallel driver. + + Holds the Chebyshev coefficient tensors, the :class:`TrackedInterval` they + are being solved on, the per-poly approximation error bounds, and the + bookkeeping (parent id, subdivision depth) needed to reassemble results + once child tasks finish. + """ Ms: object trackedInterval: object errors: object @@ -43,7 +56,6 @@ class TaskResult: exterior: list childTasks: list subdivisionState: SubdivisionState | None = None -# End Edit class SolverOptions(): """Settings for running interval checks, transformations, and subdivision in solvePolyRecursive. @@ -64,7 +76,17 @@ class SolverOptions(): Maximum number of zooms allowed before subdividing (prevents infinite infintesimal shrinking) level : int Depth of subdivision for the given interval. + max_cpu : int + Defaults to 1. Maximum number of worker processes the multilevel parallel driver may use. + allowParallel : bool + Defaults to True. Whether parallel dispatch is allowed for this solve. Workers flip this to + False on their copy of the options to prevent nested parallelism. + parallel_depth : float + Subdivision depth below which child tasks are pushed to the process pool. Tasks at or beyond + this depth solve their children serially in the worker, avoiding scheduling overhead on + tiny tasks. Defaults to ``np.inf`` (i.e. fully serial). """ + def __init__(self): #Init all the Options to default value self.verbose = False @@ -75,14 +97,9 @@ def __init__(self): self.maxZoomCount = 25 self.level = 0 - # Edit number 2 - # Parameters for parallelization self.max_cpu = 1 self.allowParallel = True - # Subdivision depth below which child tasks are pushed to the process - # pool. Tasks at or beyond this depth solve their children serially in - # the worker, avoiding the scheduling overhead of tiny tasks. - self.parallel_depth = np.inf + self.parallel_depth = 0 def copy(self): return copy.copy(self) #Return shallow copy, everything should be a basic type @@ -423,28 +440,35 @@ class TrackedInterval: Parameters ---------- - topInterval: numpy array - The original interval before any changes - interval: numpy array - The current interval (lower bound and upper bound for each dimension in order) - transforms: list - List of the alpha and beta values for all the transformations the interval has undergone - ndim: int - The number of dimensions of which the interval consists - empty: bool - Whether the interval is known to contain no roots - finalStep: bool - Whether the interval is in the final step (zooming in on the bounding box to a point at the end) - canThrowOutFinalStep: bool + interval : numpy array + The starting interval, shape ``(ndim, 2)`` with each row holding the lower and upper bound + for one dimension. Stored as both ``topInterval`` (the original) and ``interval`` (the + current, mutable bounds). + + Attributes + ---------- + topInterval : numpy array + The original interval before any changes. + interval : numpy array + The current interval (lower bound and upper bound for each dimension in order). + transforms : list + List of the alpha and beta values for all the transformations the interval has undergone. + ndim : int + The number of dimensions of which the interval consists. + empty : bool + Whether the interval is known to contain no roots. + finalStep : bool + Whether the interval is in the final step (zooming in on the bounding box to a point at the end). + canThrowOutFinalStep : bool Defaults to False. Whether or not the interval should be thrown out if empty in the final step of solving. Changed to True if subdivision occurs in the final step. - possibleDuplicateRoots: list + possibleDuplicateRoots : list Any multiple roots found through subdivision in the final step that would have been - returned as just one root before the final step - possibleExtraRoot: bool + returned as just one root before the final step. + possibleExtraRoot : bool Defaults to False. Whether or not the interval would have been thrown out during the final step. - nextTransformPoints: numpy array - Where the midpoint of the next subdivision should be for each dimension + nextTransformPoints : numpy array + Where the midpoint of the next subdivision should be for each dimension. """ def __init__(self, interval): self.topInterval = interval @@ -465,7 +489,7 @@ def canThrowOut(self): def addTransform(self, subInterval): """Adds the next alpha and beta values to the list transforms and updates the current interval. - Parameters: + Parameters ----------- subInterval : numpy array The subinterval to which the current interval is being reduced @@ -681,17 +705,19 @@ def BoundingIntervalLinearSystem(Ms, errors, finalStep, macheps = 2**-52): The maximum error of chebyshev approximations finalStep : bool Whether we are in the final step of the algorithm + macheps : float + Machine epsilon used when bounding the linear system. Defaults to ``2**-52``. Returns ------- newInterval : numpy array - The smaller interval where any root must be + The smaller interval where any root must be, shape ``(dim, 2)``. changed : bool - Whether the interval has shrunk at all + Whether the interval has shrunk at all. should_stop : bool - Whether we should stop subdividing - throwout : - Whether we should throw out the interval entirely + Whether we should stop subdividing. + throwout : bool + Whether the interval can be discarded entirely (no root is possible inside it). """ if finalStep: errors = np.zeros_like(errors) @@ -834,7 +860,7 @@ def TwoProd(a,b): y=a2*b2-(((x-a1*b1)-a2*b1)-a1*b2) return x,y def TwoProd_NoNumba(a,b): - """Returns x,y such that a*b=x+y exactly and a*b=x in floating point without usin numba.""" + """Returns x,y such that a*b=x+y exactly and a*b=x in floating point without using numba.""" x = a*b a1,a2 = Split_NoNumba(a) b1,b2 = Split_NoNumba(b) @@ -1219,8 +1245,28 @@ def isExteriorInterval(originalInterval, trackedInterval): """Determines if the current interval is exterior to its original interval.""" return np.any(trackedInterval.getIntervalForCombining() == originalInterval.getIntervalForCombining()) -# Edit Edit def make_child_tasks(allMs, allErrors, allIntervals, parent_id=None, level=0): + """Bundle subdivided children into :class:`SolveTask` records for the parallel driver. + + Parameters + ---------- + allMs : iterable + One coefficient-tensor list per child interval. + allErrors : iterable + Per-poly error bounds, aligned with ``allMs``. + allIntervals : iterable of TrackedInterval + The child intervals produced by subdivision. + parent_id : int or None + Identifier of the parent interval whose results these children feed into. ``None`` for + top-level tasks. + level : int + Subdivision depth assigned to each child task. + + Returns + ------- + list of SolveTask + One task per child interval, ready to be queued. + """ return [ SolveTask(newMs, newInt, newErrs, parent_id=parent_id, level=level) for newMs, newErrs, newInt in zip(allMs, allErrors, allIntervals) @@ -1418,10 +1464,30 @@ def finish_subdivision_state(state, childInterior, childExterior): def solvePolyParallelMultilevel(Ms, trackedInterval, errors, solverOptions): - """ - Multilevel parallel driver. + """Multilevel parallel driver for the subdivision solver. + Submits :class:`SolveTask` units to a :class:`ThreadPoolExecutor` sized by + ``solverOptions.max_cpu``. Each worker solves one task until it either finishes or + subdivides; subdivided tasks come back with child tasks that are queued and joined to their + parent via :func:`finish_subdivision_state`. This is the only place where a process pool is + created — workers themselves run with ``allowParallel`` disabled to prevent nested pools. - This is the only place where a process pool is created. + Parameters + ---------- + Ms : list of numpy arrays + Chebyshev coefficient tensors for the top-level interval. + trackedInterval : TrackedInterval + The interval to solve over. + errors : numpy array + Per-poly approximation error bounds. + solverOptions : SolverOptions + Options for the solve. ``max_cpu`` and ``parallel_depth`` are read here. + + Returns + ------- + finalInterior : list of TrackedInterval + Intervals strictly inside the original domain that contain a root. + finalExterior : list of TrackedInterval + Intervals on the boundary of the original domain that contain a root. """ max_workers = max(1, solverOptions.max_cpu) @@ -1824,7 +1890,7 @@ def solvePoly(Ms, trackedInterval, errors, solverOptions): ) def solveChebyshevSubdivision(Ms, errors, verbose = False, returnBoundingBoxes = False, exact = False, constant_check = True, - low_dim_quadratic_check = True,all_dim_quadratic_check = False, max_cpu=1, parallel_depth=1): + low_dim_quadratic_check = True,all_dim_quadratic_check = False, max_cpu=1, parallel_depth=0): """Initiates shrinking and subdivision recursion and returns the roots and bounding boxes. Parameters @@ -1845,13 +1911,21 @@ def solveChebyshevSubdivision(Ms, errors, verbose = False, returnBoundingBoxes = Defaults to True. Whether or not to run quadratic check in dim 2, 3. all_dim_quadratic_check : bool Defaults to False. Whether or not to run quadratic check in dim >= 4. + max_cpu : int + Defaults to 1. Maximum number of CPUs to use when dispatching subdivided regions to the + multilevel parallel driver. One CPU is reserved for the main thread, so the worker pool + is sized at ``max_cpu - 1``. + parallel_depth : int + Defaults to 0. Subdivision depth at which child tasks start being pushed to the worker + pool. Higher values keep work serial for longer before parallelizing. Returns ------- roots : list - The roots of the system of functions on the interval given to Combined Solver - boundingBoxes : list of numpy arrays (optional) - List of intervals for each root in which the root is bound to lie. + The roots of the system of functions on the interval given to Combined Solver. Returned + alone when ``returnBoundingBoxes`` is False. + boundingBoxes : list of TrackedInterval + Only returned when ``returnBoundingBoxes`` is True. Bounding intervals for each root. """ #Assert that we have n nD polys if np.any([M.ndim != len(Ms) for M in Ms]): diff --git a/yroots/QuadraticCheck.py b/yroots/QuadraticCheck.py index 1a910457..ce5f2b08 100644 --- a/yroots/QuadraticCheck.py +++ b/yroots/QuadraticCheck.py @@ -1,3 +1,11 @@ +"""Quadratic subinterval checks used by the Chebyshev subdivision solver. + +Each ``quadratic_check_*`` routine extracts the quadratic part of a Chebyshev +coefficient tensor and bounds it against the absolute sum of the remaining +terms. If those bounds rule out a zero on the current subinterval, the check +returns ``True`` so the solver can discard the box. The :func:`quadratic_check` +dispatcher picks the dimension-specialized routine. +""" import numpy as np import itertools from scipy import linalg as la @@ -23,13 +31,29 @@ def get_fixed_vars(dim): for r in range(dim-1,0,-1))) def quadratic_check(test_coeff, tol, nd_check=False): + """Dispatch to the dimension-specialized quadratic check. + + Parameters + ---------- + test_coeff : numpy array + The coefficient matrix of the polynomial to check. + tol : float + The bound of the sup norm error of the Chebyshev approximation. + nd_check : bool + If True, always use :func:`quadratic_check_nd` regardless of dimension. Defaults to False, + which dispatches to :func:`quadratic_check_2D` or :func:`quadratic_check_3D` when possible. + + Returns + ------- + bool + True if the polynomial is guaranteed to have no zero on the unit box, False otherwise. + """ if test_coeff.ndim == 2 and not nd_check: return quadratic_check_2D(test_coeff, tol) elif test_coeff.ndim == 3 and not nd_check: return quadratic_check_3D(test_coeff, tol) else: return quadratic_check_nd(test_coeff, tol) - #return quadratic_check_nd(test_coeff, tol) def quadratic_check_2D(test_coeff, tol): """One of subinterval_checks @@ -79,7 +103,7 @@ def quadratic_check_2D(test_coeff, tol): other_sum = np.sum(np.abs(test_coeff)) - sum([fabs(coeff) for coeff in c]) + tol # Function for evaluating c0 + c1 T_1(x) + c2 T_1(y) +c3 T_2(x) + c4 T_1(x)T_1(y) + c5 T_2(y) - # Use the Horner form because it is much faster, also do any repeated computatons in advance + # Use the Horner form because it is much faster, also do any repeated computations in advance k0 = c[0]-c[3]-c[5] k3 = 2*c[3] k5 = 2*c[5] @@ -198,9 +222,8 @@ def quadratic_check_3D(test_coeff, tol): Returns ------- - mask : list - A list of the results of each interval. False if the function is guarenteed to never be zero - in the unit box, True otherwise + bool + True if the function is guaranteed to never be zero in the unit box, False otherwise. """ if test_coeff.ndim != 3: return False @@ -529,14 +552,15 @@ def quadratic_check_nd(test_coeff, tol): Parameters ---------- - test_coeff_in : numpy array + test_coeff : numpy array The coefficient matrix of the polynomial to check tol: float The bound of the sup norm error of the chebyshev approximation. Returns ------- - True if there is guaranteed to be no root in the interval, False otherwise + bool + True if there is guaranteed to be no root in the interval, False otherwise. """ #get the dimension and make sure the coeff tensor has all the right # quadratic coeff spots, set to zero if necessary @@ -545,7 +569,7 @@ def quadratic_check_nd(test_coeff, tol): test_coeff = np.pad(test_coeff.copy(), padding, mode='constant') interval = [-np.ones(dim), np.ones(dim)] - #Possible extrema of qudaratic part are where D_xk = 0 for some subset of the variables xk + #Possible extrema of quadratic part are where D_xk = 0 for some subset of the variables xk # with the other variables are fixed to a boundary value #Dxk = c[0,...,0,1,0,...0] (k-spot is 1) + 4c[0,...,0,2,0,...0] xk (k-spot is 2) # + \Sum_{j\neq k} xj c[0,...,0,1,0,...,0,1,0,...0] (k and j spot are 1) diff --git a/yroots/polynomial.py b/yroots/polynomial.py index 21f0131f..7e9fa2ae 100644 --- a/yroots/polynomial.py +++ b/yroots/polynomial.py @@ -1,3 +1,9 @@ +"""Coefficient-tensor polynomial types used throughout yroots. + +Defines :class:`MultiCheb` and :class:`MultiPower` (both subclasses of the +:class:`Polynomial` base) for representing multivariate polynomials by their +coefficient tensor, plus the small helpers used to evaluate them efficiently. +""" import numpy as np from scipy.signal import convolve from numpy.polynomial import chebyshev as cheb @@ -22,17 +28,17 @@ def slice_top(matrix_shape): def match_size(a,b): ''' - Matches the shape of two matrixes. + Matches the shape of two matrices. Parameters ---------- a, b : ndarray - Matrixes whose size is to be matched. + Matrices whose size is to be matched. Returns ------- a, b : ndarray - Matrixes of equal size. + Matrices of equal size. ''' new_shape = np.maximum(a.shape, b.shape) @@ -45,6 +51,20 @@ def match_size(a,b): ############ Fast polynomial evaluation functions ############ def polyval(x, cc): + '''Horner evaluation of a power-basis polynomial along the leading axis of ``cc``. + + Parameters + ---------- + x : numpy array + Points at which to evaluate. + cc : numpy array + Coefficient array whose first axis indexes the polynomial degree. + + Returns + ------- + numpy array + Polynomial values, with the leading degree axis consumed. + ''' c0 = cc[-1] for i in range(2, len(cc) + 1): c0 = cc[-i] + c0*x @@ -57,6 +77,20 @@ def polyval2(x, cc): return c0 def chebval(x, cc): + '''Clenshaw evaluation of a Chebyshev-basis polynomial along the leading axis of ``cc``. + + Parameters + ---------- + x : numpy array + Points at which to evaluate. + cc : numpy array + Coefficient array whose first axis indexes the Chebyshev degree. + + Returns + ------- + numpy array + Polynomial values, with the leading degree axis consumed. + ''' if len(cc) == 1: c0 = cc[0] c1 = np.zeros_like(c0) @@ -124,8 +158,6 @@ class Polynomial(object): ------- clean_coeff Removes extra rows, columns, etc of zeroes from end of matrix of coefficients - match_size - Matches the shape of two matrices. __call__ Evaluates a polynomial at a certain point. __eq__ @@ -186,8 +218,10 @@ def __call__(self, points): Returns ------- - : numpy array - valued of the polynomial at the given points + points : numpy array + The validated/reshaped input points. Subclasses (:class:`MultiCheb`, + :class:`MultiPower`) override :meth:`__call__` to return the polynomial values + themselves; the base implementation only normalizes the input. ''' points = np.array(points) if points.ndim == 0: @@ -256,11 +290,11 @@ class MultiCheb(Polynomial): Examples -------- - To represent 4*T_2(x) + 1T_3(x) (using Chebyshev polynomials of the first kind): + To represent 4*T_2(x) + 1*T_3(x) (using Chebyshev polynomials of the first kind): >>> f = yroots.MultiCheb([0,0,4,1]) >>> print(f) - [-4. 0. 5.5 0. 0. 0. 3. ] + [0. 0. 4. 1.] Parameters @@ -353,17 +387,17 @@ def evaluate_grid(self, xyz): Returns ------- - values: complex + values : numpy array The polynomial evaluated at all of the points in the grid determined by - the axis values + the axis values. Returns a scalar when the grid contains a single point. ''' xyz = super(MultiCheb, self).__call__(xyz) c = self.coeff for i in range(xyz.shape[1]): - cc = c.reshape(c.shape + (1,)*xyz[:,i].ndim) - c = chebval2(xyz[:,i] ,cc) + cc = c.reshape(c.shape + (1,)*xyz[:, i].ndim) + c = chebval2(xyz[:, i], cc) if np.product(c.shape)==1: return c[0] @@ -511,8 +545,8 @@ def __call__(self, points): Returns ------- - __call__: complex - value of the polynomial at the given point + c : numpy array + values of the polynomial at the given points ''' points = super(MultiPower, self).__call__(points) @@ -539,9 +573,9 @@ def evaluate_grid(self, xyz): Returns ------- - values: complex + values : numpy array The polynomial evaluated at all of the points in the grid determined by - the axis values + the axis values. Returns a scalar when the grid contains a single point. ''' xyz = super(MultiPower, self).__call__(xyz) From f2607dce30557b7de999a1f0997803652497bf5a Mon Sep 17 00:00:00 2001 From: JarvisRAs Date: Wed, 3 Jun 2026 17:49:47 -0600 Subject: [PATCH 36/36] Remove insignificant test case for efficient testing --- tests/test_Combined_Solver.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/tests/test_Combined_Solver.py b/tests/test_Combined_Solver.py index 26c7db08..35676cc1 100644 --- a/tests/test_Combined_Solver.py +++ b/tests/test_Combined_Solver.py @@ -73,21 +73,6 @@ def test_bivariate(): assert np.max(np.abs(f(roots[:,0],roots[:,1]))) < tol2 assert np.max(np.abs(g(roots[:,0],roots[:,1]))) < tol2 -def test_high_dim(): - f1 = lambda x1, x2, x3, x4, x5: np.cos(x1) + x5 - 1 - f2 = lambda x1, x2, x3, x4, x5: np.cos(x2) + x4 - 2 - f3 = lambda x1, x2, x3, x4, x5: np.cos(x3) + x3 - 3 - f4 = lambda x1, x2, x3, x4, x5: np.cos(x4) + x2 - 4 - f5 = lambda x1, x2, x3, x4, x5: np.cos(x5) + x1 - 5 - - a = [0]*5 - b = [2*np.pi]*5 - - roots = yr.solve([f1,f2,f3,f4,f5],a,b) - - assert len(roots) == 1 - assert np.max([np.abs(f(*[roots[:,i] for i in range(5)])) for f in [f1,f2,f3,f4,f5]]) < tol2 - # Test MultiCheb and MultiPower def test_multiCheb_multiPower(): """