Datasets:
Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .gitattributes +8 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/kiwisolver/_cext.cpython-310-x86_64-linux-gnu.so +3 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/mpmath/__pycache__/function_docs.cpython-310.pyc +3 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/networkx-3.4.2.dist-info/INSTALLER +1 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/networkx-3.4.2.dist-info/LICENSE.txt +37 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/networkx-3.4.2.dist-info/METADATA +165 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/networkx-3.4.2.dist-info/RECORD +584 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/networkx-3.4.2.dist-info/REQUESTED +0 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/networkx-3.4.2.dist-info/WHEEL +5 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/networkx-3.4.2.dist-info/entry_points.txt +2 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/networkx-3.4.2.dist-info/top_level.txt +1 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/__pycache__/__init__.cpython-310.pyc +0 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/__pycache__/_typing.cpython-310.pyc +0 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/__pycache__/_version_meson.cpython-310.pyc +0 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/__pycache__/testing.cpython-310.pyc +0 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_config/__init__.py +57 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_config/__pycache__/__init__.cpython-310.pyc +0 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_config/__pycache__/config.cpython-310.pyc +0 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_config/__pycache__/dates.cpython-310.pyc +0 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_config/__pycache__/display.cpython-310.pyc +0 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_config/__pycache__/localization.cpython-310.pyc +0 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_config/config.py +948 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_config/dates.py +25 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_config/display.py +62 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_config/localization.py +172 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_testing/__init__.py +635 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_testing/__pycache__/__init__.cpython-310.pyc +0 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_testing/__pycache__/_io.cpython-310.pyc +0 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_testing/__pycache__/_warnings.cpython-310.pyc +0 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_testing/__pycache__/asserters.cpython-310.pyc +0 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_testing/__pycache__/compat.cpython-310.pyc +0 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_testing/__pycache__/contexts.cpython-310.pyc +0 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_testing/_hypothesis.py +93 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_testing/_io.py +170 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_testing/_warnings.py +232 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_testing/asserters.py +1459 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_testing/compat.py +29 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_testing/contexts.py +261 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/core/arrays/__init__.py +43 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/core/arrays/__pycache__/__init__.cpython-310.pyc +0 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/core/arrays/__pycache__/_arrow_string_mixins.cpython-310.pyc +0 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/core/arrays/__pycache__/_mixins.cpython-310.pyc +0 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/core/arrays/__pycache__/_ranges.cpython-310.pyc +0 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/core/arrays/__pycache__/_utils.cpython-310.pyc +0 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/core/arrays/__pycache__/base.cpython-310.pyc +0 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/core/arrays/__pycache__/boolean.cpython-310.pyc +0 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/core/arrays/__pycache__/categorical.cpython-310.pyc +0 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/core/arrays/__pycache__/datetimelike.cpython-310.pyc +0 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/core/arrays/__pycache__/datetimes.cpython-310.pyc +0 -0
- Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/core/arrays/__pycache__/floating.cpython-310.pyc +0 -0
.gitattributes
CHANGED
|
@@ -1043,3 +1043,11 @@ Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pillow.libs/li
|
|
| 1043 |
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/sympy/polys/matrices/__pycache__/domainmatrix.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
|
| 1044 |
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/sympy/polys/__pycache__/polytools.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
|
| 1045 |
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/sympy/polys/__pycache__/polyquinticconst.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1043 |
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/sympy/polys/matrices/__pycache__/domainmatrix.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
|
| 1044 |
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/sympy/polys/__pycache__/polytools.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
|
| 1045 |
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/sympy/polys/__pycache__/polyquinticconst.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
|
| 1046 |
+
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/kiwisolver/_cext.cpython-310-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text
|
| 1047 |
+
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/yaml/_yaml.cpython-310-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text
|
| 1048 |
+
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/mpmath/__pycache__/function_docs.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
|
| 1049 |
+
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/sqlalchemy/cyextension/immutabledict.cpython-310-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text
|
| 1050 |
+
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/sqlalchemy/cyextension/processors.cpython-310-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text
|
| 1051 |
+
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/sqlalchemy/cyextension/resultproxy.cpython-310-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text
|
| 1052 |
+
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/sqlalchemy/cyextension/util.cpython-310-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text
|
| 1053 |
+
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/sqlalchemy/cyextension/collections.cpython-310-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/kiwisolver/_cext.cpython-310-x86_64-linux-gnu.so
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:03d52e27ca281b4c0d797a08d7b48de89d17814514ef31a3071e0ac92dd0e30d
|
| 3 |
+
size 6666144
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/mpmath/__pycache__/function_docs.cpython-310.pyc
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b68b4ab80588bfcfa91b14b83e455f17edbd82e7b60785fd27ecd7a23d961ff0
|
| 3 |
+
size 283873
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/networkx-3.4.2.dist-info/INSTALLER
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
uv
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/networkx-3.4.2.dist-info/LICENSE.txt
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
NetworkX is distributed with the 3-clause BSD license.
|
| 2 |
+
|
| 3 |
+
::
|
| 4 |
+
|
| 5 |
+
Copyright (C) 2004-2024, NetworkX Developers
|
| 6 |
+
Aric Hagberg <hagberg@lanl.gov>
|
| 7 |
+
Dan Schult <dschult@colgate.edu>
|
| 8 |
+
Pieter Swart <swart@lanl.gov>
|
| 9 |
+
All rights reserved.
|
| 10 |
+
|
| 11 |
+
Redistribution and use in source and binary forms, with or without
|
| 12 |
+
modification, are permitted provided that the following conditions are
|
| 13 |
+
met:
|
| 14 |
+
|
| 15 |
+
* Redistributions of source code must retain the above copyright
|
| 16 |
+
notice, this list of conditions and the following disclaimer.
|
| 17 |
+
|
| 18 |
+
* Redistributions in binary form must reproduce the above
|
| 19 |
+
copyright notice, this list of conditions and the following
|
| 20 |
+
disclaimer in the documentation and/or other materials provided
|
| 21 |
+
with the distribution.
|
| 22 |
+
|
| 23 |
+
* Neither the name of the NetworkX Developers nor the names of its
|
| 24 |
+
contributors may be used to endorse or promote products derived
|
| 25 |
+
from this software without specific prior written permission.
|
| 26 |
+
|
| 27 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
| 28 |
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
| 29 |
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
| 30 |
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
| 31 |
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
| 32 |
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
| 33 |
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
| 34 |
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
| 35 |
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| 36 |
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| 37 |
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/networkx-3.4.2.dist-info/METADATA
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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maintainer-email: NetworkX Developers <networkx-discuss@googlegroups.com>
|
| 7 |
+
Project-URL: Homepage, https://networkx.org/
|
| 8 |
+
Project-URL: Bug Tracker, https://github.com/networkx/networkx/issues
|
| 9 |
+
Project-URL: Documentation, https://networkx.org/documentation/stable/
|
| 10 |
+
Project-URL: Source Code, https://github.com/networkx/networkx
|
| 11 |
+
Keywords: Networks,Graph Theory,Mathematics,network,graph,discrete mathematics,math
|
| 12 |
+
Platform: Linux
|
| 13 |
+
Platform: Mac OSX
|
| 14 |
+
Platform: Windows
|
| 15 |
+
Platform: Unix
|
| 16 |
+
Classifier: Development Status :: 5 - Production/Stable
|
| 17 |
+
Classifier: Intended Audience :: Developers
|
| 18 |
+
Classifier: Intended Audience :: Science/Research
|
| 19 |
+
Classifier: License :: OSI Approved :: BSD License
|
| 20 |
+
Classifier: Operating System :: OS Independent
|
| 21 |
+
Classifier: Programming Language :: Python :: 3
|
| 22 |
+
Classifier: Programming Language :: Python :: 3.10
|
| 23 |
+
Classifier: Programming Language :: Python :: 3.11
|
| 24 |
+
Classifier: Programming Language :: Python :: 3.12
|
| 25 |
+
Classifier: Programming Language :: Python :: 3.13
|
| 26 |
+
Classifier: Programming Language :: Python :: 3 :: Only
|
| 27 |
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
| 28 |
+
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
| 29 |
+
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
| 30 |
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
| 31 |
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
| 32 |
+
Requires-Python: >=3.10
|
| 33 |
+
Description-Content-Type: text/x-rst
|
| 34 |
+
License-File: LICENSE.txt
|
| 35 |
+
Provides-Extra: default
|
| 36 |
+
Requires-Dist: numpy >=1.24 ; extra == 'default'
|
| 37 |
+
Requires-Dist: scipy !=1.11.0,!=1.11.1,>=1.10 ; extra == 'default'
|
| 38 |
+
Requires-Dist: matplotlib >=3.7 ; extra == 'default'
|
| 39 |
+
Requires-Dist: pandas >=2.0 ; extra == 'default'
|
| 40 |
+
Provides-Extra: developer
|
| 41 |
+
Requires-Dist: changelist ==0.5 ; extra == 'developer'
|
| 42 |
+
Requires-Dist: pre-commit >=3.2 ; extra == 'developer'
|
| 43 |
+
Requires-Dist: mypy >=1.1 ; extra == 'developer'
|
| 44 |
+
Requires-Dist: rtoml ; extra == 'developer'
|
| 45 |
+
Provides-Extra: doc
|
| 46 |
+
Requires-Dist: sphinx >=7.3 ; extra == 'doc'
|
| 47 |
+
Requires-Dist: pydata-sphinx-theme >=0.15 ; extra == 'doc'
|
| 48 |
+
Requires-Dist: sphinx-gallery >=0.16 ; extra == 'doc'
|
| 49 |
+
Requires-Dist: numpydoc >=1.8.0 ; extra == 'doc'
|
| 50 |
+
Requires-Dist: pillow >=9.4 ; extra == 'doc'
|
| 51 |
+
Requires-Dist: texext >=0.6.7 ; extra == 'doc'
|
| 52 |
+
Requires-Dist: myst-nb >=1.1 ; extra == 'doc'
|
| 53 |
+
Requires-Dist: intersphinx-registry ; extra == 'doc'
|
| 54 |
+
Provides-Extra: example
|
| 55 |
+
Requires-Dist: osmnx >=1.9 ; extra == 'example'
|
| 56 |
+
Requires-Dist: momepy >=0.7.2 ; extra == 'example'
|
| 57 |
+
Requires-Dist: contextily >=1.6 ; extra == 'example'
|
| 58 |
+
Requires-Dist: seaborn >=0.13 ; extra == 'example'
|
| 59 |
+
Requires-Dist: cairocffi >=1.7 ; extra == 'example'
|
| 60 |
+
Requires-Dist: igraph >=0.11 ; extra == 'example'
|
| 61 |
+
Requires-Dist: scikit-learn >=1.5 ; extra == 'example'
|
| 62 |
+
Provides-Extra: extra
|
| 63 |
+
Requires-Dist: lxml >=4.6 ; extra == 'extra'
|
| 64 |
+
Requires-Dist: pygraphviz >=1.14 ; extra == 'extra'
|
| 65 |
+
Requires-Dist: pydot >=3.0.1 ; extra == 'extra'
|
| 66 |
+
Requires-Dist: sympy >=1.10 ; extra == 'extra'
|
| 67 |
+
Provides-Extra: test
|
| 68 |
+
Requires-Dist: pytest >=7.2 ; extra == 'test'
|
| 69 |
+
Requires-Dist: pytest-cov >=4.0 ; extra == 'test'
|
| 70 |
+
|
| 71 |
+
NetworkX
|
| 72 |
+
========
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
.. image::
|
| 76 |
+
https://github.com/networkx/networkx/workflows/test/badge.svg?branch=main
|
| 77 |
+
:target: https://github.com/networkx/networkx/actions?query=workflow%3Atest
|
| 78 |
+
|
| 79 |
+
.. image::
|
| 80 |
+
https://codecov.io/gh/networkx/networkx/branch/main/graph/badge.svg?
|
| 81 |
+
:target: https://app.codecov.io/gh/networkx/networkx/branch/main
|
| 82 |
+
|
| 83 |
+
.. image::
|
| 84 |
+
https://img.shields.io/pypi/v/networkx.svg?
|
| 85 |
+
:target: https://pypi.python.org/pypi/networkx
|
| 86 |
+
|
| 87 |
+
.. image::
|
| 88 |
+
https://img.shields.io/pypi/l/networkx.svg?
|
| 89 |
+
:target: https://github.com/networkx/networkx/blob/main/LICENSE.txt
|
| 90 |
+
|
| 91 |
+
.. image::
|
| 92 |
+
https://img.shields.io/pypi/pyversions/networkx.svg?
|
| 93 |
+
:target: https://pypi.python.org/pypi/networkx
|
| 94 |
+
|
| 95 |
+
.. image::
|
| 96 |
+
https://img.shields.io/github/labels/networkx/networkx/good%20first%20issue?color=green&label=contribute
|
| 97 |
+
:target: https://github.com/networkx/networkx/contribute
|
| 98 |
+
|
| 99 |
+
|
| 100 |
+
NetworkX is a Python package for the creation, manipulation,
|
| 101 |
+
and study of the structure, dynamics, and functions
|
| 102 |
+
of complex networks.
|
| 103 |
+
|
| 104 |
+
- **Website (including documentation):** https://networkx.org
|
| 105 |
+
- **Mailing list:** https://groups.google.com/forum/#!forum/networkx-discuss
|
| 106 |
+
- **Source:** https://github.com/networkx/networkx
|
| 107 |
+
- **Bug reports:** https://github.com/networkx/networkx/issues
|
| 108 |
+
- **Report a security vulnerability:** https://tidelift.com/security
|
| 109 |
+
- **Tutorial:** https://networkx.org/documentation/latest/tutorial.html
|
| 110 |
+
- **GitHub Discussions:** https://github.com/networkx/networkx/discussions
|
| 111 |
+
- **Discord (Scientific Python) invite link:** https://discord.com/invite/vur45CbwMz
|
| 112 |
+
- **NetworkX meetings calendar (open to all):** https://scientific-python.org/calendars/networkx.ics
|
| 113 |
+
|
| 114 |
+
Simple example
|
| 115 |
+
--------------
|
| 116 |
+
|
| 117 |
+
Find the shortest path between two nodes in an undirected graph:
|
| 118 |
+
|
| 119 |
+
.. code:: pycon
|
| 120 |
+
|
| 121 |
+
>>> import networkx as nx
|
| 122 |
+
>>> G = nx.Graph()
|
| 123 |
+
>>> G.add_edge("A", "B", weight=4)
|
| 124 |
+
>>> G.add_edge("B", "D", weight=2)
|
| 125 |
+
>>> G.add_edge("A", "C", weight=3)
|
| 126 |
+
>>> G.add_edge("C", "D", weight=4)
|
| 127 |
+
>>> nx.shortest_path(G, "A", "D", weight="weight")
|
| 128 |
+
['A', 'B', 'D']
|
| 129 |
+
|
| 130 |
+
Install
|
| 131 |
+
-------
|
| 132 |
+
|
| 133 |
+
Install the latest released version of NetworkX:
|
| 134 |
+
|
| 135 |
+
.. code:: shell
|
| 136 |
+
|
| 137 |
+
$ pip install networkx
|
| 138 |
+
|
| 139 |
+
Install with all optional dependencies:
|
| 140 |
+
|
| 141 |
+
.. code:: shell
|
| 142 |
+
|
| 143 |
+
$ pip install networkx[default]
|
| 144 |
+
|
| 145 |
+
For additional details,
|
| 146 |
+
please see the `installation guide <https://networkx.org/documentation/stable/install.html>`_.
|
| 147 |
+
|
| 148 |
+
Bugs
|
| 149 |
+
----
|
| 150 |
+
|
| 151 |
+
Please report any bugs that you find `here <https://github.com/networkx/networkx/issues>`_.
|
| 152 |
+
Or, even better, fork the repository on `GitHub <https://github.com/networkx/networkx>`_
|
| 153 |
+
and create a pull request (PR). We welcome all changes, big or small, and we
|
| 154 |
+
will help you make the PR if you are new to `git` (just ask on the issue and/or
|
| 155 |
+
see the `contributor guide <https://networkx.org/documentation/latest/developer/contribute.html>`_).
|
| 156 |
+
|
| 157 |
+
License
|
| 158 |
+
-------
|
| 159 |
+
|
| 160 |
+
Released under the `3-Clause BSD license <https://github.com/networkx/networkx/blob/main/LICENSE.txt>`_::
|
| 161 |
+
|
| 162 |
+
Copyright (C) 2004-2024 NetworkX Developers
|
| 163 |
+
Aric Hagberg <hagberg@lanl.gov>
|
| 164 |
+
Dan Schult <dschult@colgate.edu>
|
| 165 |
+
Pieter Swart <swart@lanl.gov>
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/networkx-3.4.2.dist-info/RECORD
ADDED
|
@@ -0,0 +1,584 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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NJm8VkyJoWyV44va-bq8VW0dc,6349
|
| 4 |
+
networkx-3.4.2.dist-info/RECORD,,
|
| 5 |
+
networkx-3.4.2.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 6 |
+
networkx-3.4.2.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
|
| 7 |
+
networkx-3.4.2.dist-info/entry_points.txt,sha256=H2jZaDsDJ_i9H2SwWpwuFel8BrZ9xHKuvh-DQAWW9lQ,94
|
| 8 |
+
networkx-3.4.2.dist-info/top_level.txt,sha256=s3Mk-7KOlu-kD39w8Xg_KXoP5Z_MVvgB-upkyuOE4Hk,9
|
| 9 |
+
networkx/__init__.py,sha256=vV-bYyml9JK5OV8Ic_dctL5ZGR5NqwF4fzd4msR2b9U,1274
|
| 10 |
+
networkx/algorithms/__init__.py,sha256=oij1HDNcE7GhTPAtuHYT8eGZdH4K_vYaha51X5XoUCY,6559
|
| 11 |
+
networkx/algorithms/approximation/__init__.py,sha256=CydjSsAU3qlxRwDTvgLyjQRgIuhL1e1STrjPdfqtfSE,1178
|
| 12 |
+
networkx/algorithms/approximation/clique.py,sha256=b4cnWMJXmmgCyjMI8A_doHZeKS_RQbGqm2L01OpT_Jg,7691
|
| 13 |
+
networkx/algorithms/approximation/clustering_coefficient.py,sha256=SWpSLEhW3DJc1n2fHlSbJSGg3wdoJkN5Y4_tnntn0Ws,2164
|
| 14 |
+
networkx/algorithms/approximation/connectivity.py,sha256=aVXSfUiWEG4gUL0R1u6WZ-h-wheuLP1_suO_pRFB8M4,13118
|
| 15 |
+
networkx/algorithms/approximation/distance_measures.py,sha256=UEkmKagNw9sj8kiUDdbAeYuzvZ31pgLMXqzliqMkG84,5805
|
| 16 |
+
networkx/algorithms/approximation/dominating_set.py,sha256=5fC90w1CgYR4Xkpqact8iukKY0i57bMmyJW-A9CToUQ,4710
|
| 17 |
+
networkx/algorithms/approximation/kcomponents.py,sha256=MDkoyQbk0gSAm3ZZK35VOsiLJDv7wiDsxfzH5O-ObFs,13285
|
| 18 |
+
networkx/algorithms/approximation/matching.py,sha256=PFof5m9AIq9Xr5Kaa_-mYxI1IBBP7HEkjf-R9wVE3bo,1175
|
| 19 |
+
networkx/algorithms/approximation/maxcut.py,sha256=eTQZqsDQAAUaufni-aDJAY2UzIcajDhRMdj-AcqVkPs,4333
|
| 20 |
+
networkx/algorithms/approximation/ramsey.py,sha256=W5tX7BOQJIM_qNsBeUhCXVWMD8DFdeTycYyk08k4Sqk,1358
|
| 21 |
+
networkx/algorithms/approximation/steinertree.py,sha256=dbPciMrLHmb1XWa0v7-v3qNFJ3Z7pZD0n4RAGF8eob4,8048
|
| 22 |
+
networkx/algorithms/approximation/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 23 |
+
networkx/algorithms/approximation/tests/test_approx_clust_coeff.py,sha256=PGOVEKf2BcJu1vvjZrgTlBBpwM8V6t7yCANjyS9nWF0,1171
|
| 24 |
+
networkx/algorithms/approximation/tests/test_clique.py,sha256=s6HQB-lK3RAu_ftpe2NvIiMu0Ol8tpAdbGvWzucNL6k,3021
|
| 25 |
+
networkx/algorithms/approximation/tests/test_connectivity.py,sha256=gDG6tsgP3ux7Dgu0x7r0nso7_yknIxicV42Gq0It5pc,5952
|
| 26 |
+
networkx/algorithms/approximation/tests/test_distance_measures.py,sha256=axgOojplJIgXdopgkjxjAgvzGTQ1FV1oJ5NG-7ICalo,2023
|
| 27 |
+
networkx/algorithms/approximation/tests/test_dominating_set.py,sha256=l4pBDY7pK7Fxw-S4tOlNcxf-j2j5GpHPJ9f4TrMs1sI,2686
|
| 28 |
+
networkx/algorithms/approximation/tests/test_kcomponents.py,sha256=tTljP1FHzXrUwi-oBz5AQcibRw1NgR4N5UE0a2OrOUA,9346
|
| 29 |
+
networkx/algorithms/approximation/tests/test_matching.py,sha256=nitZncaM0605kaIu1NO6_5TFV2--nohUCO46XTD_lnM,186
|
| 30 |
+
networkx/algorithms/approximation/tests/test_maxcut.py,sha256=U6CDZFSLfYDII-1nX9XB7avSz10kTx88vNazJFoLQ1k,2804
|
| 31 |
+
networkx/algorithms/approximation/tests/test_ramsey.py,sha256=h36Ol39csHbIoTDBxbxMgn4371iVUGZ3a2N6l7d56lI,1143
|
| 32 |
+
networkx/algorithms/approximation/tests/test_steinertree.py,sha256=rxkj8OWDWFqSE5MI3XC4NSOgyNUzYVfxKSskutOPtbQ,9671
|
| 33 |
+
networkx/algorithms/approximation/tests/test_traveling_salesman.py,sha256=lLnnWvs88JBkhkf4Cg8qBipSvRnjn9W9WvOKZ-Gew6Q,30842
|
| 34 |
+
networkx/algorithms/approximation/tests/test_treewidth.py,sha256=MWFFcmjO0QxM8FS8iXSCtfGnk6eqG2kFyv1u2qnSeUo,9096
|
| 35 |
+
networkx/algorithms/approximation/tests/test_vertex_cover.py,sha256=FobHNhG9CAMeB_AOEprUs-7XQdPoc1YvfmXhozDZ8pM,1942
|
| 36 |
+
networkx/algorithms/approximation/traveling_salesman.py,sha256=af4HEUYtuoulBpAQZJT2zqoUu8x08NtL1cQL5uGqe9E,55943
|
| 37 |
+
networkx/algorithms/approximation/treewidth.py,sha256=Yu944jTE9MODBo1QiZjxbAGmHiC5MXZZTNV1YrLfz9o,8216
|
| 38 |
+
networkx/algorithms/approximation/vertex_cover.py,sha256=oIi_yg5O-IisnfmrSof1P4HD-fsZpW69RpvkR_SM5Og,2803
|
| 39 |
+
networkx/algorithms/assortativity/__init__.py,sha256=ov3HRRbeYB_6Qezvxp1OTl77GBpw-EWkWGUzgfT8G9c,294
|
| 40 |
+
networkx/algorithms/assortativity/connectivity.py,sha256=-V0C5MTqtErl86N-gyrZ487MUyiG5x1QFEZKurOpIJA,4220
|
| 41 |
+
networkx/algorithms/assortativity/correlation.py,sha256=0rc4FDi-e8eQRia7gpFrTqjIy-J7V2GtSwOb4QN6WZk,8689
|
| 42 |
+
networkx/algorithms/assortativity/mixing.py,sha256=RRqqkuVwo71LosJLDbeVCVBikqC7I_XZORdsonQsf9Y,7586
|
| 43 |
+
networkx/algorithms/assortativity/neighbor_degree.py,sha256=UMaQWKBkOZ0ZgC8xGt5fXEz8OL1rgwYjt2zKbKEqofI,5282
|
| 44 |
+
networkx/algorithms/assortativity/pairs.py,sha256=w7xnaWxDDteluHoCsqunLlcM6nlcBenO_5Nz87oOEnE,3841
|
| 45 |
+
networkx/algorithms/assortativity/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 46 |
+
networkx/algorithms/assortativity/tests/base_test.py,sha256=MNeQMLA3oBUCM8TSyNbBQ_uW0nDc1GEZYdNdUwePAm4,2651
|
| 47 |
+
networkx/algorithms/assortativity/tests/test_connectivity.py,sha256=Js841GQLYTLWvc6xZhnyqj-JtyrnS0ska1TFYntxyXA,4978
|
| 48 |
+
networkx/algorithms/assortativity/tests/test_correlation.py,sha256=1_D9GjLDnlT8Uy28lUn2fS1AHp2XBwiMpIl2OhRNDXk,5069
|
| 49 |
+
networkx/algorithms/assortativity/tests/test_mixing.py,sha256=u-LIccNn-TeIAM766UtzUJQlY7NAbxF4EsUoKINzmlo,6820
|
| 50 |
+
networkx/algorithms/assortativity/tests/test_neighbor_degree.py,sha256=ODP2M8jCaFr_l3ODwpwaz20-KqU2IFaEfJRBK53mpE8,3968
|
| 51 |
+
networkx/algorithms/assortativity/tests/test_pairs.py,sha256=t05qP_-gfkbiR6aTLtE1owYl9otBSsuJcRkuZsa63UQ,3008
|
| 52 |
+
networkx/algorithms/asteroidal.py,sha256=jbN_MmETkCGpSvUWW6W8_Qqa3Syay2BwkX9odcyQFfk,5865
|
| 53 |
+
networkx/algorithms/bipartite/__init__.py,sha256=811Xu3D1Qx8ncqRshHoN3gWZ_A04Hb2qxzoGuc5vBa4,3825
|
| 54 |
+
networkx/algorithms/bipartite/basic.py,sha256=JPC2gGuPvFA6q2CuI5mqLX_9QUGxrsQ8cIwcS0e9P4U,8375
|
| 55 |
+
networkx/algorithms/bipartite/centrality.py,sha256=G280bAqeyXyCmes5NpRqUv2Tc-EHWrMshJ3_f4uqV9U,9156
|
| 56 |
+
networkx/algorithms/bipartite/cluster.py,sha256=ZDAo7NM69woVY8fNwRjbAz6Wwb99CE650lMmv1v0Omc,6935
|
| 57 |
+
networkx/algorithms/bipartite/covering.py,sha256=B3ITc016Kk70NBv-1lb30emXnfjlMIQJ7M-FIPCZip0,2163
|
| 58 |
+
networkx/algorithms/bipartite/edgelist.py,sha256=l6JqWqedRGde0sOz7oLK-xe9azq_VEYec0-GPlFUIbg,11364
|
| 59 |
+
networkx/algorithms/bipartite/extendability.py,sha256=OrYHlS4ruQST-dlQOuleiqHFKpVVNOvrG5aDNFgfckg,3989
|
| 60 |
+
networkx/algorithms/bipartite/generators.py,sha256=PfnR6S9gKw5OK_JuGMChltWxyd_i8_KYFq1WpRlsL-A,20439
|
| 61 |
+
networkx/algorithms/bipartite/matching.py,sha256=xsT048Ok_uM0Zhpdc34qswV1zaCGOlJQnsbGTDsm5oo,21637
|
| 62 |
+
networkx/algorithms/bipartite/matrix.py,sha256=RuoILyPHjORW0Y_Bcf-vSH_K6-bSUjiTN9JTjnik5HE,6156
|
| 63 |
+
networkx/algorithms/bipartite/projection.py,sha256=YIUlreqQQ6IPE37OXF32zNIdzEGeyR8aY-7iUENZYVA,17252
|
| 64 |
+
networkx/algorithms/bipartite/redundancy.py,sha256=Mnkz0LbNXS0haxtLQ5naorR6C2tNLUbkNS_3PANFxbg,3402
|
| 65 |
+
networkx/algorithms/bipartite/spectral.py,sha256=fu2grV1the_e_G-e_lUdhk8Y9XFe6_p2tPmx3RKntFw,1902
|
| 66 |
+
networkx/algorithms/bipartite/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 67 |
+
networkx/algorithms/bipartite/tests/test_basic.py,sha256=gzbtsQqPi85BznX5REdGBBJVyr9aH4nO06c3eEI4634,4291
|
| 68 |
+
networkx/algorithms/bipartite/tests/test_centrality.py,sha256=PABPbrIyoAziEEQKXsZLl2jT36N8DZpNRzEO-jeu89Y,6362
|
| 69 |
+
networkx/algorithms/bipartite/tests/test_cluster.py,sha256=O0VsPVt8vcY_E1FjjLJX2xaUbhVViI5MP6_gLTbEpos,2801
|
| 70 |
+
networkx/algorithms/bipartite/tests/test_covering.py,sha256=EGVxYQsyLXE5yY5N5u6D4wZq2NcZe9OwlYpEuY6DF3o,1221
|
| 71 |
+
networkx/algorithms/bipartite/tests/test_edgelist.py,sha256=fK35tSekG_-9Ewr5Bhl1bRdwAy247Z9zZ4dQFFDQ9xw,8471
|
| 72 |
+
networkx/algorithms/bipartite/tests/test_extendability.py,sha256=XgPmg6bWiHAF1iQ75_r2NqUxExOQNZRUeYUPzlCa5-E,7043
|
| 73 |
+
networkx/algorithms/bipartite/tests/test_generators.py,sha256=DB9NEapShvX9L5Dpj1OF8bs8LOu5n3zvew60WZhYChQ,13241
|
| 74 |
+
networkx/algorithms/bipartite/tests/test_matching.py,sha256=3-2DMl3tF-g4_xNHvEuY4fZW7S5cqMTO_GUpcz1gkeQ,11973
|
| 75 |
+
networkx/algorithms/bipartite/tests/test_matrix.py,sha256=1MymSi1dCUqAhTt82O2nBzjriNQtFRk6TxWGJ2FBW4k,3094
|
| 76 |
+
networkx/algorithms/bipartite/tests/test_project.py,sha256=FBjkys3JYYzEG4aq_CsQrtm41edZibWI_uDAQ0b4wqM,15134
|
| 77 |
+
networkx/algorithms/bipartite/tests/test_redundancy.py,sha256=utxcrQaTrkcEN3kqtObgKNpLZai8B5sMAqLyXatOuUo,917
|
| 78 |
+
networkx/algorithms/bipartite/tests/test_spectral_bipartivity.py,sha256=1jGDgrIx3-TWOCNMSC4zxmZa7LHyMU69DXh3h12Bjag,2358
|
| 79 |
+
networkx/algorithms/boundary.py,sha256=q3JtWssmn9yCB2mBdkjKZjkaxmBhkG9_dJOzmuJiQos,5339
|
| 80 |
+
networkx/algorithms/bridges.py,sha256=CsxueHDOB9aFM5D8GP83u1ZKGzxF193XBpvmMReAcQk,6066
|
| 81 |
+
networkx/algorithms/broadcasting.py,sha256=eqqZJ7oDQVCl7P3-PLm-gthzSc-kWnF2D1Yv42GXoGk,4890
|
| 82 |
+
networkx/algorithms/centrality/__init__.py,sha256=Er3YoYoj76UfY4P6I0L-0fCQkO7mMU0b3NLsTT2RGWI,558
|
| 83 |
+
networkx/algorithms/centrality/betweenness.py,sha256=9kXlMR9T1IHDJ55x2fSMfjuLBy402AREJfQKUW1LfFo,14383
|
| 84 |
+
networkx/algorithms/centrality/betweenness_subset.py,sha256=mkVJdEmR1G8kFoS-KN-jwhUyR_CUiB8DXneGqsqyB6U,9336
|
| 85 |
+
networkx/algorithms/centrality/closeness.py,sha256=ehkntG-gApT9uhWJjGaEZQ-tEQ-hdxDT7luf-uVPNAE,10281
|
| 86 |
+
networkx/algorithms/centrality/current_flow_betweenness.py,sha256=zZRqgrB06uDzgwWJ_FLUF3DSrgkER1tvakYZHX8DbSY,11848
|
| 87 |
+
networkx/algorithms/centrality/current_flow_betweenness_subset.py,sha256=2qtLgf_3ft5qdDvHFrfYUt6zeQi42Nw7XBpSZRboJIA,8107
|
| 88 |
+
networkx/algorithms/centrality/current_flow_closeness.py,sha256=IvecI8BZE4SgKayEXhKowIJw7S2fD_dN__N-f9TW-ME,3327
|
| 89 |
+
networkx/algorithms/centrality/degree_alg.py,sha256=EFTA1b_GWUbmBy5R9beRQp7yh1X_NwZtk5L6is-mFGk,3894
|
| 90 |
+
networkx/algorithms/centrality/dispersion.py,sha256=M12L2KiVPrC2-SyCXMF0kvxLelgcmvXJkLT_cBHoCTw,3631
|
| 91 |
+
networkx/algorithms/centrality/eigenvector.py,sha256=LAxVqaT3LmuQw20__t1KrgLKPF1Cz-PkTaiSrgPC1FU,13623
|
| 92 |
+
networkx/algorithms/centrality/flow_matrix.py,sha256=Y65m6VbWyYjNK0CInE_lufyEkKy9-TyPmBeXb-Gkz70,3834
|
| 93 |
+
networkx/algorithms/centrality/group.py,sha256=-YaVfnJ6HKT6b1P-IhyUKtJvXk0ZSnC2Jz4XP6hjkyE,27960
|
| 94 |
+
networkx/algorithms/centrality/harmonic.py,sha256=ZPp8FYFgSUZS0QBxUbzhi39qiv_EN7COirxZEYiTCIM,2847
|
| 95 |
+
networkx/algorithms/centrality/katz.py,sha256=uVGHAyjqndSd4y4idHjkv0mUhmKmHU5vaEfNWfiKlzc,11042
|
| 96 |
+
networkx/algorithms/centrality/laplacian.py,sha256=8-qloyxvFc33xlfpj7Xol8qeOvPAg_Z0BHVZGSxjnmc,5640
|
| 97 |
+
networkx/algorithms/centrality/load.py,sha256=M2EdPX4gJEYGjMBIJMFKRWGI9uYHbFOWYxsILeaJuOE,6859
|
| 98 |
+
networkx/algorithms/centrality/percolation.py,sha256=YJB8iYgbpjJ3EYK8pl26iSnjgfFsK31ufytRHnUTYYE,4419
|
| 99 |
+
networkx/algorithms/centrality/reaching.py,sha256=OFWHlDUtCaQXHWxAfEgPpinej-0anLJQZsCvh3D8gME,7243
|
| 100 |
+
networkx/algorithms/centrality/second_order.py,sha256=4CTboP95B6gUtAtSKLfeeE4s9oq0_3hXsXczxL6c_g8,5012
|
| 101 |
+
networkx/algorithms/centrality/subgraph_alg.py,sha256=HtwSPYMRUxhaAuvMA90Qu2i1smXSpVpLRtHlBohnpSc,9513
|
| 102 |
+
networkx/algorithms/centrality/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 103 |
+
networkx/algorithms/centrality/tests/test_betweenness_centrality.py,sha256=pKoPAP1hnQSgrOxYeW5-LdUiFDANiwTn_NdOdgccbo8,26795
|
| 104 |
+
networkx/algorithms/centrality/tests/test_betweenness_centrality_subset.py,sha256=HrHMcgOL69Z6y679SbqZIjkQOnqrYSz24gt17AJ9q-o,12554
|
| 105 |
+
networkx/algorithms/centrality/tests/test_closeness_centrality.py,sha256=Ziz_LMgRJHT1pz_sgT4oCZPmOeWJL7OmfUSI8UCC1dI,10210
|
| 106 |
+
networkx/algorithms/centrality/tests/test_current_flow_betweenness_centrality.py,sha256=VOxx1A7iSGtdEbzJYea_sW_Hv0S71-oo1CVX7Rqd5RY,7870
|
| 107 |
+
networkx/algorithms/centrality/tests/test_current_flow_betweenness_centrality_subset.py,sha256=JfRGgPuiF-vJu5fc2_pcJYREEboxcK_dmy-np39c4Aw,5839
|
| 108 |
+
networkx/algorithms/centrality/tests/test_current_flow_closeness.py,sha256=vflQeoNKngrGUiRb3XNlm2X9wR4vKgMSW_sCyMUCQi8,1379
|
| 109 |
+
networkx/algorithms/centrality/tests/test_degree_centrality.py,sha256=Jn_p5lThA3__ZBTDAORwo_EchjXKKkK1NwU_73HHI6M,4101
|
| 110 |
+
networkx/algorithms/centrality/tests/test_dispersion.py,sha256=ROgl_5bGhcNXonNW3ylsvUcA0NCwynsQu_scic371Gw,1959
|
| 111 |
+
networkx/algorithms/centrality/tests/test_eigenvector_centrality.py,sha256=A6REmarGOuDmq3GcSYemyadlFLv24sErIGLtDcL9GO4,5255
|
| 112 |
+
networkx/algorithms/centrality/tests/test_group.py,sha256=833ME4tGlOGQZz8YANw4MSyeVPpjbyCdYh5X88GOprw,8685
|
| 113 |
+
networkx/algorithms/centrality/tests/test_harmonic_centrality.py,sha256=wI7nStX_kIFJoZQY_i8DXXlZBOJzVnQfOP8yidX0PAU,3867
|
| 114 |
+
networkx/algorithms/centrality/tests/test_katz_centrality.py,sha256=JL0bZZsJe2MQFL6urXgY82wCAwucUvhjaShYZPxpL6U,11240
|
| 115 |
+
networkx/algorithms/centrality/tests/test_laplacian_centrality.py,sha256=vY-NULtr_U_GxUMwfAZB-iccxIRTiqqUN4Q8HRNpzSo,5916
|
| 116 |
+
networkx/algorithms/centrality/tests/test_load_centrality.py,sha256=Vv3zSW89iELN-8KNbUclmkhOe1LzKdF7U_w34nYovIo,11343
|
| 117 |
+
networkx/algorithms/centrality/tests/test_percolation_centrality.py,sha256=ycQ1fvEZZcWAfqL11urT7yHiEP77usJDSG25OQiDM2s,2591
|
| 118 |
+
networkx/algorithms/centrality/tests/test_reaching.py,sha256=_JVeO1Ri-KybdnGCJ_yNPtJQmT_g77z0DAkU0JYFVGQ,5090
|
| 119 |
+
networkx/algorithms/centrality/tests/test_second_order_centrality.py,sha256=ce0wQ4T33lu23wskzGUnBS7X4BSODlvAX1S5KxlLzOA,1999
|
| 120 |
+
networkx/algorithms/centrality/tests/test_subgraph.py,sha256=vhE9Uh-_Hlk49k-ny6ORHCgqk7LWH8OHIYOEYM96uz0,3729
|
| 121 |
+
networkx/algorithms/centrality/tests/test_trophic.py,sha256=_lmwb0_78iX_cxgUKHjCRCSxohVMkRrkKqSaB5QV3ys,8705
|
| 122 |
+
networkx/algorithms/centrality/tests/test_voterank.py,sha256=tN5u7pKAnJ_4AiwhPW6EuJZz7FLIG2jYqLKcXFi2urk,1687
|
| 123 |
+
networkx/algorithms/centrality/trophic.py,sha256=q--TsLcfGNCSet_A6oLVf7CGWQBvDxDOlkjozduZfxY,4679
|
| 124 |
+
networkx/algorithms/centrality/voterank_alg.py,sha256=z_1eq8rSDadEO5W5BbAg1zuOJj2di4FUCkmOwiuK12I,3231
|
| 125 |
+
networkx/algorithms/chains.py,sha256=PPiSq5-GsT1Lsf8fwtGwGDVf1hhv5ZLariWtfzkBbAw,6968
|
| 126 |
+
networkx/algorithms/chordal.py,sha256=L-ILWdVLWE44OkWmEO_4bSo4z6Ro-_zLglfLfTrwdqQ,13411
|
| 127 |
+
networkx/algorithms/clique.py,sha256=LrmXvK6KVcjDyUrF5S6JTC2PQ1kTf26Yeb0TjqNy_WA,25872
|
| 128 |
+
networkx/algorithms/cluster.py,sha256=x7dIotmBaBU3yaIzphjAyA2B-FHS_iiQ5nF-FeinQlU,20359
|
| 129 |
+
networkx/algorithms/coloring/__init__.py,sha256=P1cmqrAjcaCdObkNZ1e6Hp__ZpxBAhQx0iIipOVW8jg,182
|
| 130 |
+
networkx/algorithms/coloring/equitable_coloring.py,sha256=uDcza6PD9qbvwVPUX1MBZbopQdrAEKNk6DpCFkc02tU,16315
|
| 131 |
+
networkx/algorithms/coloring/greedy_coloring.py,sha256=6Jzcc4iW5KuRVFEEr15v8rBvik3g4maa7_wcjWyyRDI,20046
|
| 132 |
+
networkx/algorithms/coloring/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 133 |
+
networkx/algorithms/coloring/tests/test_coloring.py,sha256=7v_d1xanjYMZCa3dq2hE2hCcyexwWBTEFV5SoLgQDv4,23697
|
| 134 |
+
networkx/algorithms/communicability_alg.py,sha256=0tZvZKY-_GUUB7GsRILxabS2jEpI51Udg5ADI9ADGZw,4545
|
| 135 |
+
networkx/algorithms/community/__init__.py,sha256=0YrcAVLTxJt3u-htlaSPZ-XSRn0Jg-EQKCMRPmWuw-g,1179
|
| 136 |
+
networkx/algorithms/community/asyn_fluid.py,sha256=0ktsoOa4JKBKiuE3wmGDcBSUgPlFdGvzNheqINtWKbk,5935
|
| 137 |
+
networkx/algorithms/community/centrality.py,sha256=Yyv5kyf1hf_L7iQ_ZbG8_FAkP638Sc_3N4tCSoB6J1w,6635
|
| 138 |
+
networkx/algorithms/community/community_utils.py,sha256=sUi-AcPYyGrYhnjI9ztt-vrSHLl28lKXxTJPfi5N0c8,908
|
| 139 |
+
networkx/algorithms/community/divisive.py,sha256=yFcKfKkiI6FqEVlBVxLa1fbqI1Yeiqe_A5fpPnYvlAE,6655
|
| 140 |
+
networkx/algorithms/community/kclique.py,sha256=DTr9iUT_XWv0S3Y79KQl6OXefjztNMc9SAHWhdFOxcU,2460
|
| 141 |
+
networkx/algorithms/community/kernighan_lin.py,sha256=vPU8Mbpk7_NscMC-gorNoXhsQjkOhgK2YiKOo-u6DvY,4349
|
| 142 |
+
networkx/algorithms/community/label_propagation.py,sha256=LhzAXSHFCPQ2kG_rPgXb06YKdppO7buApksCC4GI4w8,11878
|
| 143 |
+
networkx/algorithms/community/louvain.py,sha256=zh5h16hRWzgTv9IUqWiiJKFntZhQbB_EHNYIGViwPas,15365
|
| 144 |
+
networkx/algorithms/community/lukes.py,sha256=gzqnup95RR2UzUiPpIt8qkepzZ9dCWqHGQSVPIJDMx8,8115
|
| 145 |
+
networkx/algorithms/community/modularity_max.py,sha256=gzyZrGHNMtTZyqpLFcJHxgzzIsar1m5DktScODoUngk,18082
|
| 146 |
+
networkx/algorithms/community/quality.py,sha256=dVIkV-CFKdAou0WjgIDmfhnpIIqReRaeL4odg39XAYk,11939
|
| 147 |
+
networkx/algorithms/community/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 148 |
+
networkx/algorithms/community/tests/test_asyn_fluid.py,sha256=UzAMxJzhN74qUinehR7B1rhU_vsigJ7-cRvcE6jdKyc,3332
|
| 149 |
+
networkx/algorithms/community/tests/test_centrality.py,sha256=s8q4k5aThR0OgO9CDQk_PXMxfllmf5uC1GlvyUc_8EY,2932
|
| 150 |
+
networkx/algorithms/community/tests/test_divisive.py,sha256=-Ee40OR-mPDReTngTEhbpx4_uLtNI7cqFkt8cZT9t5Y,3441
|
| 151 |
+
networkx/algorithms/community/tests/test_kclique.py,sha256=iA0SBqwbDfaD2u7KM6ccs6LfgAQY_xxrnW05UIT_tFA,2413
|
| 152 |
+
networkx/algorithms/community/tests/test_kernighan_lin.py,sha256=rcFDI9mTq1Nwsi251PwDgi1UoxTMPXAeSy2Cp6GtUQg,2710
|
| 153 |
+
networkx/algorithms/community/tests/test_label_propagation.py,sha256=IHidFEv7MI781zsdk7XT848rLvLwDk2wBK1FjL-CRv4,7985
|
| 154 |
+
networkx/algorithms/community/tests/test_louvain.py,sha256=TwW1nlSKWGJeIKr9QOJ8xGehSY6R0Nz01xsnFqzt0Oo,8071
|
| 155 |
+
networkx/algorithms/community/tests/test_lukes.py,sha256=f_JU-EzY6PwXEkPN8kk5_3NVg6phlX0nrj1f57M49lk,3961
|
| 156 |
+
networkx/algorithms/community/tests/test_modularity_max.py,sha256=XYyPuDkxL4CYFwnpTdU_qD4GydpqgiRAIJO3CHQN_m4,10617
|
| 157 |
+
networkx/algorithms/community/tests/test_quality.py,sha256=sZEy10hh3zlelUmww5r2pk5LxpZAht06PC5zCHxV1bs,5275
|
| 158 |
+
networkx/algorithms/community/tests/test_utils.py,sha256=gomD6rFgAaywxT1Yjdi4ozY-1rC0ina4jgfvWeCvwGE,704
|
| 159 |
+
networkx/algorithms/components/__init__.py,sha256=Dt74KZWp_cJ_j0lL5hd_S50_hia5DKcC2SjuRnubr6M,173
|
| 160 |
+
networkx/algorithms/components/attracting.py,sha256=6az3lgqWhHTXaWUUuOPZfW9t7okliAhooFRotQY5JoM,2712
|
| 161 |
+
networkx/algorithms/components/biconnected.py,sha256=_9GJdPZgqusGKZLzqT9tUSj1XZr2DgohiT6hcHVyil4,12782
|
| 162 |
+
networkx/algorithms/components/connected.py,sha256=r-jNJJkxoDtFcYiuoteyZb3a2oEHh0j0WBddwsXj_a4,4459
|
| 163 |
+
networkx/algorithms/components/semiconnected.py,sha256=BaBMFlQ208vuHOo5y1xeV0PDEI3yDUfH6zFb_jkcVhQ,2030
|
| 164 |
+
networkx/algorithms/components/strongly_connected.py,sha256=i41vDeazdNGqG4weufAKd6axaN2nBKmMzURZBs7WsLI,9542
|
| 165 |
+
networkx/algorithms/components/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 166 |
+
networkx/algorithms/components/tests/test_attracting.py,sha256=b3N3ZR9E5gLSQWGgaqhcRfRs4KBW6GnnkVYeAjdxC_o,2243
|
| 167 |
+
networkx/algorithms/components/tests/test_biconnected.py,sha256=N-J-dgBgI77ytYUUrXjduLxtDydH7jS-af98fyPBkYc,6036
|
| 168 |
+
networkx/algorithms/components/tests/test_connected.py,sha256=KMYm55BpbFdGXk_B2WozS9rIagQROd7_k0LT3HFQmr4,4815
|
| 169 |
+
networkx/algorithms/components/tests/test_semiconnected.py,sha256=q860lIxZF5M2JmDwwdzy-SGSXnrillOefMx23GcJpw0,1792
|
| 170 |
+
networkx/algorithms/components/tests/test_strongly_connected.py,sha256=Zm7MgUIZbuPPJu66xZH1zfMZQ_3X1YBl2fLCOjph7NQ,6021
|
| 171 |
+
networkx/algorithms/components/tests/test_weakly_connected.py,sha256=_eUx7226dxme_K2WNmvSIwZXQlKNoCuglWOOC3kFUW4,3083
|
| 172 |
+
networkx/algorithms/components/weakly_connected.py,sha256=jFHHr0qTZH57IyFIQ8iD5gekgczQXTPRHrtYoXVYYPM,4455
|
| 173 |
+
networkx/algorithms/connectivity/__init__.py,sha256=EvYKw8LJn7wyZECHAsuEkIaSl-cV-LhymR6tqcn90p8,281
|
| 174 |
+
networkx/algorithms/connectivity/connectivity.py,sha256=KuvVbJ0dAmG2h51uFo9IdBIK1G1PYaTZ-XFT78ksZEo,29367
|
| 175 |
+
networkx/algorithms/connectivity/cuts.py,sha256=d9O6G3fuhjg0GEuDSm6QyYhm3OTBKFZeHC7Tz6IZ0Mg,23015
|
| 176 |
+
networkx/algorithms/connectivity/disjoint_paths.py,sha256=R0HDHrrhdI1E_do3U6t6oseXsrGJlG7PC89kXCPC1v8,14649
|
| 177 |
+
networkx/algorithms/connectivity/edge_augmentation.py,sha256=SE7CkLjtxG-q6DZPZH33g6MJcYA1KsJgHm-Pm575gkA,44061
|
| 178 |
+
networkx/algorithms/connectivity/edge_kcomponents.py,sha256=hqABcfCqZ-rb45I0qYE-X4NtstsKJbxl37FZzzmoXA4,20894
|
| 179 |
+
networkx/algorithms/connectivity/kcomponents.py,sha256=TtiEvpaKflkdxJ3r37Qsj1qrSzB2rtHzDcxCDO_Aq2Q,8171
|
| 180 |
+
networkx/algorithms/connectivity/kcutsets.py,sha256=zYohzgkR2FODi_Ew2M9uMLb_a9ZP5fNqcXJwMYy6P7o,9371
|
| 181 |
+
networkx/algorithms/connectivity/stoerwagner.py,sha256=WodsJEqKgsmTTcyUBk2u3wV_CXeon-cAzveWgIGgFmA,5431
|
| 182 |
+
networkx/algorithms/connectivity/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 183 |
+
networkx/algorithms/connectivity/tests/test_connectivity.py,sha256=eSmsi8uQk6MI591JgtSu2elIusb08bmSZS0h9gxb76I,15027
|
| 184 |
+
networkx/algorithms/connectivity/tests/test_cuts.py,sha256=4F8seWb-sPDDjjVMkh14gst5UQa5f-zDkCsZIdJjVzo,10353
|
| 185 |
+
networkx/algorithms/connectivity/tests/test_disjoint_paths.py,sha256=NLHReLoXSKoA6KPBNRbjF84ktg5PEaaktIj2AII3SDY,8392
|
| 186 |
+
networkx/algorithms/connectivity/tests/test_edge_augmentation.py,sha256=d3ymFHyY2G4cpy1Y6wu4ze339qfF2LRp2HmGAIVjnMM,15731
|
| 187 |
+
networkx/algorithms/connectivity/tests/test_edge_kcomponents.py,sha256=CZ26Dy91WOUqhw1X73mqLGX-WHWzBBIeBCgrp6KK4Zo,16453
|
| 188 |
+
networkx/algorithms/connectivity/tests/test_kcomponents.py,sha256=ohoSX8GACeszRZdzTiNuWXSFitfU9DzP0hqllS2gvMU,8554
|
| 189 |
+
networkx/algorithms/connectivity/tests/test_kcutsets.py,sha256=sVKjwQt3FUqtnlY2xuHn6VGY9rvUkYoVp7v5fK-6aJw,8610
|
| 190 |
+
networkx/algorithms/connectivity/tests/test_stoer_wagner.py,sha256=A291C30_t2CI1erPCqN1W0DoAj3zqNA8fThPIj4Rku0,3011
|
| 191 |
+
networkx/algorithms/connectivity/utils.py,sha256=gL8LmZnK4GKAZQcIPEhVNYmVi18Mqsqwg4O4j_et56s,3217
|
| 192 |
+
networkx/algorithms/core.py,sha256=2QQYUPoMs9F1rgGUlYgIAj6ETy4VefQWG1rl0RMkf9o,19184
|
| 193 |
+
networkx/algorithms/covering.py,sha256=abt1bRBmiPi1J950uUYfTk4YS4pVhz1zanY01vxqNLg,5294
|
| 194 |
+
networkx/algorithms/cuts.py,sha256=-J5j6Yi2CrlFsrX4bK-5kFztD6i4X6gihXwxmFC1zYQ,9990
|
| 195 |
+
networkx/algorithms/cycles.py,sha256=erkLvKZkYfGDwya6Pn_o8cR5CnEnYeJ30Yi4kGr5xvk,43237
|
| 196 |
+
networkx/algorithms/d_separation.py,sha256=3O_5RIWziPQ5xwRn-yAjH28xrkSaVIVbCFpw7K2Pa2A,27283
|
| 197 |
+
networkx/algorithms/dag.py,sha256=y2HhZm0-olRZabgo9xczjsWf8ObSeG--VJl3PIEh9cE,45070
|
| 198 |
+
networkx/algorithms/distance_measures.py,sha256=eauckS80lzTT_0CpZZh1JR7tLCzeiGCviaARDK1MN8k,34195
|
| 199 |
+
networkx/algorithms/distance_regular.py,sha256=-1QCGLy7OPoNuV2bYJDY4jVot-0LGMobBQ0DubjbhGI,7053
|
| 200 |
+
networkx/algorithms/dominance.py,sha256=T_z37jx_WSbY_HMfYgqZL6fT-p6PMAlZjSwEVsaLfLE,3450
|
| 201 |
+
networkx/algorithms/dominating.py,sha256=d4CkSt_hmcwldF5FaOiazZpThYhxAuasRhJgGdExGjc,2669
|
| 202 |
+
networkx/algorithms/efficiency_measures.py,sha256=VKbLKJgdIbno-YnJaLaCZt7TNXXnQPdz8N99uJCo748,4741
|
| 203 |
+
networkx/algorithms/euler.py,sha256=yCqKaGchFSRPTRDXq7u1fH2IXZF94wWf9S10K9-Cd6U,14205
|
| 204 |
+
networkx/algorithms/flow/__init__.py,sha256=rVtMUy6dViPLewjDRntmn15QF0bQwiDdQbZZx9j7Drc,341
|
| 205 |
+
networkx/algorithms/flow/boykovkolmogorov.py,sha256=qFcppmiXz4VKKFd4RbDsiWOqJODtDTHbNr9_UFTjQaU,13334
|
| 206 |
+
networkx/algorithms/flow/capacityscaling.py,sha256=8rng2qO5kawNSxq2S8BNlUMmdvNSoC6R8ekiBGU8LxU,14469
|
| 207 |
+
networkx/algorithms/flow/dinitz_alg.py,sha256=I5nnZVsj0aU8-9Cje0umey407epFzpd7BDJpkI6ESK4,8341
|
| 208 |
+
networkx/algorithms/flow/edmondskarp.py,sha256=PEIwLftevS2VYHaTzzZMSOLPy7QSBPsWPedjx1lR6Cs,8056
|
| 209 |
+
networkx/algorithms/flow/gomory_hu.py,sha256=EuibaxPl65shGM9Jxvaa9WMwMmoczDvXXc2b0E81cqM,6345
|
| 210 |
+
networkx/algorithms/flow/maxflow.py,sha256=3_v0FUEHulFrOeSDM1FMcmOF3yTYvxUbLGv3MNTNp1Q,22795
|
| 211 |
+
networkx/algorithms/flow/mincost.py,sha256=GzMYInS4QcNe0yImGrVXJ0bRd7t5TSSMa9jSeenIoOk,12853
|
| 212 |
+
networkx/algorithms/flow/networksimplex.py,sha256=32uetoZWj-_7KPO2OJputP0FpTrsQ_qJxntC8XxIVr0,25185
|
| 213 |
+
networkx/algorithms/flow/preflowpush.py,sha256=CUKZ0-7X9l7P7qH_2n2Immbf8mFm8vocH2SY0tIwjGo,15721
|
| 214 |
+
networkx/algorithms/flow/shortestaugmentingpath.py,sha256=gXXdkY3nH4d0hXVn0P2-kzfC3DHcuCdrudFdxetflKI,10372
|
| 215 |
+
networkx/algorithms/flow/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 216 |
+
networkx/algorithms/flow/tests/gl1.gpickle.bz2,sha256=z4-BzrXqruFiGqYLiS2D5ZamFz9vZRc1m2ef89qhsPg,44623
|
| 217 |
+
networkx/algorithms/flow/tests/gw1.gpickle.bz2,sha256=b3nw6Q-kxR7HkWXxWWPh7YlHdXbga8qmeuYiwmBBGTE,42248
|
| 218 |
+
networkx/algorithms/flow/tests/netgen-2.gpickle.bz2,sha256=OxfmbN7ajtuNHexyYmx38fZd1GdeP3bcL8T9hKoDjjA,18972
|
| 219 |
+
networkx/algorithms/flow/tests/test_gomory_hu.py,sha256=aWtbI3AHofIK6LDJnmj9UH1QOfulXsi5NyB7bNyV2Vw,4471
|
| 220 |
+
networkx/algorithms/flow/tests/test_maxflow.py,sha256=4CtGOqeyloAxFSajaxPfGuyVhE0R3IdJf2SuIg4kHKQ,18940
|
| 221 |
+
networkx/algorithms/flow/tests/test_maxflow_large_graph.py,sha256=1a7pS0i5sj_kowLelETcHdrf7RmPEhAJnmCT03JZ0K8,4622
|
| 222 |
+
networkx/algorithms/flow/tests/test_mincost.py,sha256=n4fFLDwDLy7Tau-_ey1CoxZwKhFjk28GLGJjCyxhClk,17816
|
| 223 |
+
networkx/algorithms/flow/tests/test_networksimplex.py,sha256=bsVxlvHAD0K7aDevCcVaa9uRNNsWAevw6yUKlj2T8No,12103
|
| 224 |
+
networkx/algorithms/flow/tests/wlm3.gpickle.bz2,sha256=zKy6Hg-_swvsNh8OSOyIyZnTR0_Npd35O9RErOF8-g4,88132
|
| 225 |
+
networkx/algorithms/flow/utils.py,sha256=bCeiFAiyFe4-ptkCopo_PnQKF9xY5M8Br87hJT3fRWQ,6084
|
| 226 |
+
networkx/algorithms/graph_hashing.py,sha256=0jcfhXY7tChFBV4N0ga4oJCJCHRwawrsDDyNy11uJlk,12556
|
| 227 |
+
networkx/algorithms/graphical.py,sha256=1NdlhXuGEgUkHPo47EoNTWUMfdeTpiv7BBVM9ty2ivw,15831
|
| 228 |
+
networkx/algorithms/hierarchy.py,sha256=_KFhCF1Afr2TrkPhqx-1PXUXEtfYLhbRShC58ZKbDGE,1786
|
| 229 |
+
networkx/algorithms/hybrid.py,sha256=z3sIFMOpja1wlj-lI8YI6OIbSLZWHr66uSqyVESZWXY,6209
|
| 230 |
+
networkx/algorithms/isolate.py,sha256=4rDH_iGY2WM5igJS-lBcIVb11MrKdoaFhJLieLZ4BAE,2301
|
| 231 |
+
networkx/algorithms/isomorphism/__init__.py,sha256=gPRQ-_X6xN2lJZPQNw86IVj4NemGmbQYTejf5yJ32N4,406
|
| 232 |
+
networkx/algorithms/isomorphism/ismags.py,sha256=TpZP5xDxLITCGOk8DT4EBVaWDbbjzEUT5ZOCDNGAho0,43239
|
| 233 |
+
networkx/algorithms/isomorphism/isomorph.py,sha256=Yg2Aukv0tVZIQ66jxzDS4DPBjX6DMKwT0_WNH12fsgk,7114
|
| 234 |
+
networkx/algorithms/isomorphism/isomorphvf2.py,sha256=_IdR1YRm8N9z-HaX2XtzPRq-2j3_jqlcJ8WSrvAyE5g,46785
|
| 235 |
+
networkx/algorithms/isomorphism/matchhelpers.py,sha256=PaZ7PjmNNsJO9KoeRrf9JgcDHIcFr1tZckQc_ol4e9I,10884
|
| 236 |
+
networkx/algorithms/isomorphism/temporalisomorphvf2.py,sha256=-1NW81l8kM9orQ2ni9tcNizQzEhOUE9BaBJXjUWqhiI,10948
|
| 237 |
+
networkx/algorithms/isomorphism/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 238 |
+
networkx/algorithms/isomorphism/tests/iso_r01_s80.A99,sha256=hKzMtYLUR8Oqp9pmJR6RwG7qo31aNPZcnXy4KHDGhqU,1442
|
| 239 |
+
networkx/algorithms/isomorphism/tests/iso_r01_s80.B99,sha256=AHx_W2xG4JEcz1xKoN5TwCHVE6-UO2PiMByynkd4TPE,1442
|
| 240 |
+
networkx/algorithms/isomorphism/tests/si2_b06_m200.A99,sha256=NVnPFA52amNl3qM55G1V9eL9ZlP9NwugBlPf-zekTFU,310
|
| 241 |
+
networkx/algorithms/isomorphism/tests/si2_b06_m200.B99,sha256=-clIDp05LFNRHA2BghhGTeyuXDqBBqA9XpEzpB7Ku7M,1602
|
| 242 |
+
networkx/algorithms/isomorphism/tests/test_ismags.py,sha256=8D1jWosarNJ0ZzCYgfwy0mB62YVZAMvG-UF9Q0peRa0,10581
|
| 243 |
+
networkx/algorithms/isomorphism/tests/test_isomorphism.py,sha256=kF-o4dTjB7Ad0NOHnUGoiOCCNr3MWSmJm_YBc-Wvhgk,2022
|
| 244 |
+
networkx/algorithms/isomorphism/tests/test_isomorphvf2.py,sha256=qisgeaCLO8ytf09DP7zANsnWdAHPu1lvJl4Gmg2zD6M,11747
|
| 245 |
+
networkx/algorithms/isomorphism/tests/test_match_helpers.py,sha256=uuTcvjgf2LPqSQzzECPIh0dezw8-a1IN0u42u8TxwAw,2483
|
| 246 |
+
networkx/algorithms/isomorphism/tests/test_temporalisomorphvf2.py,sha256=k8032J4ItZ4aFHeOraOpiF8y4aPm2O1g44UvUfrQJgg,7343
|
| 247 |
+
networkx/algorithms/isomorphism/tests/test_tree_isomorphism.py,sha256=0-7waJjupg8AWfQDqrcsJVOgTXk7HePr5kt87MgnPtM,7412
|
| 248 |
+
networkx/algorithms/isomorphism/tests/test_vf2pp.py,sha256=65RkN1mPWLoxirE7SlIvfaKMJk80b_ZwWG6HTJtlkPg,49924
|
| 249 |
+
networkx/algorithms/isomorphism/tests/test_vf2pp_helpers.py,sha256=HnXcdy2LTBFX423nIdJ8CbwmfkHFmzf1XNa8-xld5jk,90125
|
| 250 |
+
networkx/algorithms/isomorphism/tests/test_vf2userfunc.py,sha256=KMRPb-m3fmvRF0vt9laKIzOfwnrkxN2SueLv7JWUuXs,6625
|
| 251 |
+
networkx/algorithms/isomorphism/tree_isomorphism.py,sha256=fj1cUspSojUVwmAdWKGzXEHqOawUNJgzfO9QjCEnPLs,9454
|
| 252 |
+
networkx/algorithms/isomorphism/vf2pp.py,sha256=WNXf7g0u3c8R3IsX2YuP3gWU5sjb0uqjuDSvmtob_QE,36421
|
| 253 |
+
networkx/algorithms/isomorphism/vf2userfunc.py,sha256=HiPwyr7nJF1QS9w69MzKf6wGvO8cgjvdS5vW59iwCew,7371
|
| 254 |
+
networkx/algorithms/link_analysis/__init__.py,sha256=UkcgTDdzsIu-jsJ4jBwP8sF2CsRPC1YcZZT-q5Wlj3I,118
|
| 255 |
+
networkx/algorithms/link_analysis/hits_alg.py,sha256=OJ2DPKn_qGDBiW7Tln8_vLtJGvBkzWbOxylbHn95ne4,10421
|
| 256 |
+
networkx/algorithms/link_analysis/pagerank_alg.py,sha256=BlJr6dsDfUNdU0mH8BmqWLt8Hzra-wBwWmQFHArTJc8,17191
|
| 257 |
+
networkx/algorithms/link_analysis/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 258 |
+
networkx/algorithms/link_analysis/tests/test_hits.py,sha256=QjSZZmrj3rBLNVpKOIHUvJNYM7OJ1b-yjiaglyVzNyw,2547
|
| 259 |
+
networkx/algorithms/link_analysis/tests/test_pagerank.py,sha256=szFqJoRJrDojANbuAaw7kfX-cLjEne6tOyek3-Cax_4,7283
|
| 260 |
+
networkx/algorithms/link_prediction.py,sha256=UYo_LJgoVXcM1iLMXswM2g4jvUJmvxln3e5bVfXxQ10,22253
|
| 261 |
+
networkx/algorithms/lowest_common_ancestors.py,sha256=xP0hkaJzwrj4evzahYvIjtUhaodj4FYv4JB51PWwVpc,9198
|
| 262 |
+
networkx/algorithms/matching.py,sha256=bEvhXTFcRa-ZMNugIyM14rJ5QAcQkcZ2j-YJ-PTGQ3w,44550
|
| 263 |
+
networkx/algorithms/minors/__init__.py,sha256=ceeKdsZ6U1H40ED-KmtVGkbADxeWMTVG07Ja8P7N_Pg,587
|
| 264 |
+
networkx/algorithms/minors/contraction.py,sha256=EviSuRlx5EsGiWNbGrSSfAYfPV19jzIN8H_l596YHbI,22870
|
| 265 |
+
networkx/algorithms/minors/tests/test_contraction.py,sha256=YjBXi-byijqbh_OxLpLK7_au5A5YCoVTlta7hnnK4Gg,14213
|
| 266 |
+
networkx/algorithms/mis.py,sha256=BEMv_dW8R6CjMMXJQGIhS4HpS8A8AkLJJWnz3GstuS4,2344
|
| 267 |
+
networkx/algorithms/moral.py,sha256=z5lp42k4kqYk7t_FfszVj5KAC7BxXe6Adik3T2qvA6o,1535
|
| 268 |
+
networkx/algorithms/node_classification.py,sha256=a2mVO7NI2IQF4Cd2Mx7TMLoTEu5HNG9RB5sEHQ19Wdw,6469
|
| 269 |
+
networkx/algorithms/non_randomness.py,sha256=Uag54gFi5DR5uAQNFXyKKyORQuowTPuhq_QsjZaVMJ4,3068
|
| 270 |
+
networkx/algorithms/operators/__init__.py,sha256=dJ3xOXvHxSzzM3-YcfvjGTJ_ndxULF1TybkIRzUS87Y,201
|
| 271 |
+
networkx/algorithms/operators/all.py,sha256=pNIKjEiSBBiUa6zcYZHQIiiHq3C9hnazSyaIpasvBxw,9652
|
| 272 |
+
networkx/algorithms/operators/binary.py,sha256=mRgkFsPoAw2PuqMIwRmS59vYC2KFJ47dB_lct5HRAh4,12948
|
| 273 |
+
networkx/algorithms/operators/product.py,sha256=FQkSIduOv-z1ktVzid2T40759S-BmAfTlya88VytuZc,19632
|
| 274 |
+
networkx/algorithms/operators/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 275 |
+
networkx/algorithms/operators/tests/test_all.py,sha256=Pqjv9QiA0875Yl9D5o6c5Ml0t4KHpH2a5jbpAoZQXFc,8250
|
| 276 |
+
networkx/algorithms/operators/tests/test_binary.py,sha256=QzQTfnkHf1ulVvvNsclfkQgzRGc9hGQdZDyf4F9O5n8,12171
|
| 277 |
+
networkx/algorithms/operators/tests/test_product.py,sha256=i4pBb5A4NmaCsllR1XizyhUToaQFMuLZ-JrywkQFdbU,15155
|
| 278 |
+
networkx/algorithms/operators/tests/test_unary.py,sha256=UZdzbt5GI9hnflEizUWXihGqBWmSFJDkzjwVv6wziQE,1415
|
| 279 |
+
networkx/algorithms/operators/unary.py,sha256=Eo2yeTg-F5uODGWSWR_im5VaKZQ97LyATIuKZcAFQR8,1795
|
| 280 |
+
networkx/algorithms/planar_drawing.py,sha256=AXuoT3aFgEtCeMnAaUsRqjxCABdNYZ8Oo9sGOKBQto0,16254
|
| 281 |
+
networkx/algorithms/planarity.py,sha256=PhIhnecPna-J_v7taoj-Ie175XWayVfcuMDHkj2bWLc,47249
|
| 282 |
+
networkx/algorithms/polynomials.py,sha256=iP30_mcOlj81Vrzt4iB_ZZxYiRokubs-O1i9RW4pgTw,11278
|
| 283 |
+
networkx/algorithms/reciprocity.py,sha256=1WMhLbSMkVPxRPlfUvbgO5FgVvJHn1doXQF4WuqSLQk,2855
|
| 284 |
+
networkx/algorithms/regular.py,sha256=lEhYCP4Yysz8oTdxY8m40oqZcdhjKJuDsEj-P310loI,6794
|
| 285 |
+
networkx/algorithms/richclub.py,sha256=kARzso3M6wnUcAJo2g8ga_ZtigL2czDNzeUDzBtRfqo,4892
|
| 286 |
+
networkx/algorithms/shortest_paths/__init__.py,sha256=Rmxtsje-mPdQyeYhE8TP2NId-iZEOu4eAsWhVRm2Xqk,285
|
| 287 |
+
networkx/algorithms/shortest_paths/astar.py,sha256=EhUUKwQ6kGBPVXVA7inJN3tb5nr45M99kEDygVcLPf8,8967
|
| 288 |
+
networkx/algorithms/shortest_paths/dense.py,sha256=rdMTlAwrboZMaA8Hj0RmbEpqNNU9zmBxk5Ljswsg37U,8211
|
| 289 |
+
networkx/algorithms/shortest_paths/generic.py,sha256=6N22Kf1t-7HFPn2-QoLqbm1kJSKk5dWCimNi8UuYzM4,25738
|
| 290 |
+
networkx/algorithms/shortest_paths/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 291 |
+
networkx/algorithms/shortest_paths/tests/test_astar.py,sha256=G9hrEo2U9c_kzaRTAXYbS1TpcJgF_uqj9249K2qbjAY,8941
|
| 292 |
+
networkx/algorithms/shortest_paths/tests/test_dense.py,sha256=ievl4gu3Exl_31hp4OKcsAGPb3g3_xFUM4t3NnvrG_A,6747
|
| 293 |
+
networkx/algorithms/shortest_paths/tests/test_dense_numpy.py,sha256=BNwXCe2wgNPE8o35-shPsFj8l19c_QG6Ye8tkIGphf8,2300
|
| 294 |
+
networkx/algorithms/shortest_paths/tests/test_generic.py,sha256=oJBKCLIsMA1KTo8q-oG9JQmaxysc7_QSgbBqMImh23c,18456
|
| 295 |
+
networkx/algorithms/shortest_paths/tests/test_unweighted.py,sha256=kMDgx5JP2QHyOST41zhyUiSc3qajKalAJP6W0Mt3oeg,5891
|
| 296 |
+
networkx/algorithms/shortest_paths/tests/test_weighted.py,sha256=dmzFBYN3QEDZoun7RAtSe_spsGSbvkDiJSgUf9e-1K8,35038
|
| 297 |
+
networkx/algorithms/shortest_paths/unweighted.py,sha256=3Up0AF835pSSgSQjzmTK8fw42o0CGc-tsrjenTRfjQc,15642
|
| 298 |
+
networkx/algorithms/shortest_paths/weighted.py,sha256=AGX34ATlzEi1_cyayRzxeUnEPjauQmbc-nKBng6wAL0,82465
|
| 299 |
+
networkx/algorithms/similarity.py,sha256=My2MeE7AsIrCfXEkX-IYfbpbcNL3O7ZUkFtlzzF-j_8,61093
|
| 300 |
+
networkx/algorithms/simple_paths.py,sha256=LFdFNltpt-rRI94x7HVDQooNbgm-urkzGQCxVHfIR5Q,30320
|
| 301 |
+
networkx/algorithms/smallworld.py,sha256=3xT-z2_CVdp5-Ap8vF6fsd3DiavDYtspFNZrcwcpXG0,13565
|
| 302 |
+
networkx/algorithms/smetric.py,sha256=_Aj4BIMnafiXbJtLkvAfAnIEMdI9OcVvMy6kk9KKTns,770
|
| 303 |
+
networkx/algorithms/sparsifiers.py,sha256=4T8pMlh-usEHA2-rZFh-CmZbBY9dcXIHjoqR-oJ2hSw,10048
|
| 304 |
+
networkx/algorithms/structuralholes.py,sha256=CS89P45_m1JGFGnSGA-FlC2xnt0BYq3O5ky1zkjYEDI,9342
|
| 305 |
+
networkx/algorithms/summarization.py,sha256=CygTsSthyCKHs0ZTZsCgWnyaT8annQbLpUtahmfY9Sw,23251
|
| 306 |
+
networkx/algorithms/swap.py,sha256=NVZMmlnkdxgwwNw5GDrc8waNERcdCu52ydHcBdOA_hw,14744
|
| 307 |
+
networkx/algorithms/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 308 |
+
networkx/algorithms/tests/test_asteroidal.py,sha256=DnWI5_jnaaZMxtG44XD0K690HZs8ez7HU_9dSR-p6eA,502
|
| 309 |
+
networkx/algorithms/tests/test_boundary.py,sha256=1OSJh32FYFhAVYB5zqxhZGEXZLS0HPp9kvfHZvWmD3o,6227
|
| 310 |
+
networkx/algorithms/tests/test_bridges.py,sha256=jSCguECho0GNHnu0vpRh1twyfGP6tWFcaYL1rgvc8mU,4026
|
| 311 |
+
networkx/algorithms/tests/test_broadcasting.py,sha256=2LIMrKmSGSSWRLy5TR_NzDQD1annA2JohpsbEbVJKfE,2021
|
| 312 |
+
networkx/algorithms/tests/test_chains.py,sha256=Vhpf0maR3OUaa6aUxC6FNYLeUvBKPZyFimM4_WsLQKo,4364
|
| 313 |
+
networkx/algorithms/tests/test_chordal.py,sha256=DPdNPY7KtqCsCwYVb4xQfnIm-z35dUJIWxNHtAiQLAQ,4438
|
| 314 |
+
networkx/algorithms/tests/test_clique.py,sha256=FPIF2f8NLODsz-k_qrHt7DolClV_VdNWSh68oe8-ygI,9413
|
| 315 |
+
networkx/algorithms/tests/test_cluster.py,sha256=CzYPJm4QY5SL-amMNh2ItPgQ-FjePPG9EBfIKOZHp6s,15883
|
| 316 |
+
networkx/algorithms/tests/test_communicability.py,sha256=4KK9wU9gAUqHAAAyHwAKpq2dV9g415s_X0qd7Tt83gU,2938
|
| 317 |
+
networkx/algorithms/tests/test_core.py,sha256=CF7YPX3F2pUtBu2sp4ZEAGRldaBkdgr1ufk6UkrETuA,9555
|
| 318 |
+
networkx/algorithms/tests/test_covering.py,sha256=EeBjQ5mxcVctgavqXZ255T8ryFocuxjxdVpIxVUNFvw,2718
|
| 319 |
+
networkx/algorithms/tests/test_cuts.py,sha256=gKm9VDtnmwFli6kgwV1ktEFI_rw84p2Sg02Em6SoW5Q,5376
|
| 320 |
+
networkx/algorithms/tests/test_cycles.py,sha256=Sp7PSNB8iy_iST90uNDv8mXwiSOXWRYLkUFJz9pwHWU,34424
|
| 321 |
+
networkx/algorithms/tests/test_d_separation.py,sha256=ZypzMVDpBZo_4qBlieFlj3RVU6vh7tejEZGlu7qcQbc,10929
|
| 322 |
+
networkx/algorithms/tests/test_dag.py,sha256=aEUvVl7Ht3XC2XdBanoCDNM7vpPb8YELvMQDawLZbhQ,29385
|
| 323 |
+
networkx/algorithms/tests/test_distance_measures.py,sha256=WHsOxV9mI-PqJa08C65Gd3myv5G7fzDehX_atJLql7Q,26154
|
| 324 |
+
networkx/algorithms/tests/test_distance_regular.py,sha256=w27OTUtAI0VQv7cikkOdJg4bo4q7xTNIVE8nbU_x7b8,2915
|
| 325 |
+
networkx/algorithms/tests/test_dominance.py,sha256=QVBj3SarZNm57YKavOLFtwU43xn4fxcEU6chn2Gfuaw,9194
|
| 326 |
+
networkx/algorithms/tests/test_dominating.py,sha256=hyta7ln6BbHaGlpEUla6jVzh2PRuSjvujLSGXrmwZbc,1228
|
| 327 |
+
networkx/algorithms/tests/test_efficiency.py,sha256=QKWMvyjCG1Byt-oNp7Rz_qxnVeT77Zk27lrzI1qH0mA,1894
|
| 328 |
+
networkx/algorithms/tests/test_euler.py,sha256=L4L1ljHVxQxjQQludO2r6k3UZU7WAY_N6WYUjFx1fEk,11209
|
| 329 |
+
networkx/algorithms/tests/test_graph_hashing.py,sha256=MqRwsNbyRWUy94V7UuDqEREuHxFTSn7-d0HzwSDI2As,24534
|
| 330 |
+
networkx/algorithms/tests/test_graphical.py,sha256=uhFjvs04odxABToY4IRig_CaUTpAC3SfZRu1p1T7FwY,5366
|
| 331 |
+
networkx/algorithms/tests/test_hierarchy.py,sha256=uW8DqCdXiAeypkNPKcAYX7aW86CawYH84Q0bW4cDTXo,1184
|
| 332 |
+
networkx/algorithms/tests/test_hybrid.py,sha256=kQLzaMoqZcKFaJ3D7PKbY2O-FX59XDZ1pN5un8My-tk,720
|
| 333 |
+
networkx/algorithms/tests/test_isolate.py,sha256=LyR0YYHJDH5vppQzGzGiJK-aaIV17_Jmla8dMf93olg,555
|
| 334 |
+
networkx/algorithms/tests/test_link_prediction.py,sha256=Jah4vOGDYcWaPSl_iG-0fOXnhu5o8f6wcfakRmWuX7I,20004
|
| 335 |
+
networkx/algorithms/tests/test_lowest_common_ancestors.py,sha256=GvhYCQMnVYD9LHPCNFgWMAUmOV8V5gko0fe05zi1JwU,13153
|
| 336 |
+
networkx/algorithms/tests/test_matching.py,sha256=jhehNkApE5RuMPtbjWNeHn0tPqhVz65mL7QakfRA3Vw,20174
|
| 337 |
+
networkx/algorithms/tests/test_max_weight_clique.py,sha256=M1eoy8OtuQVZkEvNMauV9vqR6hHtOCrtq6INv2qzMyA,6739
|
| 338 |
+
networkx/algorithms/tests/test_mis.py,sha256=Z2tKoqbs-AFPzEBDYO7S8U-F7usLfZJ2l6j2DpZUts4,1865
|
| 339 |
+
networkx/algorithms/tests/test_moral.py,sha256=15PZgkx7O9aXQB1npQ2JNqBBkEqPPP2RfeZzKqY-GNU,452
|
| 340 |
+
networkx/algorithms/tests/test_node_classification.py,sha256=NgJJKUHH1GoD1GE3F4QRYBLM3fUo_En3RNtZvhqCjlg,4663
|
| 341 |
+
networkx/algorithms/tests/test_non_randomness.py,sha256=xMkJp0F91Qn45EUuMottk1WSDfOQ90TDQfZFDSJ8tkE,1000
|
| 342 |
+
networkx/algorithms/tests/test_planar_drawing.py,sha256=NN55y2cs9IdZYwUsG-RbI07aGSMx5gp5vnmGLC2vopo,8765
|
| 343 |
+
networkx/algorithms/tests/test_planarity.py,sha256=rrIGX28JoG_DqINsuY4TSdDloxnz4dkCd3xeRo9Svqs,16386
|
| 344 |
+
networkx/algorithms/tests/test_polynomials.py,sha256=baI0Kua1pRngRC6Scm5gRRwi1bl0iET5_Xxo3AZTP3A,1983
|
| 345 |
+
networkx/algorithms/tests/test_reciprocity.py,sha256=X_PXWFOTzuEcyMWpRdwEJfm8lJOfNE_1rb9AAybf4is,1296
|
| 346 |
+
networkx/algorithms/tests/test_regular.py,sha256=5KGvwhixanEigI0KgeUJ1hWPw7YRGZgNbrMkKcndd5M,2626
|
| 347 |
+
networkx/algorithms/tests/test_richclub.py,sha256=ql_j69gIoph8d6oD2tzDqu3b-uW884nmEJZQmWANR6k,3965
|
| 348 |
+
networkx/algorithms/tests/test_similarity.py,sha256=BV5f4DiSQHPsXkSosf29idxGQ_wLiTwEsiHtgDOLLw4,33189
|
| 349 |
+
networkx/algorithms/tests/test_simple_paths.py,sha256=7U9wCXz4SHK0XeYrs1k2KjYgrYVQDnts2ggQLzU18p0,25181
|
| 350 |
+
networkx/algorithms/tests/test_smallworld.py,sha256=rfgNCRU6YF55f8sCuA5WmX6MmhDci89Tb4jaz4ALjcQ,2405
|
| 351 |
+
networkx/algorithms/tests/test_smetric.py,sha256=VM14L4X1AABvINDL9qKXzlech_Q2g4Aee-ozWM2Qrr4,144
|
| 352 |
+
networkx/algorithms/tests/test_sparsifiers.py,sha256=1GRbQy1vfmwv6eUhP4Io0aykH2VyTJfFWmncrXmTqi4,4044
|
| 353 |
+
networkx/algorithms/tests/test_structuralholes.py,sha256=NsQfW85GquVUndyHBVo5OMku_C8i8bfE-4WXJr5dILw,5290
|
| 354 |
+
networkx/algorithms/tests/test_summarization.py,sha256=uNyaUstobIEu6M_Hexik-3YiYTRSy_XO6LUqoE4wazw,21312
|
| 355 |
+
networkx/algorithms/tests/test_swap.py,sha256=WJtGMkSbAd1Cv06VaUeDVHosNOtdigsqEspyux0ExCs,6144
|
| 356 |
+
networkx/algorithms/tests/test_threshold.py,sha256=RF_SM5tdMGJfEHETO19mFicnt69UIlvVeuCwI7rxb0M,9751
|
| 357 |
+
networkx/algorithms/tests/test_time_dependent.py,sha256=NmuV2kDo4nh2MeN0hwcJf0QSDtqMD0dfSeeKSsYBtQ8,13342
|
| 358 |
+
networkx/algorithms/tests/test_tournament.py,sha256=XF6TwqPwJ7bKKuD7vM1Q7a9NnKerk38lWghvqTekQfk,4159
|
| 359 |
+
networkx/algorithms/tests/test_triads.py,sha256=anSuYt1ZmV0_aGtSPLl5YxEQZHOuo0QndNADUdZKqdY,9383
|
| 360 |
+
networkx/algorithms/tests/test_vitality.py,sha256=p5lPWCtVMtbvxDw6TJUaf8vpb0zKPoz5pND722xiypQ,1380
|
| 361 |
+
networkx/algorithms/tests/test_voronoi.py,sha256=M4B6JtkJUw56ULEWRs1kyVEUsroNrnb5FBq9OioAyHM,3477
|
| 362 |
+
networkx/algorithms/tests/test_walks.py,sha256=X8cb-YvGHiiqbMEXuKMSdTAb9WtVtbHjIESNSqpJTmU,1499
|
| 363 |
+
networkx/algorithms/tests/test_wiener.py,sha256=k9ld7wdPq5knS6cjo0hja8aWL-cdxYKGRpDU0z3cvNI,3209
|
| 364 |
+
networkx/algorithms/threshold.py,sha256=1HBOrQTyEaEp2uoIHsAlTEMpYAYXoRnR-6PaOKIjdZE,31150
|
| 365 |
+
networkx/algorithms/time_dependent.py,sha256=PAeJ7Yt8kUqbDgvBaz_ZfUFZg-w-vf1gPC0HO6go_TI,5762
|
| 366 |
+
networkx/algorithms/tournament.py,sha256=nx-PSefooyyYAwhFa9a7SRZSRL_ky5Rq19lYP79-0E8,11579
|
| 367 |
+
networkx/algorithms/traversal/__init__.py,sha256=YtFrfNjciqTOI6jGePQaJ01tRSEQXTHqTGGNhDEDb_8,142
|
| 368 |
+
networkx/algorithms/traversal/beamsearch.py,sha256=Vn0U4Wck8ICShIAGggv3tVtQWVW0ABEz_hcBsGrql6o,3473
|
| 369 |
+
networkx/algorithms/traversal/breadth_first_search.py,sha256=iFE-rskYn-oOOEI8ocCbCD3QMH5PX41RP8Xb2Krb2H8,18288
|
| 370 |
+
networkx/algorithms/traversal/depth_first_search.py,sha256=2V4T3tGujcAtV3W6WcTQUjGAAe3b1rqinONowUhLsa8,16795
|
| 371 |
+
networkx/algorithms/traversal/edgebfs.py,sha256=s8lugT0l6J8HRmB8dCs3D1UxZa95SGHGyP2WCfaABOc,6244
|
| 372 |
+
networkx/algorithms/traversal/edgedfs.py,sha256=_s9N4UKaEi8sRtJ604qPHl_NIM92rOLkgec9ZPwZYp0,5957
|
| 373 |
+
networkx/algorithms/traversal/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 374 |
+
networkx/algorithms/traversal/tests/test_beamsearch.py,sha256=bzUcswZ1qo0ecDZYSER_4enbsW6SjTpb_3Nb3fqmkAo,900
|
| 375 |
+
networkx/algorithms/traversal/tests/test_bfs.py,sha256=mOMBIo1SEplTa0zQI3XN__UovQgd573t8q2_rxu7e90,6465
|
| 376 |
+
networkx/algorithms/traversal/tests/test_dfs.py,sha256=EqLV_C-3frQ89C-SD0jtHvWEankNfPXm6M76JDdenq0,10604
|
| 377 |
+
networkx/algorithms/traversal/tests/test_edgebfs.py,sha256=8oplCu0fct3QipT0JB0-292EA2aOm8zWlMkPedfe6iY,4702
|
| 378 |
+
networkx/algorithms/traversal/tests/test_edgedfs.py,sha256=HGmC3GUYSn9XLMHQpdefdE6g-Uh3KqbmgEEXBcckdYc,4775
|
| 379 |
+
networkx/algorithms/tree/__init__.py,sha256=wm_FjX3G7hqJfyNmeEaJsRjZI-8Kkv0Nb5jAmQNXzSc,149
|
| 380 |
+
networkx/algorithms/tree/branchings.py,sha256=B0c_uKpcnV2SwJMZJRK0BMEz8LkvIcOhv1y0AI0gTnY,34339
|
| 381 |
+
networkx/algorithms/tree/coding.py,sha256=uFqGL6g1QWjGC4F9MCrsz_8rjWeuMJr5HUumGNsqXV4,13464
|
| 382 |
+
networkx/algorithms/tree/decomposition.py,sha256=lY_rqx9JxnLEkp1wiAv0mX62PGPwGQ6SW4Jp48o8aiw,3071
|
| 383 |
+
networkx/algorithms/tree/mst.py,sha256=nvaqotj00pnqAMY6_mOr8YLAAd2u-ApefXzzWU_4JVo,46140
|
| 384 |
+
networkx/algorithms/tree/operations.py,sha256=1N6AH0vfY2QyyYBH_OOE0b7dS7dx9-pT3cOTQVmE1A0,4042
|
| 385 |
+
networkx/algorithms/tree/recognition.py,sha256=bYnaDN0ZaIWTgq0tbPEHAcdxQBWZpDvWypZarBbA334,7569
|
| 386 |
+
networkx/algorithms/tree/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 387 |
+
networkx/algorithms/tree/tests/test_branchings.py,sha256=uSMc57nLXLBRgm_ERqUSNSrTfq9R3ZWDFkyrG3KR8Vs,17727
|
| 388 |
+
networkx/algorithms/tree/tests/test_coding.py,sha256=XC6SbfA2zVGH4FyJJyv6o8eOnBu7FNzNot3SKs7QmEo,3955
|
| 389 |
+
networkx/algorithms/tree/tests/test_decomposition.py,sha256=vnl_xoQzi1LnlZL25vXOZWwvaWmon3-x222OKt4eDqE,1871
|
| 390 |
+
networkx/algorithms/tree/tests/test_mst.py,sha256=ad6kAEpAF9PH1FyD_jHa2xnAtgBGs75sYGTY0s530BQ,31631
|
| 391 |
+
networkx/algorithms/tree/tests/test_operations.py,sha256=ybU96kROTVJRTyjLG7JSJjYlPxaWmYjUVJqbXV5VGGI,1961
|
| 392 |
+
networkx/algorithms/tree/tests/test_recognition.py,sha256=qeMEIvg-j2MqaU-TNIQhCcXxao8vTBy0wjpU7jr2iw8,4521
|
| 393 |
+
networkx/algorithms/triads.py,sha256=Gf0f6liwgARszL-R4yQle-ogGH4mJkF-gureeUTxGyY,16853
|
| 394 |
+
networkx/algorithms/vitality.py,sha256=8M1cubIydO49El2kwVCURHZ2UwCtfGVFeGS8-JYt1ko,2289
|
| 395 |
+
networkx/algorithms/voronoi.py,sha256=07SnSpxLDz4k6K59Jo-VTNA-Qy5knaHfBC-y_5vAOLQ,3183
|
| 396 |
+
networkx/algorithms/walks.py,sha256=0JOLhpAyeNzmF8EtlVlYOWEPJJvCIltt7tbk1Vx52dI,2427
|
| 397 |
+
networkx/algorithms/wiener.py,sha256=WOUG0L5xDKpY4uspyI-oDo1hWuHxbUnTFZEe_-IAx5M,7639
|
| 398 |
+
networkx/classes/__init__.py,sha256=Q9oONJrnTFs874SGpwcbV_kyJTDcrLI69GFt99MiE6I,364
|
| 399 |
+
networkx/classes/coreviews.py,sha256=9koRKORoAkI0spB-yMCkqXvry7mMd6hmSPhBab3SzcE,13143
|
| 400 |
+
networkx/classes/digraph.py,sha256=Fup1GbADCpXKLA12M67RbhA0cm6BGi_4cIxBLsjHEtc,48101
|
| 401 |
+
networkx/classes/filters.py,sha256=PCy7BsoIby8VcamqDjZQiNAe_5egI0WKUq-y5nc9unQ,2817
|
| 402 |
+
networkx/classes/function.py,sha256=H6ho_EtU8zRTNv4VCaLb_BY_56PplSiftktk-OkqdcU,38898
|
| 403 |
+
networkx/classes/graph.py,sha256=bc5yHCeDu0XyfBOR0nRx9rEMOpry9FdezxqiCIYPH1E,71102
|
| 404 |
+
networkx/classes/graphviews.py,sha256=ulUTLozEK_hj_4TGHdgvxveR2-rb92Q14jjxH4oH4Go,8520
|
| 405 |
+
networkx/classes/multidigraph.py,sha256=aOqjfSJ6Lx9l-1zwCIMNYRW0mW1wPDniEcRWQ8gKmYY,36351
|
| 406 |
+
networkx/classes/multigraph.py,sha256=PSZR7QgyszlO5PqzhxI954LySqLHq-589OQrCOtC9pw,47248
|
| 407 |
+
networkx/classes/reportviews.py,sha256=u0hNZqaWXCfLMP_lq835XCIVStkZQJ9HaQPeDPPoo88,46132
|
| 408 |
+
networkx/classes/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 409 |
+
networkx/classes/tests/dispatch_interface.py,sha256=OA4t1XQX7Qqm3pGhTZYKno4c_zbIcvpSWstO_LXIVRo,6479
|
| 410 |
+
networkx/classes/tests/historical_tests.py,sha256=nrv0ccvUMtp714VEV1I9UTwWz8ohgujbC-Xnxpc7kU8,16174
|
| 411 |
+
networkx/classes/tests/test_coreviews.py,sha256=qzdozzWK8vLag-CAUqrXAM2CZZwMFN5vMu6Tdrwdf-E,12128
|
| 412 |
+
networkx/classes/tests/test_digraph.py,sha256=uw0FuEu3y_YI-PSGuQCRytFpXLF7Eye2fqLJaKbXkBc,12283
|
| 413 |
+
networkx/classes/tests/test_digraph_historical.py,sha256=Q8DGba1o0xRZfdsQxreq9naREFSgVhbaZOvTT7W8mdc,3684
|
| 414 |
+
networkx/classes/tests/test_filters.py,sha256=fBLig8z548gsBBlQw6VJdGZb4IcqJj7_0mi2Fd2ncEM,5851
|
| 415 |
+
networkx/classes/tests/test_function.py,sha256=a7fsmmdOSX-OYTEP0RV27vh4e_jyZh9w6SX1iABMVq0,34997
|
| 416 |
+
networkx/classes/tests/test_graph.py,sha256=77t7pk1Pmz-txewyD2Dv19Vva6vWpWCtJSPtFx-EY_Y,30913
|
| 417 |
+
networkx/classes/tests/test_graph_historical.py,sha256=Jl3aCS1BtwoCRdajMKDZcMQRypkOis0J_XU2LHEmYUE,274
|
| 418 |
+
networkx/classes/tests/test_graphviews.py,sha256=i4x3ii8--PPg_pK4YA8aMR1axUQCdXZYpzmB05iEAOg,11466
|
| 419 |
+
networkx/classes/tests/test_multidigraph.py,sha256=ryTKegCoYixXbAqOn3mIt9vSMb5666Dv-pfMkXEjoUE,16342
|
| 420 |
+
networkx/classes/tests/test_multigraph.py,sha256=0vFQO3RCJaBpzXvnQzdWa_qYLHNo_I9DICYhPZJNUMk,18777
|
| 421 |
+
networkx/classes/tests/test_reportviews.py,sha256=dNL6fMMsumYKU4Q_kx-vsXB3GU9xTQxrQn45qoa8e8I,41919
|
| 422 |
+
networkx/classes/tests/test_special.py,sha256=IJsmqCS9LrTDoZ11KPmo-UOI7xEskL7NyduEJNPMNqs,4103
|
| 423 |
+
networkx/classes/tests/test_subgraphviews.py,sha256=1dcJHq3F00LyoFSu6CTFPqS7DFIkWK1PyQu4QvJh5ko,13223
|
| 424 |
+
networkx/conftest.py,sha256=0wpXc9prGYLSw5gG-VvummltLxH5RtKeGwrxFsChe4E,8883
|
| 425 |
+
networkx/convert.py,sha256=yB_MTl3GEvNb3CgDcBiCrhIN4LlV5N_BN9A0ykhBr7E,16025
|
| 426 |
+
networkx/convert_matrix.py,sha256=7kc66-0XFGQUox3fVZuapUV4qCprg92ECe9BMjfSpCE,45383
|
| 427 |
+
networkx/drawing/__init__.py,sha256=rnTFNzLc4fis1hTAEpnWTC80neAR88-llVQ-LObN-i4,160
|
| 428 |
+
networkx/drawing/layout.py,sha256=eA5YJ2xA-AYDL1WFICETTqfnl7amjRYfkgOJEJbigvw,50243
|
| 429 |
+
networkx/drawing/nx_agraph.py,sha256=bbtLuusDb4vNu6EPF9rgBdJsP-DaIFyzPgxBn5KEA1I,13937
|
| 430 |
+
networkx/drawing/nx_latex.py,sha256=zSGYPpn3wewWaEBCJerq6gRb5RmKP9SY0sLWhyqD8Xo,24805
|
| 431 |
+
networkx/drawing/nx_pydot.py,sha256=b_USURmDffy1KWh2ue1vMf99-zCJiETldIDS7HGHitc,9591
|
| 432 |
+
networkx/drawing/nx_pylab.py,sha256=WTqktY5niRF56x4bsotbGrastccRtgUcsxjqYt8Oe_s,66369
|
| 433 |
+
networkx/drawing/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 434 |
+
networkx/drawing/tests/baseline/test_house_with_colors.png,sha256=FQi9pIRFwjq4gvgB8cDdBHL5euQUJFw6sQlABf2kRVo,21918
|
| 435 |
+
networkx/drawing/tests/test_agraph.py,sha256=BzrfyQYEtaUbxOzhROLE6njzpG6ZxW7QkRdpVholLAY,8789
|
| 436 |
+
networkx/drawing/tests/test_latex.py,sha256=_Wng73kMltC-_sUoxdo2uBL2bkEc7HMqkKhwo9ZDJGA,8710
|
| 437 |
+
networkx/drawing/tests/test_layout.py,sha256=IWl7cCFb_eGowjACF5tki9voThOzHNpPgjkonzH-pzQ,20611
|
| 438 |
+
networkx/drawing/tests/test_pydot.py,sha256=X9b66gWqMgdTEyRJ7Zmy5kL9cr22waI688K9BJUf4Bk,4973
|
| 439 |
+
networkx/drawing/tests/test_pylab.py,sha256=KgWiNwgkdSn-A36-DP68ZFibbb6JWV4SOJA7O433Y5U,35921
|
| 440 |
+
networkx/exception.py,sha256=hC8efPfIzOFo0jiWiQbTPaNKuNTuUwhp9RPw--pdv4U,3787
|
| 441 |
+
networkx/generators/__init__.py,sha256=EoYB5c5ZE4rsNKZvl1TRQy2Vo2D3T2H-YunyD2i6sa0,1366
|
| 442 |
+
networkx/generators/atlas.dat.gz,sha256=c_xBbfAWSSNgd1HLdZ9K6B3rX2VQvyW-Wcht47dH5B0,8887
|
| 443 |
+
networkx/generators/atlas.py,sha256=07Xegzj5j_SiApgzgve2rSTXp0nmWwCw7-1keUjbvRo,5606
|
| 444 |
+
networkx/generators/classic.py,sha256=68lCnSeo50uV1yoc6ZvjnckR7lAbrhUdniyEogczvB4,32000
|
| 445 |
+
networkx/generators/cographs.py,sha256=-WR4_yrNk_X5nj7egb7A22eKPVymOdIYM-IftSRH4WA,1891
|
| 446 |
+
networkx/generators/community.py,sha256=_p_4OfItbg8nS0b3EvojCXZ8cESdC-0Gj67V5w2veuM,34911
|
| 447 |
+
networkx/generators/degree_seq.py,sha256=97XUApgQZrpSxyXODgVLP9drX5rEF-Xb40bYqaBGSj0,30173
|
| 448 |
+
networkx/generators/directed.py,sha256=Vcg0zeWFS2-F99bFmhXj4mzlCy_yoBuuqjnSx5I-Dco,15696
|
| 449 |
+
networkx/generators/duplication.py,sha256=hmYAHJBez7WlfdVGGa288JFUBHoIUdVqEGCodApKOr4,5831
|
| 450 |
+
networkx/generators/ego.py,sha256=TZ-o05FpvVPAdXFBLjjfa2FnAcZwlgqr_1jMdLTzFSg,1900
|
| 451 |
+
networkx/generators/expanders.py,sha256=nJMys4kHNHZzC5jkyCFftw1W_6cF_r82eGTqn7cNrDo,14455
|
| 452 |
+
networkx/generators/geometric.py,sha256=cCrx1HdlLc08klO6bBzb-g0GUfF2AaktCrJOmhDSWUo,39610
|
| 453 |
+
networkx/generators/harary_graph.py,sha256=N6vzXKrW-ZU-xDc2ZTF_Gf7kb0LRQVRfK2oLBQvyVO8,6159
|
| 454 |
+
networkx/generators/internet_as_graphs.py,sha256=Y_pQaGhe183X6dXH4ocqIK3DzXRz0oXE-AKwsL1yCHk,14172
|
| 455 |
+
networkx/generators/intersection.py,sha256=EFm0AOjnqyp8KcT7kGWqANq-_vq9kQ0d_0DzVyQyP-o,4101
|
| 456 |
+
networkx/generators/interval_graph.py,sha256=ZTmdgQbBx3M6sysGWXbGyngYYOC1TAXD3Ozkw4deQFw,2204
|
| 457 |
+
networkx/generators/joint_degree_seq.py,sha256=nyp86NC_4XvzvwpwwzKrrCSz1i_4bESSDtVjWvpkWFg,24773
|
| 458 |
+
networkx/generators/lattice.py,sha256=kVCvTahWPQGNbok6maXfaqGzm88UuxhP7D9BkKhGW1o,13500
|
| 459 |
+
networkx/generators/line.py,sha256=4mFH60EsHvb4wW34E45Byl_rXjDPICD59caoAtOE8VI,17531
|
| 460 |
+
networkx/generators/mycielski.py,sha256=xBX2m77sCzumoH5cAGitksvEEW-ocbCnbdaN7fKUtVk,3314
|
| 461 |
+
networkx/generators/nonisomorphic_trees.py,sha256=gE7uPB-uaE6rEfaimmR9bqobso5yclcCG6u8zwZlS48,6453
|
| 462 |
+
networkx/generators/random_clustered.py,sha256=i_NdvvchHvsvbwgQtoWSY_pLwvhO9Lh02MSZXzgGb7c,4183
|
| 463 |
+
networkx/generators/random_graphs.py,sha256=qi_AjT9Hx5M6ujgTe-DBVIsY9LwqPPZjuAHFMIaQOOc,51346
|
| 464 |
+
networkx/generators/small.py,sha256=Xs9JNTtoLiShg7fF7_VRJ-G18JGSt4JEMmhhtpS51r8,28171
|
| 465 |
+
networkx/generators/social.py,sha256=IUVgWVMUmRaUG28U0KzB--0DtKLdCFDz54tkJ69W4ms,23437
|
| 466 |
+
networkx/generators/spectral_graph_forge.py,sha256=kF4SCE3dcgwBA9bMys5O-mCf529dFhraw3Zmy9GRnQ4,4240
|
| 467 |
+
networkx/generators/stochastic.py,sha256=Qg9vWm9EOug2OQVIHL_dZ5HrXc16lxnWyzX52KWNEPI,1981
|
| 468 |
+
networkx/generators/sudoku.py,sha256=kLM2AP0H4966uYiNO1oAFEmv5qBftU_bOfYucRxexM0,4288
|
| 469 |
+
networkx/generators/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 470 |
+
networkx/generators/tests/test_atlas.py,sha256=nwXJL4O5jUqhTwqhkPxHY8s3KXHQTDEdsfbg4MsSzVQ,2530
|
| 471 |
+
networkx/generators/tests/test_classic.py,sha256=PlEZOxT8XADzyDL-GIItEx66hW4bvVl4UCo4ojX4m80,24021
|
| 472 |
+
networkx/generators/tests/test_cographs.py,sha256=Khqvx15VNWHjNkMeEpsio3oJAi8KoiYqfTqKVbQWT9U,458
|
| 473 |
+
networkx/generators/tests/test_community.py,sha256=FGcDo3Ajb-yYc5kUkFbVfOJVMG-YppbAtjgBPcVzjLc,11311
|
| 474 |
+
networkx/generators/tests/test_degree_seq.py,sha256=in6lg1pwcAg1N08MA3lQdr3lnm2-aoUy3BRm6Yj_OBQ,7093
|
| 475 |
+
networkx/generators/tests/test_directed.py,sha256=A01l9R-VBauEN7UEtLkkp9SubjjrnC_QWR2w0Q5GHq0,5259
|
| 476 |
+
networkx/generators/tests/test_duplication.py,sha256=UdIGDF_fishanWid1xO_aH4NDfie8xpIqd26qndhOqI,3155
|
| 477 |
+
networkx/generators/tests/test_ego.py,sha256=8v1Qjmkli9wIhhUuqzgqCzysr0C1Z2C3oJMCUoNvgY4,1327
|
| 478 |
+
networkx/generators/tests/test_expanders.py,sha256=0X78pbB1PnW4pxa7UvlA5lzq6u0ZCfnvMBMYJvLHYH0,5602
|
| 479 |
+
networkx/generators/tests/test_geometric.py,sha256=gnVm4dam_Er88YwaNpNZC6mjJjfgwMYhyLOtU9oPn1o,18087
|
| 480 |
+
networkx/generators/tests/test_harary_graph.py,sha256=GiX5LXXJaNxzjvd-Nyw_QuARzbFGkA6zE1R1eX8mclw,4936
|
| 481 |
+
networkx/generators/tests/test_internet_as_graphs.py,sha256=QmzkOnWg9bcSrv31UcaD6Cko55AV-GPLLY5Aqb_Dmvs,6795
|
| 482 |
+
networkx/generators/tests/test_intersection.py,sha256=hcIit5fKfOn3VjMhz9KqovZK9tzxZfmC6ezvA7gZAvM,819
|
| 483 |
+
networkx/generators/tests/test_interval_graph.py,sha256=JYMi-QMkJQdBU9uOdfm0Xr6MEYqIbhU5oSDa6D3tSb0,4277
|
| 484 |
+
networkx/generators/tests/test_joint_degree_seq.py,sha256=8TXTZI3Um2gBXtP-4yhGKf9vCi78-NVmWZw9r9WG3F8,4270
|
| 485 |
+
networkx/generators/tests/test_lattice.py,sha256=q4Ri-dH9mKhfq0PNX9xMeYRUiP0JlPBr7piSruZlFlg,9290
|
| 486 |
+
networkx/generators/tests/test_line.py,sha256=vXncJuny2j5ulCJyT01Rt1tTwPib4XelS3dJDdJXjx0,10378
|
| 487 |
+
networkx/generators/tests/test_mycielski.py,sha256=fwZLO1ybcltRy6TzCel8tPBil1oZWv9QSXs779H6Xt0,946
|
| 488 |
+
networkx/generators/tests/test_nonisomorphic_trees.py,sha256=g5zkb0T7mkb2AdT-GkIGPXvahh9lv-f-XddJ80Y0Zfg,2454
|
| 489 |
+
networkx/generators/tests/test_random_clustered.py,sha256=SalHqWvpnXA3QrDRMjLx15dk2c4Us8Ck52clUERoUI8,1297
|
| 490 |
+
networkx/generators/tests/test_random_graphs.py,sha256=RTrKahiDHdXIb2ScFzQk3vrxncnMOE3W5LyJfIPvuKc,18925
|
| 491 |
+
networkx/generators/tests/test_small.py,sha256=K4-sSBZca3UMP1deUOWlkSzpanJBAT-vQdr11PMI_QY,7060
|
| 492 |
+
networkx/generators/tests/test_spectral_graph_forge.py,sha256=x4jyTiQiydaUPWYaGsNFsIB47PAzSSwQYCNXGa2B4SU,1594
|
| 493 |
+
networkx/generators/tests/test_stochastic.py,sha256=f-5KD3RpoQf369gXHH7KGebE19g5lCkXR_alcwmFm_s,2179
|
| 494 |
+
networkx/generators/tests/test_sudoku.py,sha256=dgOmk-B7MxCVkbHdZzsLZppQ61FAArVy4McSVL8Afzo,1968
|
| 495 |
+
networkx/generators/tests/test_time_series.py,sha256=rgmFcitlKa_kF6TzJ2ze91lSmNJlqjhvgrYet0AUZx8,2230
|
| 496 |
+
networkx/generators/tests/test_trees.py,sha256=Pvh0MvTKaRuZuwWL-wpJIC0zlBAcnTirpSLJi-9c7qc,7006
|
| 497 |
+
networkx/generators/tests/test_triads.py,sha256=K8anVEP8R90Y172IrKIOrYRWRJBGeqxNqU9isX7Ybxs,333
|
| 498 |
+
networkx/generators/time_series.py,sha256=_DMiY9X95O_9sK2BSeeTb2yMWfStBwKFWwn6FUOXN4Q,2439
|
| 499 |
+
networkx/generators/trees.py,sha256=2a8MsKTzQfFLBESG5oocbTaMv0cYX0vtedFD29eiOFA,36533
|
| 500 |
+
networkx/generators/triads.py,sha256=7kScTf3ITDi3qsSa-IvGMpa9diEaFwQnRuIf3Tv4UBI,2452
|
| 501 |
+
networkx/lazy_imports.py,sha256=tYxP13tZ3p8-Qh--Mey4ZXZqQhWgQAbI7xYBZRrBzw0,5764
|
| 502 |
+
networkx/linalg/__init__.py,sha256=7iyNZ_YYBnlsW8zSfhUgvEkywOrUWfpIuyS86ZOKlG8,568
|
| 503 |
+
networkx/linalg/algebraicconnectivity.py,sha256=3nOW8g21_8B_J_cCj6UYMVqGUHEI_T3827LcyoSxJvI,21149
|
| 504 |
+
networkx/linalg/attrmatrix.py,sha256=Mwiw5dvIvjDY7Bwlb4sy85KzfoP02EF64CfG_GvJsro,15509
|
| 505 |
+
networkx/linalg/bethehessianmatrix.py,sha256=Ii4NX6mo90W3MppCRcYn9dRW_MsEkVdA9TH6x7JhX8o,2697
|
| 506 |
+
networkx/linalg/graphmatrix.py,sha256=NIs2uWGS_8lJJ5IQ8Og9aIWHawghtlCDWifqOIKV2-c,5623
|
| 507 |
+
networkx/linalg/laplacianmatrix.py,sha256=iRHHabmb9S4ChDPx3Yn2-WIEQFd_flFD3AZkA4k-oyY,20536
|
| 508 |
+
networkx/linalg/modularitymatrix.py,sha256=R_VITtgIkGenxlsCLN4u6CYxj3_HiPXfeU29yarntRo,4706
|
| 509 |
+
networkx/linalg/spectrum.py,sha256=aRY7ApYv5HxrO_4O8brxpZRw3SJU3fYzlgMwhEIXcrc,4215
|
| 510 |
+
networkx/linalg/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 511 |
+
networkx/linalg/tests/test_algebraic_connectivity.py,sha256=Kj2ct6gQ71xXFP7usAbFLJxD7ZdtTzneHiFJQOoVCUQ,13737
|
| 512 |
+
networkx/linalg/tests/test_attrmatrix.py,sha256=XD3YuPc5yXKWbhwVSI8YiV_wABWM-rLtwf1uwwWlnI0,2833
|
| 513 |
+
networkx/linalg/tests/test_bethehessian.py,sha256=0r-Do902ywV10TyqTlIJ2Ls3iMqM6sSs2PZbod7kWBM,1327
|
| 514 |
+
networkx/linalg/tests/test_graphmatrix.py,sha256=e5YSH9ih1VL64nnYgZFDvLyKbP3BFqpp0jY6t-8b2eY,8708
|
| 515 |
+
networkx/linalg/tests/test_laplacian.py,sha256=0AGJwezqohoQtrmTZ94Gvg5vISMCB7_G2QdJl7JFTXg,14081
|
| 516 |
+
networkx/linalg/tests/test_modularity.py,sha256=mfKUvwc3bj6Rud1aG4oK3Eu1qg12o6cB8-pv5ZFicYY,3115
|
| 517 |
+
networkx/linalg/tests/test_spectrum.py,sha256=agP2DsiEIvtkNUkT94mdPtJjwnobnjMTUOwjIQa4giA,2828
|
| 518 |
+
networkx/readwrite/__init__.py,sha256=TvSbnGEHQ5F9CY2tkpjWYOyrUj6BeW3sc6P4_IczbKA,561
|
| 519 |
+
networkx/readwrite/adjlist.py,sha256=FjVdLlrWLi7mVuKHzO16AO6CVFqA6TCJu3GxLxSOXbU,8435
|
| 520 |
+
networkx/readwrite/edgelist.py,sha256=pjnG_o3_usmgthIpscQRJWHZZ8b3-39Uqgj0OF9qE_g,14237
|
| 521 |
+
networkx/readwrite/gexf.py,sha256=wq50Twz2o9XuoeR6awNYcftZDP-MRSztnsukmKiE3cQ,39693
|
| 522 |
+
networkx/readwrite/gml.py,sha256=5TWaEGaQv33f8F5i5IciQp8YbK0MKNxb1E5GQcKC02M,31150
|
| 523 |
+
networkx/readwrite/graph6.py,sha256=q1CmarzZ_jW_A15fU3YyKFl5OhtN-qWUrVcfc0ZTv6w,11401
|
| 524 |
+
networkx/readwrite/graphml.py,sha256=12KKKXLDyMIif-KB4ZWdvMpgnuRqQ2EEqwY9TX3jkj8,39318
|
| 525 |
+
networkx/readwrite/json_graph/__init__.py,sha256=37XJPMmilcwwo8KqouLWUly7Yv5tZ7IKraMHbBRx3fI,677
|
| 526 |
+
networkx/readwrite/json_graph/adjacency.py,sha256=WM6fdncV87WDLPOfF-IbOlOOBMX0utUjJ09UsxtwRAo,4716
|
| 527 |
+
networkx/readwrite/json_graph/cytoscape.py,sha256=kX6_p24F4CnDdT0D5lYrD0-jypyMdmqnGQEXKR1_kH4,5338
|
| 528 |
+
networkx/readwrite/json_graph/node_link.py,sha256=QUre2tj2j6PXdwz6J3ExxyoLsfX-Vs5lDwjcYQjSDcM,10792
|
| 529 |
+
networkx/readwrite/json_graph/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 530 |
+
networkx/readwrite/json_graph/tests/test_adjacency.py,sha256=jueQE3Z_W5BZuCjr0hEsOWSfoQ2fP51p0o0m7IcXUuE,2456
|
| 531 |
+
networkx/readwrite/json_graph/tests/test_cytoscape.py,sha256=vFoDzcSRI9THlmp4Fu2HHhIF9AUmECWs5mftVWjaWWs,2044
|
| 532 |
+
networkx/readwrite/json_graph/tests/test_node_link.py,sha256=q0mqy5fqZFxxHQb18tmFXUOOp_oTP1Ye5bEWzTnXEFo,6468
|
| 533 |
+
networkx/readwrite/json_graph/tests/test_tree.py,sha256=zBXv3_db2XGxFs3XQ35btNf_ku52aLXXiHZmmX4ixAs,1352
|
| 534 |
+
networkx/readwrite/json_graph/tree.py,sha256=K4rF4Kds4g0JhgcPTrrR_I3Pswpze8yCVH4M-WF9nn0,3851
|
| 535 |
+
networkx/readwrite/leda.py,sha256=VjpyUYeAWPD4TQSyvcC-ftcTeg6Pow9zJJqNuiGZ0zU,2797
|
| 536 |
+
networkx/readwrite/multiline_adjlist.py,sha256=_3SB2719ceBdJjYPkyAZUPuCebcHX_Zwk6mQDs4OcTQ,11301
|
| 537 |
+
networkx/readwrite/p2g.py,sha256=0Mi8yvV0Hy6Bo4cbCKYjNp0_0ALYmNNCUMer4w1bkrY,3092
|
| 538 |
+
networkx/readwrite/pajek.py,sha256=9j3sRjLzPQxqQFdEoTCOwICpdAf7G39cdls04dhErns,8738
|
| 539 |
+
networkx/readwrite/sparse6.py,sha256=MFih4PCNJSY4UFuJxBNxYjBT9_11UpIbPQrySSiE9bg,10315
|
| 540 |
+
networkx/readwrite/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 541 |
+
networkx/readwrite/tests/test_adjlist.py,sha256=t5RL85eDQFPUIdh8W4kozY_P7PMJU2LwSXjWZGE-4Aw,10134
|
| 542 |
+
networkx/readwrite/tests/test_edgelist.py,sha256=cmOqVSpVO-FTdFRUAz40_e2sSmmB9xV6uYmfvw5cNhQ,10113
|
| 543 |
+
networkx/readwrite/tests/test_gexf.py,sha256=Tbqueeh0XRQ8vtmGwXcyy9K3tWPlnLu6Gop0Hy4cZcc,19405
|
| 544 |
+
networkx/readwrite/tests/test_gml.py,sha256=8_2nBU6n8zLHkApiuKkZNH-xMRSdA1G8ZH3Lvjspizg,21391
|
| 545 |
+
networkx/readwrite/tests/test_graph6.py,sha256=DAi58D_G3j2UGk6VpfGkLGzfSAl318TIbuXSKKZ102U,6067
|
| 546 |
+
networkx/readwrite/tests/test_graphml.py,sha256=MrU3AkdqNQ6gVLtOQrZUx39pV7PjS_ETu5uuT5Ce6BI,67573
|
| 547 |
+
networkx/readwrite/tests/test_leda.py,sha256=_5F4nLLQ1oAZQMZtTQoFncZL0Oc-IsztFBglEdQeH3k,1392
|
| 548 |
+
networkx/readwrite/tests/test_p2g.py,sha256=drsdod5amV9TGCk-qE2RwsvAop78IKEI1WguVFfd9rs,1320
|
| 549 |
+
networkx/readwrite/tests/test_pajek.py,sha256=-bT-y26OmWgpLcvk-qvVfOEa-DTcQPwV2qKB99roOrk,4629
|
| 550 |
+
networkx/readwrite/tests/test_sparse6.py,sha256=cqFHWz4G_kMawaRqceofN4K-JlkmPx3BEaDXkU8DD0o,5284
|
| 551 |
+
networkx/readwrite/tests/test_text.py,sha256=x1N97hD31HPkj9Wn2PYti5-gcwaFNnStkaN_38HKnIg,55319
|
| 552 |
+
networkx/readwrite/text.py,sha256=9u43d_m2xcoJKl5rKQ-3N0kIdr3m4xzX2i1y05xDDbM,29163
|
| 553 |
+
networkx/relabel.py,sha256=0HptAQOBToKhLZzxscd6FQpzVCNMlYmiHjHul69ct8o,10300
|
| 554 |
+
networkx/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 555 |
+
networkx/tests/test_all_random_functions.py,sha256=VWBH5Uov3DswxuRDzlMPuDlcryPyWVaCvt2_OMw-dIQ,8673
|
| 556 |
+
networkx/tests/test_convert.py,sha256=SoIVrqJFF9Gu9Jff_apfbpqg8QhkfC6QW4qzoSM-ukM,12731
|
| 557 |
+
networkx/tests/test_convert_numpy.py,sha256=jw-iEj7wVAVXd5rlOxTBMHQD63m90q5RBQxv1ee9dNw,19065
|
| 558 |
+
networkx/tests/test_convert_pandas.py,sha256=2LrQrGkxdlvEZxKmMvyptUvOsTsAcbo8u6siSVbnV3M,13346
|
| 559 |
+
networkx/tests/test_convert_scipy.py,sha256=C2cY_8dgBksO0uttkhyCnjACXtC6KHjxqHUk47P5wH8,10436
|
| 560 |
+
networkx/tests/test_exceptions.py,sha256=XYkpPzqMepSw3MPRUJN5LcFsUsy3YT_fiRDhm0OeAeQ,927
|
| 561 |
+
networkx/tests/test_import.py,sha256=Gm4ujfH9JkQtDrSjOlwXXXUuubI057wskKLCkF6Z92k,220
|
| 562 |
+
networkx/tests/test_lazy_imports.py,sha256=nKykNQPt_ZV8JxCH_EkwwcPNayAgZGQVf89e8I7uIlI,2680
|
| 563 |
+
networkx/tests/test_relabel.py,sha256=dffbjiW_VUAQe7iD8knFS_KepUITt0F6xuwf7daWwKw,14517
|
| 564 |
+
networkx/utils/__init__.py,sha256=7pxleRNpBWuL3FEQz3CzKLn17b6_eSwkM7dqnL1okDk,302
|
| 565 |
+
networkx/utils/backends.py,sha256=pXioKWl33QJEcL9_FDufk2xv12_8bpgYniJYouJEq4M,113169
|
| 566 |
+
networkx/utils/configs.py,sha256=v3p9eXPPllCcMqX33VhVQUVeXOm7eAn9xdASDEqMmP8,15023
|
| 567 |
+
networkx/utils/decorators.py,sha256=aj07nVz7CW1TaYMBpSiHdRuw_U3_o0XdGoRyLMrJeXg,44836
|
| 568 |
+
networkx/utils/heaps.py,sha256=HUZuETHfELEqiXdMBPmD9fA2KiACVhp6iEahcrjFxYM,10391
|
| 569 |
+
networkx/utils/mapped_queue.py,sha256=WdIRk27D_ArmPs9tdpvQLQCV4Tmus212BQhxsFIMYgk,10184
|
| 570 |
+
networkx/utils/misc.py,sha256=BN_VscZjoishxgbjwxm1PVG_J_jHqpuMd9bffwK6Q5M,21293
|
| 571 |
+
networkx/utils/random_sequence.py,sha256=KzKh0BRMri0MBZlzxHNMl3qRTy2DnBexW3eDzmxKab4,4237
|
| 572 |
+
networkx/utils/rcm.py,sha256=9tpXSK-wwLXFcq3ypXilYNAaJAKrmMiMwp4R78OLvuI,4624
|
| 573 |
+
networkx/utils/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 574 |
+
networkx/utils/tests/test__init.py,sha256=QE0i-lNE4pG2eYjB2mZ0uw7jPD-7TdL7Y9p73JoWQmo,363
|
| 575 |
+
networkx/utils/tests/test_backends.py,sha256=5fwka8bdEBtvPhjN49dMcgKsUBIVHEmMag6uckBAAd8,6108
|
| 576 |
+
networkx/utils/tests/test_config.py,sha256=nImFv-UMS3uo9DFgYejSCNRm2mOUVHldKFFAY4t_2mQ,7414
|
| 577 |
+
networkx/utils/tests/test_decorators.py,sha256=dm3b5yiQPlnlT_4pSm0FwK-xBGV9dcnhv14Vh9Jiz1o,14050
|
| 578 |
+
networkx/utils/tests/test_heaps.py,sha256=qCuWMzpcMH1Gwu014CAams78o151QD5YL0mB1fz16Yw,3711
|
| 579 |
+
networkx/utils/tests/test_mapped_queue.py,sha256=l1Nguzz68Fv91FnAT7y7B0GXSoje9uoWiObHo7TliGM,7354
|
| 580 |
+
networkx/utils/tests/test_misc.py,sha256=zkD1pYO4xBuBxlGe-nU8okcX6hfDMgu0OJZGu4TMrN0,8671
|
| 581 |
+
networkx/utils/tests/test_random_sequence.py,sha256=Ou-IeCFybibZuycoin5gUQzzC-iy5yanZFmrqvdGt6Q,925
|
| 582 |
+
networkx/utils/tests/test_rcm.py,sha256=UvUAkgmQMGk_Nn94TJyQsle4A5SLQFqMQWld1tiQ2lk,1421
|
| 583 |
+
networkx/utils/tests/test_unionfind.py,sha256=j-DF5XyeJzq1hoeAgN5Nye2Au7EPD040t8oS4Aw2IwU,1579
|
| 584 |
+
networkx/utils/union_find.py,sha256=NxKlBlyS71A1Wlnt28L-wyZoI9ExZvJth_0e2XSVris,3338
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/networkx-3.4.2.dist-info/REQUESTED
ADDED
|
File without changes
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/networkx-3.4.2.dist-info/WHEEL
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Wheel-Version: 1.0
|
| 2 |
+
Generator: setuptools (75.2.0)
|
| 3 |
+
Root-Is-Purelib: true
|
| 4 |
+
Tag: py3-none-any
|
| 5 |
+
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/networkx-3.4.2.dist-info/entry_points.txt
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[networkx.backends]
|
| 2 |
+
nx_loopback = networkx.classes.tests.dispatch_interface:backend_interface
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/networkx-3.4.2.dist-info/top_level.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
networkx
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (7.01 kB). View file
|
|
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/__pycache__/_typing.cpython-310.pyc
ADDED
|
Binary file (11.6 kB). View file
|
|
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/__pycache__/_version_meson.cpython-310.pyc
ADDED
|
Binary file (312 Bytes). View file
|
|
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/__pycache__/testing.cpython-310.pyc
ADDED
|
Binary file (468 Bytes). View file
|
|
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_config/__init__.py
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
pandas._config is considered explicitly upstream of everything else in pandas,
|
| 3 |
+
should have no intra-pandas dependencies.
|
| 4 |
+
|
| 5 |
+
importing `dates` and `display` ensures that keys needed by _libs
|
| 6 |
+
are initialized.
|
| 7 |
+
"""
|
| 8 |
+
__all__ = [
|
| 9 |
+
"config",
|
| 10 |
+
"detect_console_encoding",
|
| 11 |
+
"get_option",
|
| 12 |
+
"set_option",
|
| 13 |
+
"reset_option",
|
| 14 |
+
"describe_option",
|
| 15 |
+
"option_context",
|
| 16 |
+
"options",
|
| 17 |
+
"using_copy_on_write",
|
| 18 |
+
"warn_copy_on_write",
|
| 19 |
+
]
|
| 20 |
+
from pandas._config import config
|
| 21 |
+
from pandas._config import dates # pyright: ignore[reportUnusedImport] # noqa: F401
|
| 22 |
+
from pandas._config.config import (
|
| 23 |
+
_global_config,
|
| 24 |
+
describe_option,
|
| 25 |
+
get_option,
|
| 26 |
+
option_context,
|
| 27 |
+
options,
|
| 28 |
+
reset_option,
|
| 29 |
+
set_option,
|
| 30 |
+
)
|
| 31 |
+
from pandas._config.display import detect_console_encoding
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
def using_copy_on_write() -> bool:
|
| 35 |
+
_mode_options = _global_config["mode"]
|
| 36 |
+
return (
|
| 37 |
+
_mode_options["copy_on_write"] is True
|
| 38 |
+
and _mode_options["data_manager"] == "block"
|
| 39 |
+
)
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
def warn_copy_on_write() -> bool:
|
| 43 |
+
_mode_options = _global_config["mode"]
|
| 44 |
+
return (
|
| 45 |
+
_mode_options["copy_on_write"] == "warn"
|
| 46 |
+
and _mode_options["data_manager"] == "block"
|
| 47 |
+
)
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
def using_nullable_dtypes() -> bool:
|
| 51 |
+
_mode_options = _global_config["mode"]
|
| 52 |
+
return _mode_options["nullable_dtypes"]
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
def using_string_dtype() -> bool:
|
| 56 |
+
_mode_options = _global_config["future"]
|
| 57 |
+
return _mode_options["infer_string"]
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_config/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (1.55 kB). View file
|
|
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_config/__pycache__/config.cpython-310.pyc
ADDED
|
Binary file (26.4 kB). View file
|
|
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_config/__pycache__/dates.cpython-310.pyc
ADDED
|
Binary file (794 Bytes). View file
|
|
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_config/__pycache__/display.cpython-310.pyc
ADDED
|
Binary file (1.44 kB). View file
|
|
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_config/__pycache__/localization.cpython-310.pyc
ADDED
|
Binary file (4.88 kB). View file
|
|
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_config/config.py
ADDED
|
@@ -0,0 +1,948 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
The config module holds package-wide configurables and provides
|
| 3 |
+
a uniform API for working with them.
|
| 4 |
+
|
| 5 |
+
Overview
|
| 6 |
+
========
|
| 7 |
+
|
| 8 |
+
This module supports the following requirements:
|
| 9 |
+
- options are referenced using keys in dot.notation, e.g. "x.y.option - z".
|
| 10 |
+
- keys are case-insensitive.
|
| 11 |
+
- functions should accept partial/regex keys, when unambiguous.
|
| 12 |
+
- options can be registered by modules at import time.
|
| 13 |
+
- options can be registered at init-time (via core.config_init)
|
| 14 |
+
- options have a default value, and (optionally) a description and
|
| 15 |
+
validation function associated with them.
|
| 16 |
+
- options can be deprecated, in which case referencing them
|
| 17 |
+
should produce a warning.
|
| 18 |
+
- deprecated options can optionally be rerouted to a replacement
|
| 19 |
+
so that accessing a deprecated option reroutes to a differently
|
| 20 |
+
named option.
|
| 21 |
+
- options can be reset to their default value.
|
| 22 |
+
- all option can be reset to their default value at once.
|
| 23 |
+
- all options in a certain sub - namespace can be reset at once.
|
| 24 |
+
- the user can set / get / reset or ask for the description of an option.
|
| 25 |
+
- a developer can register and mark an option as deprecated.
|
| 26 |
+
- you can register a callback to be invoked when the option value
|
| 27 |
+
is set or reset. Changing the stored value is considered misuse, but
|
| 28 |
+
is not verboten.
|
| 29 |
+
|
| 30 |
+
Implementation
|
| 31 |
+
==============
|
| 32 |
+
|
| 33 |
+
- Data is stored using nested dictionaries, and should be accessed
|
| 34 |
+
through the provided API.
|
| 35 |
+
|
| 36 |
+
- "Registered options" and "Deprecated options" have metadata associated
|
| 37 |
+
with them, which are stored in auxiliary dictionaries keyed on the
|
| 38 |
+
fully-qualified key, e.g. "x.y.z.option".
|
| 39 |
+
|
| 40 |
+
- the config_init module is imported by the package's __init__.py file.
|
| 41 |
+
placing any register_option() calls there will ensure those options
|
| 42 |
+
are available as soon as pandas is loaded. If you use register_option
|
| 43 |
+
in a module, it will only be available after that module is imported,
|
| 44 |
+
which you should be aware of.
|
| 45 |
+
|
| 46 |
+
- `config_prefix` is a context_manager (for use with the `with` keyword)
|
| 47 |
+
which can save developers some typing, see the docstring.
|
| 48 |
+
|
| 49 |
+
"""
|
| 50 |
+
|
| 51 |
+
from __future__ import annotations
|
| 52 |
+
|
| 53 |
+
from contextlib import (
|
| 54 |
+
ContextDecorator,
|
| 55 |
+
contextmanager,
|
| 56 |
+
)
|
| 57 |
+
import re
|
| 58 |
+
from typing import (
|
| 59 |
+
TYPE_CHECKING,
|
| 60 |
+
Any,
|
| 61 |
+
Callable,
|
| 62 |
+
Generic,
|
| 63 |
+
NamedTuple,
|
| 64 |
+
cast,
|
| 65 |
+
)
|
| 66 |
+
import warnings
|
| 67 |
+
|
| 68 |
+
from pandas._typing import (
|
| 69 |
+
F,
|
| 70 |
+
T,
|
| 71 |
+
)
|
| 72 |
+
from pandas.util._exceptions import find_stack_level
|
| 73 |
+
|
| 74 |
+
if TYPE_CHECKING:
|
| 75 |
+
from collections.abc import (
|
| 76 |
+
Generator,
|
| 77 |
+
Iterable,
|
| 78 |
+
)
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
class DeprecatedOption(NamedTuple):
|
| 82 |
+
key: str
|
| 83 |
+
msg: str | None
|
| 84 |
+
rkey: str | None
|
| 85 |
+
removal_ver: str | None
|
| 86 |
+
|
| 87 |
+
|
| 88 |
+
class RegisteredOption(NamedTuple):
|
| 89 |
+
key: str
|
| 90 |
+
defval: object
|
| 91 |
+
doc: str
|
| 92 |
+
validator: Callable[[object], Any] | None
|
| 93 |
+
cb: Callable[[str], Any] | None
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
# holds deprecated option metadata
|
| 97 |
+
_deprecated_options: dict[str, DeprecatedOption] = {}
|
| 98 |
+
|
| 99 |
+
# holds registered option metadata
|
| 100 |
+
_registered_options: dict[str, RegisteredOption] = {}
|
| 101 |
+
|
| 102 |
+
# holds the current values for registered options
|
| 103 |
+
_global_config: dict[str, Any] = {}
|
| 104 |
+
|
| 105 |
+
# keys which have a special meaning
|
| 106 |
+
_reserved_keys: list[str] = ["all"]
|
| 107 |
+
|
| 108 |
+
|
| 109 |
+
class OptionError(AttributeError, KeyError):
|
| 110 |
+
"""
|
| 111 |
+
Exception raised for pandas.options.
|
| 112 |
+
|
| 113 |
+
Backwards compatible with KeyError checks.
|
| 114 |
+
|
| 115 |
+
Examples
|
| 116 |
+
--------
|
| 117 |
+
>>> pd.options.context
|
| 118 |
+
Traceback (most recent call last):
|
| 119 |
+
OptionError: No such option
|
| 120 |
+
"""
|
| 121 |
+
|
| 122 |
+
|
| 123 |
+
#
|
| 124 |
+
# User API
|
| 125 |
+
|
| 126 |
+
|
| 127 |
+
def _get_single_key(pat: str, silent: bool) -> str:
|
| 128 |
+
keys = _select_options(pat)
|
| 129 |
+
if len(keys) == 0:
|
| 130 |
+
if not silent:
|
| 131 |
+
_warn_if_deprecated(pat)
|
| 132 |
+
raise OptionError(f"No such keys(s): {repr(pat)}")
|
| 133 |
+
if len(keys) > 1:
|
| 134 |
+
raise OptionError("Pattern matched multiple keys")
|
| 135 |
+
key = keys[0]
|
| 136 |
+
|
| 137 |
+
if not silent:
|
| 138 |
+
_warn_if_deprecated(key)
|
| 139 |
+
|
| 140 |
+
key = _translate_key(key)
|
| 141 |
+
|
| 142 |
+
return key
|
| 143 |
+
|
| 144 |
+
|
| 145 |
+
def _get_option(pat: str, silent: bool = False) -> Any:
|
| 146 |
+
key = _get_single_key(pat, silent)
|
| 147 |
+
|
| 148 |
+
# walk the nested dict
|
| 149 |
+
root, k = _get_root(key)
|
| 150 |
+
return root[k]
|
| 151 |
+
|
| 152 |
+
|
| 153 |
+
def _set_option(*args, **kwargs) -> None:
|
| 154 |
+
# must at least 1 arg deal with constraints later
|
| 155 |
+
nargs = len(args)
|
| 156 |
+
if not nargs or nargs % 2 != 0:
|
| 157 |
+
raise ValueError("Must provide an even number of non-keyword arguments")
|
| 158 |
+
|
| 159 |
+
# default to false
|
| 160 |
+
silent = kwargs.pop("silent", False)
|
| 161 |
+
|
| 162 |
+
if kwargs:
|
| 163 |
+
kwarg = next(iter(kwargs.keys()))
|
| 164 |
+
raise TypeError(f'_set_option() got an unexpected keyword argument "{kwarg}"')
|
| 165 |
+
|
| 166 |
+
for k, v in zip(args[::2], args[1::2]):
|
| 167 |
+
key = _get_single_key(k, silent)
|
| 168 |
+
|
| 169 |
+
o = _get_registered_option(key)
|
| 170 |
+
if o and o.validator:
|
| 171 |
+
o.validator(v)
|
| 172 |
+
|
| 173 |
+
# walk the nested dict
|
| 174 |
+
root, k_root = _get_root(key)
|
| 175 |
+
root[k_root] = v
|
| 176 |
+
|
| 177 |
+
if o.cb:
|
| 178 |
+
if silent:
|
| 179 |
+
with warnings.catch_warnings(record=True):
|
| 180 |
+
o.cb(key)
|
| 181 |
+
else:
|
| 182 |
+
o.cb(key)
|
| 183 |
+
|
| 184 |
+
|
| 185 |
+
def _describe_option(pat: str = "", _print_desc: bool = True) -> str | None:
|
| 186 |
+
keys = _select_options(pat)
|
| 187 |
+
if len(keys) == 0:
|
| 188 |
+
raise OptionError("No such keys(s)")
|
| 189 |
+
|
| 190 |
+
s = "\n".join([_build_option_description(k) for k in keys])
|
| 191 |
+
|
| 192 |
+
if _print_desc:
|
| 193 |
+
print(s)
|
| 194 |
+
return None
|
| 195 |
+
return s
|
| 196 |
+
|
| 197 |
+
|
| 198 |
+
def _reset_option(pat: str, silent: bool = False) -> None:
|
| 199 |
+
keys = _select_options(pat)
|
| 200 |
+
|
| 201 |
+
if len(keys) == 0:
|
| 202 |
+
raise OptionError("No such keys(s)")
|
| 203 |
+
|
| 204 |
+
if len(keys) > 1 and len(pat) < 4 and pat != "all":
|
| 205 |
+
raise ValueError(
|
| 206 |
+
"You must specify at least 4 characters when "
|
| 207 |
+
"resetting multiple keys, use the special keyword "
|
| 208 |
+
'"all" to reset all the options to their default value'
|
| 209 |
+
)
|
| 210 |
+
|
| 211 |
+
for k in keys:
|
| 212 |
+
_set_option(k, _registered_options[k].defval, silent=silent)
|
| 213 |
+
|
| 214 |
+
|
| 215 |
+
def get_default_val(pat: str):
|
| 216 |
+
key = _get_single_key(pat, silent=True)
|
| 217 |
+
return _get_registered_option(key).defval
|
| 218 |
+
|
| 219 |
+
|
| 220 |
+
class DictWrapper:
|
| 221 |
+
"""provide attribute-style access to a nested dict"""
|
| 222 |
+
|
| 223 |
+
d: dict[str, Any]
|
| 224 |
+
|
| 225 |
+
def __init__(self, d: dict[str, Any], prefix: str = "") -> None:
|
| 226 |
+
object.__setattr__(self, "d", d)
|
| 227 |
+
object.__setattr__(self, "prefix", prefix)
|
| 228 |
+
|
| 229 |
+
def __setattr__(self, key: str, val: Any) -> None:
|
| 230 |
+
prefix = object.__getattribute__(self, "prefix")
|
| 231 |
+
if prefix:
|
| 232 |
+
prefix += "."
|
| 233 |
+
prefix += key
|
| 234 |
+
# you can't set new keys
|
| 235 |
+
# can you can't overwrite subtrees
|
| 236 |
+
if key in self.d and not isinstance(self.d[key], dict):
|
| 237 |
+
_set_option(prefix, val)
|
| 238 |
+
else:
|
| 239 |
+
raise OptionError("You can only set the value of existing options")
|
| 240 |
+
|
| 241 |
+
def __getattr__(self, key: str):
|
| 242 |
+
prefix = object.__getattribute__(self, "prefix")
|
| 243 |
+
if prefix:
|
| 244 |
+
prefix += "."
|
| 245 |
+
prefix += key
|
| 246 |
+
try:
|
| 247 |
+
v = object.__getattribute__(self, "d")[key]
|
| 248 |
+
except KeyError as err:
|
| 249 |
+
raise OptionError("No such option") from err
|
| 250 |
+
if isinstance(v, dict):
|
| 251 |
+
return DictWrapper(v, prefix)
|
| 252 |
+
else:
|
| 253 |
+
return _get_option(prefix)
|
| 254 |
+
|
| 255 |
+
def __dir__(self) -> list[str]:
|
| 256 |
+
return list(self.d.keys())
|
| 257 |
+
|
| 258 |
+
|
| 259 |
+
# For user convenience, we'd like to have the available options described
|
| 260 |
+
# in the docstring. For dev convenience we'd like to generate the docstrings
|
| 261 |
+
# dynamically instead of maintaining them by hand. To this, we use the
|
| 262 |
+
# class below which wraps functions inside a callable, and converts
|
| 263 |
+
# __doc__ into a property function. The doctsrings below are templates
|
| 264 |
+
# using the py2.6+ advanced formatting syntax to plug in a concise list
|
| 265 |
+
# of options, and option descriptions.
|
| 266 |
+
|
| 267 |
+
|
| 268 |
+
class CallableDynamicDoc(Generic[T]):
|
| 269 |
+
def __init__(self, func: Callable[..., T], doc_tmpl: str) -> None:
|
| 270 |
+
self.__doc_tmpl__ = doc_tmpl
|
| 271 |
+
self.__func__ = func
|
| 272 |
+
|
| 273 |
+
def __call__(self, *args, **kwds) -> T:
|
| 274 |
+
return self.__func__(*args, **kwds)
|
| 275 |
+
|
| 276 |
+
# error: Signature of "__doc__" incompatible with supertype "object"
|
| 277 |
+
@property
|
| 278 |
+
def __doc__(self) -> str: # type: ignore[override]
|
| 279 |
+
opts_desc = _describe_option("all", _print_desc=False)
|
| 280 |
+
opts_list = pp_options_list(list(_registered_options.keys()))
|
| 281 |
+
return self.__doc_tmpl__.format(opts_desc=opts_desc, opts_list=opts_list)
|
| 282 |
+
|
| 283 |
+
|
| 284 |
+
_get_option_tmpl = """
|
| 285 |
+
get_option(pat)
|
| 286 |
+
|
| 287 |
+
Retrieves the value of the specified option.
|
| 288 |
+
|
| 289 |
+
Available options:
|
| 290 |
+
|
| 291 |
+
{opts_list}
|
| 292 |
+
|
| 293 |
+
Parameters
|
| 294 |
+
----------
|
| 295 |
+
pat : str
|
| 296 |
+
Regexp which should match a single option.
|
| 297 |
+
Note: partial matches are supported for convenience, but unless you use the
|
| 298 |
+
full option name (e.g. x.y.z.option_name), your code may break in future
|
| 299 |
+
versions if new options with similar names are introduced.
|
| 300 |
+
|
| 301 |
+
Returns
|
| 302 |
+
-------
|
| 303 |
+
result : the value of the option
|
| 304 |
+
|
| 305 |
+
Raises
|
| 306 |
+
------
|
| 307 |
+
OptionError : if no such option exists
|
| 308 |
+
|
| 309 |
+
Notes
|
| 310 |
+
-----
|
| 311 |
+
Please reference the :ref:`User Guide <options>` for more information.
|
| 312 |
+
|
| 313 |
+
The available options with its descriptions:
|
| 314 |
+
|
| 315 |
+
{opts_desc}
|
| 316 |
+
|
| 317 |
+
Examples
|
| 318 |
+
--------
|
| 319 |
+
>>> pd.get_option('display.max_columns') # doctest: +SKIP
|
| 320 |
+
4
|
| 321 |
+
"""
|
| 322 |
+
|
| 323 |
+
_set_option_tmpl = """
|
| 324 |
+
set_option(pat, value)
|
| 325 |
+
|
| 326 |
+
Sets the value of the specified option.
|
| 327 |
+
|
| 328 |
+
Available options:
|
| 329 |
+
|
| 330 |
+
{opts_list}
|
| 331 |
+
|
| 332 |
+
Parameters
|
| 333 |
+
----------
|
| 334 |
+
pat : str
|
| 335 |
+
Regexp which should match a single option.
|
| 336 |
+
Note: partial matches are supported for convenience, but unless you use the
|
| 337 |
+
full option name (e.g. x.y.z.option_name), your code may break in future
|
| 338 |
+
versions if new options with similar names are introduced.
|
| 339 |
+
value : object
|
| 340 |
+
New value of option.
|
| 341 |
+
|
| 342 |
+
Returns
|
| 343 |
+
-------
|
| 344 |
+
None
|
| 345 |
+
|
| 346 |
+
Raises
|
| 347 |
+
------
|
| 348 |
+
OptionError if no such option exists
|
| 349 |
+
|
| 350 |
+
Notes
|
| 351 |
+
-----
|
| 352 |
+
Please reference the :ref:`User Guide <options>` for more information.
|
| 353 |
+
|
| 354 |
+
The available options with its descriptions:
|
| 355 |
+
|
| 356 |
+
{opts_desc}
|
| 357 |
+
|
| 358 |
+
Examples
|
| 359 |
+
--------
|
| 360 |
+
>>> pd.set_option('display.max_columns', 4)
|
| 361 |
+
>>> df = pd.DataFrame([[1, 2, 3, 4, 5], [6, 7, 8, 9, 10]])
|
| 362 |
+
>>> df
|
| 363 |
+
0 1 ... 3 4
|
| 364 |
+
0 1 2 ... 4 5
|
| 365 |
+
1 6 7 ... 9 10
|
| 366 |
+
[2 rows x 5 columns]
|
| 367 |
+
>>> pd.reset_option('display.max_columns')
|
| 368 |
+
"""
|
| 369 |
+
|
| 370 |
+
_describe_option_tmpl = """
|
| 371 |
+
describe_option(pat, _print_desc=False)
|
| 372 |
+
|
| 373 |
+
Prints the description for one or more registered options.
|
| 374 |
+
|
| 375 |
+
Call with no arguments to get a listing for all registered options.
|
| 376 |
+
|
| 377 |
+
Available options:
|
| 378 |
+
|
| 379 |
+
{opts_list}
|
| 380 |
+
|
| 381 |
+
Parameters
|
| 382 |
+
----------
|
| 383 |
+
pat : str
|
| 384 |
+
Regexp pattern. All matching keys will have their description displayed.
|
| 385 |
+
_print_desc : bool, default True
|
| 386 |
+
If True (default) the description(s) will be printed to stdout.
|
| 387 |
+
Otherwise, the description(s) will be returned as a unicode string
|
| 388 |
+
(for testing).
|
| 389 |
+
|
| 390 |
+
Returns
|
| 391 |
+
-------
|
| 392 |
+
None by default, the description(s) as a unicode string if _print_desc
|
| 393 |
+
is False
|
| 394 |
+
|
| 395 |
+
Notes
|
| 396 |
+
-----
|
| 397 |
+
Please reference the :ref:`User Guide <options>` for more information.
|
| 398 |
+
|
| 399 |
+
The available options with its descriptions:
|
| 400 |
+
|
| 401 |
+
{opts_desc}
|
| 402 |
+
|
| 403 |
+
Examples
|
| 404 |
+
--------
|
| 405 |
+
>>> pd.describe_option('display.max_columns') # doctest: +SKIP
|
| 406 |
+
display.max_columns : int
|
| 407 |
+
If max_cols is exceeded, switch to truncate view...
|
| 408 |
+
"""
|
| 409 |
+
|
| 410 |
+
_reset_option_tmpl = """
|
| 411 |
+
reset_option(pat)
|
| 412 |
+
|
| 413 |
+
Reset one or more options to their default value.
|
| 414 |
+
|
| 415 |
+
Pass "all" as argument to reset all options.
|
| 416 |
+
|
| 417 |
+
Available options:
|
| 418 |
+
|
| 419 |
+
{opts_list}
|
| 420 |
+
|
| 421 |
+
Parameters
|
| 422 |
+
----------
|
| 423 |
+
pat : str/regex
|
| 424 |
+
If specified only options matching `prefix*` will be reset.
|
| 425 |
+
Note: partial matches are supported for convenience, but unless you
|
| 426 |
+
use the full option name (e.g. x.y.z.option_name), your code may break
|
| 427 |
+
in future versions if new options with similar names are introduced.
|
| 428 |
+
|
| 429 |
+
Returns
|
| 430 |
+
-------
|
| 431 |
+
None
|
| 432 |
+
|
| 433 |
+
Notes
|
| 434 |
+
-----
|
| 435 |
+
Please reference the :ref:`User Guide <options>` for more information.
|
| 436 |
+
|
| 437 |
+
The available options with its descriptions:
|
| 438 |
+
|
| 439 |
+
{opts_desc}
|
| 440 |
+
|
| 441 |
+
Examples
|
| 442 |
+
--------
|
| 443 |
+
>>> pd.reset_option('display.max_columns') # doctest: +SKIP
|
| 444 |
+
"""
|
| 445 |
+
|
| 446 |
+
# bind the functions with their docstrings into a Callable
|
| 447 |
+
# and use that as the functions exposed in pd.api
|
| 448 |
+
get_option = CallableDynamicDoc(_get_option, _get_option_tmpl)
|
| 449 |
+
set_option = CallableDynamicDoc(_set_option, _set_option_tmpl)
|
| 450 |
+
reset_option = CallableDynamicDoc(_reset_option, _reset_option_tmpl)
|
| 451 |
+
describe_option = CallableDynamicDoc(_describe_option, _describe_option_tmpl)
|
| 452 |
+
options = DictWrapper(_global_config)
|
| 453 |
+
|
| 454 |
+
#
|
| 455 |
+
# Functions for use by pandas developers, in addition to User - api
|
| 456 |
+
|
| 457 |
+
|
| 458 |
+
class option_context(ContextDecorator):
|
| 459 |
+
"""
|
| 460 |
+
Context manager to temporarily set options in the `with` statement context.
|
| 461 |
+
|
| 462 |
+
You need to invoke as ``option_context(pat, val, [(pat, val), ...])``.
|
| 463 |
+
|
| 464 |
+
Examples
|
| 465 |
+
--------
|
| 466 |
+
>>> from pandas import option_context
|
| 467 |
+
>>> with option_context('display.max_rows', 10, 'display.max_columns', 5):
|
| 468 |
+
... pass
|
| 469 |
+
"""
|
| 470 |
+
|
| 471 |
+
def __init__(self, *args) -> None:
|
| 472 |
+
if len(args) % 2 != 0 or len(args) < 2:
|
| 473 |
+
raise ValueError(
|
| 474 |
+
"Need to invoke as option_context(pat, val, [(pat, val), ...])."
|
| 475 |
+
)
|
| 476 |
+
|
| 477 |
+
self.ops = list(zip(args[::2], args[1::2]))
|
| 478 |
+
|
| 479 |
+
def __enter__(self) -> None:
|
| 480 |
+
self.undo = [(pat, _get_option(pat)) for pat, val in self.ops]
|
| 481 |
+
|
| 482 |
+
for pat, val in self.ops:
|
| 483 |
+
_set_option(pat, val, silent=True)
|
| 484 |
+
|
| 485 |
+
def __exit__(self, *args) -> None:
|
| 486 |
+
if self.undo:
|
| 487 |
+
for pat, val in self.undo:
|
| 488 |
+
_set_option(pat, val, silent=True)
|
| 489 |
+
|
| 490 |
+
|
| 491 |
+
def register_option(
|
| 492 |
+
key: str,
|
| 493 |
+
defval: object,
|
| 494 |
+
doc: str = "",
|
| 495 |
+
validator: Callable[[object], Any] | None = None,
|
| 496 |
+
cb: Callable[[str], Any] | None = None,
|
| 497 |
+
) -> None:
|
| 498 |
+
"""
|
| 499 |
+
Register an option in the package-wide pandas config object
|
| 500 |
+
|
| 501 |
+
Parameters
|
| 502 |
+
----------
|
| 503 |
+
key : str
|
| 504 |
+
Fully-qualified key, e.g. "x.y.option - z".
|
| 505 |
+
defval : object
|
| 506 |
+
Default value of the option.
|
| 507 |
+
doc : str
|
| 508 |
+
Description of the option.
|
| 509 |
+
validator : Callable, optional
|
| 510 |
+
Function of a single argument, should raise `ValueError` if
|
| 511 |
+
called with a value which is not a legal value for the option.
|
| 512 |
+
cb
|
| 513 |
+
a function of a single argument "key", which is called
|
| 514 |
+
immediately after an option value is set/reset. key is
|
| 515 |
+
the full name of the option.
|
| 516 |
+
|
| 517 |
+
Raises
|
| 518 |
+
------
|
| 519 |
+
ValueError if `validator` is specified and `defval` is not a valid value.
|
| 520 |
+
|
| 521 |
+
"""
|
| 522 |
+
import keyword
|
| 523 |
+
import tokenize
|
| 524 |
+
|
| 525 |
+
key = key.lower()
|
| 526 |
+
|
| 527 |
+
if key in _registered_options:
|
| 528 |
+
raise OptionError(f"Option '{key}' has already been registered")
|
| 529 |
+
if key in _reserved_keys:
|
| 530 |
+
raise OptionError(f"Option '{key}' is a reserved key")
|
| 531 |
+
|
| 532 |
+
# the default value should be legal
|
| 533 |
+
if validator:
|
| 534 |
+
validator(defval)
|
| 535 |
+
|
| 536 |
+
# walk the nested dict, creating dicts as needed along the path
|
| 537 |
+
path = key.split(".")
|
| 538 |
+
|
| 539 |
+
for k in path:
|
| 540 |
+
if not re.match("^" + tokenize.Name + "$", k):
|
| 541 |
+
raise ValueError(f"{k} is not a valid identifier")
|
| 542 |
+
if keyword.iskeyword(k):
|
| 543 |
+
raise ValueError(f"{k} is a python keyword")
|
| 544 |
+
|
| 545 |
+
cursor = _global_config
|
| 546 |
+
msg = "Path prefix to option '{option}' is already an option"
|
| 547 |
+
|
| 548 |
+
for i, p in enumerate(path[:-1]):
|
| 549 |
+
if not isinstance(cursor, dict):
|
| 550 |
+
raise OptionError(msg.format(option=".".join(path[:i])))
|
| 551 |
+
if p not in cursor:
|
| 552 |
+
cursor[p] = {}
|
| 553 |
+
cursor = cursor[p]
|
| 554 |
+
|
| 555 |
+
if not isinstance(cursor, dict):
|
| 556 |
+
raise OptionError(msg.format(option=".".join(path[:-1])))
|
| 557 |
+
|
| 558 |
+
cursor[path[-1]] = defval # initialize
|
| 559 |
+
|
| 560 |
+
# save the option metadata
|
| 561 |
+
_registered_options[key] = RegisteredOption(
|
| 562 |
+
key=key, defval=defval, doc=doc, validator=validator, cb=cb
|
| 563 |
+
)
|
| 564 |
+
|
| 565 |
+
|
| 566 |
+
def deprecate_option(
|
| 567 |
+
key: str,
|
| 568 |
+
msg: str | None = None,
|
| 569 |
+
rkey: str | None = None,
|
| 570 |
+
removal_ver: str | None = None,
|
| 571 |
+
) -> None:
|
| 572 |
+
"""
|
| 573 |
+
Mark option `key` as deprecated, if code attempts to access this option,
|
| 574 |
+
a warning will be produced, using `msg` if given, or a default message
|
| 575 |
+
if not.
|
| 576 |
+
if `rkey` is given, any access to the key will be re-routed to `rkey`.
|
| 577 |
+
|
| 578 |
+
Neither the existence of `key` nor that if `rkey` is checked. If they
|
| 579 |
+
do not exist, any subsequence access will fail as usual, after the
|
| 580 |
+
deprecation warning is given.
|
| 581 |
+
|
| 582 |
+
Parameters
|
| 583 |
+
----------
|
| 584 |
+
key : str
|
| 585 |
+
Name of the option to be deprecated.
|
| 586 |
+
must be a fully-qualified option name (e.g "x.y.z.rkey").
|
| 587 |
+
msg : str, optional
|
| 588 |
+
Warning message to output when the key is referenced.
|
| 589 |
+
if no message is given a default message will be emitted.
|
| 590 |
+
rkey : str, optional
|
| 591 |
+
Name of an option to reroute access to.
|
| 592 |
+
If specified, any referenced `key` will be
|
| 593 |
+
re-routed to `rkey` including set/get/reset.
|
| 594 |
+
rkey must be a fully-qualified option name (e.g "x.y.z.rkey").
|
| 595 |
+
used by the default message if no `msg` is specified.
|
| 596 |
+
removal_ver : str, optional
|
| 597 |
+
Specifies the version in which this option will
|
| 598 |
+
be removed. used by the default message if no `msg` is specified.
|
| 599 |
+
|
| 600 |
+
Raises
|
| 601 |
+
------
|
| 602 |
+
OptionError
|
| 603 |
+
If the specified key has already been deprecated.
|
| 604 |
+
"""
|
| 605 |
+
key = key.lower()
|
| 606 |
+
|
| 607 |
+
if key in _deprecated_options:
|
| 608 |
+
raise OptionError(f"Option '{key}' has already been defined as deprecated.")
|
| 609 |
+
|
| 610 |
+
_deprecated_options[key] = DeprecatedOption(key, msg, rkey, removal_ver)
|
| 611 |
+
|
| 612 |
+
|
| 613 |
+
#
|
| 614 |
+
# functions internal to the module
|
| 615 |
+
|
| 616 |
+
|
| 617 |
+
def _select_options(pat: str) -> list[str]:
|
| 618 |
+
"""
|
| 619 |
+
returns a list of keys matching `pat`
|
| 620 |
+
|
| 621 |
+
if pat=="all", returns all registered options
|
| 622 |
+
"""
|
| 623 |
+
# short-circuit for exact key
|
| 624 |
+
if pat in _registered_options:
|
| 625 |
+
return [pat]
|
| 626 |
+
|
| 627 |
+
# else look through all of them
|
| 628 |
+
keys = sorted(_registered_options.keys())
|
| 629 |
+
if pat == "all": # reserved key
|
| 630 |
+
return keys
|
| 631 |
+
|
| 632 |
+
return [k for k in keys if re.search(pat, k, re.I)]
|
| 633 |
+
|
| 634 |
+
|
| 635 |
+
def _get_root(key: str) -> tuple[dict[str, Any], str]:
|
| 636 |
+
path = key.split(".")
|
| 637 |
+
cursor = _global_config
|
| 638 |
+
for p in path[:-1]:
|
| 639 |
+
cursor = cursor[p]
|
| 640 |
+
return cursor, path[-1]
|
| 641 |
+
|
| 642 |
+
|
| 643 |
+
def _is_deprecated(key: str) -> bool:
|
| 644 |
+
"""Returns True if the given option has been deprecated"""
|
| 645 |
+
key = key.lower()
|
| 646 |
+
return key in _deprecated_options
|
| 647 |
+
|
| 648 |
+
|
| 649 |
+
def _get_deprecated_option(key: str):
|
| 650 |
+
"""
|
| 651 |
+
Retrieves the metadata for a deprecated option, if `key` is deprecated.
|
| 652 |
+
|
| 653 |
+
Returns
|
| 654 |
+
-------
|
| 655 |
+
DeprecatedOption (namedtuple) if key is deprecated, None otherwise
|
| 656 |
+
"""
|
| 657 |
+
try:
|
| 658 |
+
d = _deprecated_options[key]
|
| 659 |
+
except KeyError:
|
| 660 |
+
return None
|
| 661 |
+
else:
|
| 662 |
+
return d
|
| 663 |
+
|
| 664 |
+
|
| 665 |
+
def _get_registered_option(key: str):
|
| 666 |
+
"""
|
| 667 |
+
Retrieves the option metadata if `key` is a registered option.
|
| 668 |
+
|
| 669 |
+
Returns
|
| 670 |
+
-------
|
| 671 |
+
RegisteredOption (namedtuple) if key is deprecated, None otherwise
|
| 672 |
+
"""
|
| 673 |
+
return _registered_options.get(key)
|
| 674 |
+
|
| 675 |
+
|
| 676 |
+
def _translate_key(key: str) -> str:
|
| 677 |
+
"""
|
| 678 |
+
if key id deprecated and a replacement key defined, will return the
|
| 679 |
+
replacement key, otherwise returns `key` as - is
|
| 680 |
+
"""
|
| 681 |
+
d = _get_deprecated_option(key)
|
| 682 |
+
if d:
|
| 683 |
+
return d.rkey or key
|
| 684 |
+
else:
|
| 685 |
+
return key
|
| 686 |
+
|
| 687 |
+
|
| 688 |
+
def _warn_if_deprecated(key: str) -> bool:
|
| 689 |
+
"""
|
| 690 |
+
Checks if `key` is a deprecated option and if so, prints a warning.
|
| 691 |
+
|
| 692 |
+
Returns
|
| 693 |
+
-------
|
| 694 |
+
bool - True if `key` is deprecated, False otherwise.
|
| 695 |
+
"""
|
| 696 |
+
d = _get_deprecated_option(key)
|
| 697 |
+
if d:
|
| 698 |
+
if d.msg:
|
| 699 |
+
warnings.warn(
|
| 700 |
+
d.msg,
|
| 701 |
+
FutureWarning,
|
| 702 |
+
stacklevel=find_stack_level(),
|
| 703 |
+
)
|
| 704 |
+
else:
|
| 705 |
+
msg = f"'{key}' is deprecated"
|
| 706 |
+
if d.removal_ver:
|
| 707 |
+
msg += f" and will be removed in {d.removal_ver}"
|
| 708 |
+
if d.rkey:
|
| 709 |
+
msg += f", please use '{d.rkey}' instead."
|
| 710 |
+
else:
|
| 711 |
+
msg += ", please refrain from using it."
|
| 712 |
+
|
| 713 |
+
warnings.warn(msg, FutureWarning, stacklevel=find_stack_level())
|
| 714 |
+
return True
|
| 715 |
+
return False
|
| 716 |
+
|
| 717 |
+
|
| 718 |
+
def _build_option_description(k: str) -> str:
|
| 719 |
+
"""Builds a formatted description of a registered option and prints it"""
|
| 720 |
+
o = _get_registered_option(k)
|
| 721 |
+
d = _get_deprecated_option(k)
|
| 722 |
+
|
| 723 |
+
s = f"{k} "
|
| 724 |
+
|
| 725 |
+
if o.doc:
|
| 726 |
+
s += "\n".join(o.doc.strip().split("\n"))
|
| 727 |
+
else:
|
| 728 |
+
s += "No description available."
|
| 729 |
+
|
| 730 |
+
if o:
|
| 731 |
+
s += f"\n [default: {o.defval}] [currently: {_get_option(k, True)}]"
|
| 732 |
+
|
| 733 |
+
if d:
|
| 734 |
+
rkey = d.rkey or ""
|
| 735 |
+
s += "\n (Deprecated"
|
| 736 |
+
s += f", use `{rkey}` instead."
|
| 737 |
+
s += ")"
|
| 738 |
+
|
| 739 |
+
return s
|
| 740 |
+
|
| 741 |
+
|
| 742 |
+
def pp_options_list(keys: Iterable[str], width: int = 80, _print: bool = False):
|
| 743 |
+
"""Builds a concise listing of available options, grouped by prefix"""
|
| 744 |
+
from itertools import groupby
|
| 745 |
+
from textwrap import wrap
|
| 746 |
+
|
| 747 |
+
def pp(name: str, ks: Iterable[str]) -> list[str]:
|
| 748 |
+
pfx = "- " + name + ".[" if name else ""
|
| 749 |
+
ls = wrap(
|
| 750 |
+
", ".join(ks),
|
| 751 |
+
width,
|
| 752 |
+
initial_indent=pfx,
|
| 753 |
+
subsequent_indent=" ",
|
| 754 |
+
break_long_words=False,
|
| 755 |
+
)
|
| 756 |
+
if ls and ls[-1] and name:
|
| 757 |
+
ls[-1] = ls[-1] + "]"
|
| 758 |
+
return ls
|
| 759 |
+
|
| 760 |
+
ls: list[str] = []
|
| 761 |
+
singles = [x for x in sorted(keys) if x.find(".") < 0]
|
| 762 |
+
if singles:
|
| 763 |
+
ls += pp("", singles)
|
| 764 |
+
keys = [x for x in keys if x.find(".") >= 0]
|
| 765 |
+
|
| 766 |
+
for k, g in groupby(sorted(keys), lambda x: x[: x.rfind(".")]):
|
| 767 |
+
ks = [x[len(k) + 1 :] for x in list(g)]
|
| 768 |
+
ls += pp(k, ks)
|
| 769 |
+
s = "\n".join(ls)
|
| 770 |
+
if _print:
|
| 771 |
+
print(s)
|
| 772 |
+
else:
|
| 773 |
+
return s
|
| 774 |
+
|
| 775 |
+
|
| 776 |
+
#
|
| 777 |
+
# helpers
|
| 778 |
+
|
| 779 |
+
|
| 780 |
+
@contextmanager
|
| 781 |
+
def config_prefix(prefix: str) -> Generator[None, None, None]:
|
| 782 |
+
"""
|
| 783 |
+
contextmanager for multiple invocations of API with a common prefix
|
| 784 |
+
|
| 785 |
+
supported API functions: (register / get / set )__option
|
| 786 |
+
|
| 787 |
+
Warning: This is not thread - safe, and won't work properly if you import
|
| 788 |
+
the API functions into your module using the "from x import y" construct.
|
| 789 |
+
|
| 790 |
+
Example
|
| 791 |
+
-------
|
| 792 |
+
import pandas._config.config as cf
|
| 793 |
+
with cf.config_prefix("display.font"):
|
| 794 |
+
cf.register_option("color", "red")
|
| 795 |
+
cf.register_option("size", " 5 pt")
|
| 796 |
+
cf.set_option(size, " 6 pt")
|
| 797 |
+
cf.get_option(size)
|
| 798 |
+
...
|
| 799 |
+
|
| 800 |
+
etc'
|
| 801 |
+
|
| 802 |
+
will register options "display.font.color", "display.font.size", set the
|
| 803 |
+
value of "display.font.size"... and so on.
|
| 804 |
+
"""
|
| 805 |
+
# Note: reset_option relies on set_option, and on key directly
|
| 806 |
+
# it does not fit in to this monkey-patching scheme
|
| 807 |
+
|
| 808 |
+
global register_option, get_option, set_option
|
| 809 |
+
|
| 810 |
+
def wrap(func: F) -> F:
|
| 811 |
+
def inner(key: str, *args, **kwds):
|
| 812 |
+
pkey = f"{prefix}.{key}"
|
| 813 |
+
return func(pkey, *args, **kwds)
|
| 814 |
+
|
| 815 |
+
return cast(F, inner)
|
| 816 |
+
|
| 817 |
+
_register_option = register_option
|
| 818 |
+
_get_option = get_option
|
| 819 |
+
_set_option = set_option
|
| 820 |
+
set_option = wrap(set_option)
|
| 821 |
+
get_option = wrap(get_option)
|
| 822 |
+
register_option = wrap(register_option)
|
| 823 |
+
try:
|
| 824 |
+
yield
|
| 825 |
+
finally:
|
| 826 |
+
set_option = _set_option
|
| 827 |
+
get_option = _get_option
|
| 828 |
+
register_option = _register_option
|
| 829 |
+
|
| 830 |
+
|
| 831 |
+
# These factories and methods are handy for use as the validator
|
| 832 |
+
# arg in register_option
|
| 833 |
+
|
| 834 |
+
|
| 835 |
+
def is_type_factory(_type: type[Any]) -> Callable[[Any], None]:
|
| 836 |
+
"""
|
| 837 |
+
|
| 838 |
+
Parameters
|
| 839 |
+
----------
|
| 840 |
+
`_type` - a type to be compared against (e.g. type(x) == `_type`)
|
| 841 |
+
|
| 842 |
+
Returns
|
| 843 |
+
-------
|
| 844 |
+
validator - a function of a single argument x , which raises
|
| 845 |
+
ValueError if type(x) is not equal to `_type`
|
| 846 |
+
|
| 847 |
+
"""
|
| 848 |
+
|
| 849 |
+
def inner(x) -> None:
|
| 850 |
+
if type(x) != _type:
|
| 851 |
+
raise ValueError(f"Value must have type '{_type}'")
|
| 852 |
+
|
| 853 |
+
return inner
|
| 854 |
+
|
| 855 |
+
|
| 856 |
+
def is_instance_factory(_type) -> Callable[[Any], None]:
|
| 857 |
+
"""
|
| 858 |
+
|
| 859 |
+
Parameters
|
| 860 |
+
----------
|
| 861 |
+
`_type` - the type to be checked against
|
| 862 |
+
|
| 863 |
+
Returns
|
| 864 |
+
-------
|
| 865 |
+
validator - a function of a single argument x , which raises
|
| 866 |
+
ValueError if x is not an instance of `_type`
|
| 867 |
+
|
| 868 |
+
"""
|
| 869 |
+
if isinstance(_type, (tuple, list)):
|
| 870 |
+
_type = tuple(_type)
|
| 871 |
+
type_repr = "|".join(map(str, _type))
|
| 872 |
+
else:
|
| 873 |
+
type_repr = f"'{_type}'"
|
| 874 |
+
|
| 875 |
+
def inner(x) -> None:
|
| 876 |
+
if not isinstance(x, _type):
|
| 877 |
+
raise ValueError(f"Value must be an instance of {type_repr}")
|
| 878 |
+
|
| 879 |
+
return inner
|
| 880 |
+
|
| 881 |
+
|
| 882 |
+
def is_one_of_factory(legal_values) -> Callable[[Any], None]:
|
| 883 |
+
callables = [c for c in legal_values if callable(c)]
|
| 884 |
+
legal_values = [c for c in legal_values if not callable(c)]
|
| 885 |
+
|
| 886 |
+
def inner(x) -> None:
|
| 887 |
+
if x not in legal_values:
|
| 888 |
+
if not any(c(x) for c in callables):
|
| 889 |
+
uvals = [str(lval) for lval in legal_values]
|
| 890 |
+
pp_values = "|".join(uvals)
|
| 891 |
+
msg = f"Value must be one of {pp_values}"
|
| 892 |
+
if len(callables):
|
| 893 |
+
msg += " or a callable"
|
| 894 |
+
raise ValueError(msg)
|
| 895 |
+
|
| 896 |
+
return inner
|
| 897 |
+
|
| 898 |
+
|
| 899 |
+
def is_nonnegative_int(value: object) -> None:
|
| 900 |
+
"""
|
| 901 |
+
Verify that value is None or a positive int.
|
| 902 |
+
|
| 903 |
+
Parameters
|
| 904 |
+
----------
|
| 905 |
+
value : None or int
|
| 906 |
+
The `value` to be checked.
|
| 907 |
+
|
| 908 |
+
Raises
|
| 909 |
+
------
|
| 910 |
+
ValueError
|
| 911 |
+
When the value is not None or is a negative integer
|
| 912 |
+
"""
|
| 913 |
+
if value is None:
|
| 914 |
+
return
|
| 915 |
+
|
| 916 |
+
elif isinstance(value, int):
|
| 917 |
+
if value >= 0:
|
| 918 |
+
return
|
| 919 |
+
|
| 920 |
+
msg = "Value must be a nonnegative integer or None"
|
| 921 |
+
raise ValueError(msg)
|
| 922 |
+
|
| 923 |
+
|
| 924 |
+
# common type validators, for convenience
|
| 925 |
+
# usage: register_option(... , validator = is_int)
|
| 926 |
+
is_int = is_type_factory(int)
|
| 927 |
+
is_bool = is_type_factory(bool)
|
| 928 |
+
is_float = is_type_factory(float)
|
| 929 |
+
is_str = is_type_factory(str)
|
| 930 |
+
is_text = is_instance_factory((str, bytes))
|
| 931 |
+
|
| 932 |
+
|
| 933 |
+
def is_callable(obj) -> bool:
|
| 934 |
+
"""
|
| 935 |
+
|
| 936 |
+
Parameters
|
| 937 |
+
----------
|
| 938 |
+
`obj` - the object to be checked
|
| 939 |
+
|
| 940 |
+
Returns
|
| 941 |
+
-------
|
| 942 |
+
validator - returns True if object is callable
|
| 943 |
+
raises ValueError otherwise.
|
| 944 |
+
|
| 945 |
+
"""
|
| 946 |
+
if not callable(obj):
|
| 947 |
+
raise ValueError("Value must be a callable")
|
| 948 |
+
return True
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_config/dates.py
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
config for datetime formatting
|
| 3 |
+
"""
|
| 4 |
+
from __future__ import annotations
|
| 5 |
+
|
| 6 |
+
from pandas._config import config as cf
|
| 7 |
+
|
| 8 |
+
pc_date_dayfirst_doc = """
|
| 9 |
+
: boolean
|
| 10 |
+
When True, prints and parses dates with the day first, eg 20/01/2005
|
| 11 |
+
"""
|
| 12 |
+
|
| 13 |
+
pc_date_yearfirst_doc = """
|
| 14 |
+
: boolean
|
| 15 |
+
When True, prints and parses dates with the year first, eg 2005/01/20
|
| 16 |
+
"""
|
| 17 |
+
|
| 18 |
+
with cf.config_prefix("display"):
|
| 19 |
+
# Needed upstream of `_libs` because these are used in tslibs.parsing
|
| 20 |
+
cf.register_option(
|
| 21 |
+
"date_dayfirst", False, pc_date_dayfirst_doc, validator=cf.is_bool
|
| 22 |
+
)
|
| 23 |
+
cf.register_option(
|
| 24 |
+
"date_yearfirst", False, pc_date_yearfirst_doc, validator=cf.is_bool
|
| 25 |
+
)
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_config/display.py
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Unopinionated display configuration.
|
| 3 |
+
"""
|
| 4 |
+
|
| 5 |
+
from __future__ import annotations
|
| 6 |
+
|
| 7 |
+
import locale
|
| 8 |
+
import sys
|
| 9 |
+
|
| 10 |
+
from pandas._config import config as cf
|
| 11 |
+
|
| 12 |
+
# -----------------------------------------------------------------------------
|
| 13 |
+
# Global formatting options
|
| 14 |
+
_initial_defencoding: str | None = None
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
def detect_console_encoding() -> str:
|
| 18 |
+
"""
|
| 19 |
+
Try to find the most capable encoding supported by the console.
|
| 20 |
+
slightly modified from the way IPython handles the same issue.
|
| 21 |
+
"""
|
| 22 |
+
global _initial_defencoding
|
| 23 |
+
|
| 24 |
+
encoding = None
|
| 25 |
+
try:
|
| 26 |
+
encoding = sys.stdout.encoding or sys.stdin.encoding
|
| 27 |
+
except (AttributeError, OSError):
|
| 28 |
+
pass
|
| 29 |
+
|
| 30 |
+
# try again for something better
|
| 31 |
+
if not encoding or "ascii" in encoding.lower():
|
| 32 |
+
try:
|
| 33 |
+
encoding = locale.getpreferredencoding()
|
| 34 |
+
except locale.Error:
|
| 35 |
+
# can be raised by locale.setlocale(), which is
|
| 36 |
+
# called by getpreferredencoding
|
| 37 |
+
# (on some systems, see stdlib locale docs)
|
| 38 |
+
pass
|
| 39 |
+
|
| 40 |
+
# when all else fails. this will usually be "ascii"
|
| 41 |
+
if not encoding or "ascii" in encoding.lower():
|
| 42 |
+
encoding = sys.getdefaultencoding()
|
| 43 |
+
|
| 44 |
+
# GH#3360, save the reported defencoding at import time
|
| 45 |
+
# MPL backends may change it. Make available for debugging.
|
| 46 |
+
if not _initial_defencoding:
|
| 47 |
+
_initial_defencoding = sys.getdefaultencoding()
|
| 48 |
+
|
| 49 |
+
return encoding
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
pc_encoding_doc = """
|
| 53 |
+
: str/unicode
|
| 54 |
+
Defaults to the detected encoding of the console.
|
| 55 |
+
Specifies the encoding to be used for strings returned by to_string,
|
| 56 |
+
these are generally strings meant to be displayed on the console.
|
| 57 |
+
"""
|
| 58 |
+
|
| 59 |
+
with cf.config_prefix("display"):
|
| 60 |
+
cf.register_option(
|
| 61 |
+
"encoding", detect_console_encoding(), pc_encoding_doc, validator=cf.is_text
|
| 62 |
+
)
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_config/localization.py
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Helpers for configuring locale settings.
|
| 3 |
+
|
| 4 |
+
Name `localization` is chosen to avoid overlap with builtin `locale` module.
|
| 5 |
+
"""
|
| 6 |
+
from __future__ import annotations
|
| 7 |
+
|
| 8 |
+
from contextlib import contextmanager
|
| 9 |
+
import locale
|
| 10 |
+
import platform
|
| 11 |
+
import re
|
| 12 |
+
import subprocess
|
| 13 |
+
from typing import TYPE_CHECKING
|
| 14 |
+
|
| 15 |
+
from pandas._config.config import options
|
| 16 |
+
|
| 17 |
+
if TYPE_CHECKING:
|
| 18 |
+
from collections.abc import Generator
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
@contextmanager
|
| 22 |
+
def set_locale(
|
| 23 |
+
new_locale: str | tuple[str, str], lc_var: int = locale.LC_ALL
|
| 24 |
+
) -> Generator[str | tuple[str, str], None, None]:
|
| 25 |
+
"""
|
| 26 |
+
Context manager for temporarily setting a locale.
|
| 27 |
+
|
| 28 |
+
Parameters
|
| 29 |
+
----------
|
| 30 |
+
new_locale : str or tuple
|
| 31 |
+
A string of the form <language_country>.<encoding>. For example to set
|
| 32 |
+
the current locale to US English with a UTF8 encoding, you would pass
|
| 33 |
+
"en_US.UTF-8".
|
| 34 |
+
lc_var : int, default `locale.LC_ALL`
|
| 35 |
+
The category of the locale being set.
|
| 36 |
+
|
| 37 |
+
Notes
|
| 38 |
+
-----
|
| 39 |
+
This is useful when you want to run a particular block of code under a
|
| 40 |
+
particular locale, without globally setting the locale. This probably isn't
|
| 41 |
+
thread-safe.
|
| 42 |
+
"""
|
| 43 |
+
# getlocale is not always compliant with setlocale, use setlocale. GH#46595
|
| 44 |
+
current_locale = locale.setlocale(lc_var)
|
| 45 |
+
|
| 46 |
+
try:
|
| 47 |
+
locale.setlocale(lc_var, new_locale)
|
| 48 |
+
normalized_code, normalized_encoding = locale.getlocale()
|
| 49 |
+
if normalized_code is not None and normalized_encoding is not None:
|
| 50 |
+
yield f"{normalized_code}.{normalized_encoding}"
|
| 51 |
+
else:
|
| 52 |
+
yield new_locale
|
| 53 |
+
finally:
|
| 54 |
+
locale.setlocale(lc_var, current_locale)
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
def can_set_locale(lc: str, lc_var: int = locale.LC_ALL) -> bool:
|
| 58 |
+
"""
|
| 59 |
+
Check to see if we can set a locale, and subsequently get the locale,
|
| 60 |
+
without raising an Exception.
|
| 61 |
+
|
| 62 |
+
Parameters
|
| 63 |
+
----------
|
| 64 |
+
lc : str
|
| 65 |
+
The locale to attempt to set.
|
| 66 |
+
lc_var : int, default `locale.LC_ALL`
|
| 67 |
+
The category of the locale being set.
|
| 68 |
+
|
| 69 |
+
Returns
|
| 70 |
+
-------
|
| 71 |
+
bool
|
| 72 |
+
Whether the passed locale can be set
|
| 73 |
+
"""
|
| 74 |
+
try:
|
| 75 |
+
with set_locale(lc, lc_var=lc_var):
|
| 76 |
+
pass
|
| 77 |
+
except (ValueError, locale.Error):
|
| 78 |
+
# horrible name for a Exception subclass
|
| 79 |
+
return False
|
| 80 |
+
else:
|
| 81 |
+
return True
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
def _valid_locales(locales: list[str] | str, normalize: bool) -> list[str]:
|
| 85 |
+
"""
|
| 86 |
+
Return a list of normalized locales that do not throw an ``Exception``
|
| 87 |
+
when set.
|
| 88 |
+
|
| 89 |
+
Parameters
|
| 90 |
+
----------
|
| 91 |
+
locales : str
|
| 92 |
+
A string where each locale is separated by a newline.
|
| 93 |
+
normalize : bool
|
| 94 |
+
Whether to call ``locale.normalize`` on each locale.
|
| 95 |
+
|
| 96 |
+
Returns
|
| 97 |
+
-------
|
| 98 |
+
valid_locales : list
|
| 99 |
+
A list of valid locales.
|
| 100 |
+
"""
|
| 101 |
+
return [
|
| 102 |
+
loc
|
| 103 |
+
for loc in (
|
| 104 |
+
locale.normalize(loc.strip()) if normalize else loc.strip()
|
| 105 |
+
for loc in locales
|
| 106 |
+
)
|
| 107 |
+
if can_set_locale(loc)
|
| 108 |
+
]
|
| 109 |
+
|
| 110 |
+
|
| 111 |
+
def get_locales(
|
| 112 |
+
prefix: str | None = None,
|
| 113 |
+
normalize: bool = True,
|
| 114 |
+
) -> list[str]:
|
| 115 |
+
"""
|
| 116 |
+
Get all the locales that are available on the system.
|
| 117 |
+
|
| 118 |
+
Parameters
|
| 119 |
+
----------
|
| 120 |
+
prefix : str
|
| 121 |
+
If not ``None`` then return only those locales with the prefix
|
| 122 |
+
provided. For example to get all English language locales (those that
|
| 123 |
+
start with ``"en"``), pass ``prefix="en"``.
|
| 124 |
+
normalize : bool
|
| 125 |
+
Call ``locale.normalize`` on the resulting list of available locales.
|
| 126 |
+
If ``True``, only locales that can be set without throwing an
|
| 127 |
+
``Exception`` are returned.
|
| 128 |
+
|
| 129 |
+
Returns
|
| 130 |
+
-------
|
| 131 |
+
locales : list of strings
|
| 132 |
+
A list of locale strings that can be set with ``locale.setlocale()``.
|
| 133 |
+
For example::
|
| 134 |
+
|
| 135 |
+
locale.setlocale(locale.LC_ALL, locale_string)
|
| 136 |
+
|
| 137 |
+
On error will return an empty list (no locale available, e.g. Windows)
|
| 138 |
+
|
| 139 |
+
"""
|
| 140 |
+
if platform.system() in ("Linux", "Darwin"):
|
| 141 |
+
raw_locales = subprocess.check_output(["locale", "-a"])
|
| 142 |
+
else:
|
| 143 |
+
# Other platforms e.g. windows platforms don't define "locale -a"
|
| 144 |
+
# Note: is_platform_windows causes circular import here
|
| 145 |
+
return []
|
| 146 |
+
|
| 147 |
+
try:
|
| 148 |
+
# raw_locales is "\n" separated list of locales
|
| 149 |
+
# it may contain non-decodable parts, so split
|
| 150 |
+
# extract what we can and then rejoin.
|
| 151 |
+
split_raw_locales = raw_locales.split(b"\n")
|
| 152 |
+
out_locales = []
|
| 153 |
+
for x in split_raw_locales:
|
| 154 |
+
try:
|
| 155 |
+
out_locales.append(str(x, encoding=options.display.encoding))
|
| 156 |
+
except UnicodeError:
|
| 157 |
+
# 'locale -a' is used to populated 'raw_locales' and on
|
| 158 |
+
# Redhat 7 Linux (and maybe others) prints locale names
|
| 159 |
+
# using windows-1252 encoding. Bug only triggered by
|
| 160 |
+
# a few special characters and when there is an
|
| 161 |
+
# extensive list of installed locales.
|
| 162 |
+
out_locales.append(str(x, encoding="windows-1252"))
|
| 163 |
+
|
| 164 |
+
except TypeError:
|
| 165 |
+
pass
|
| 166 |
+
|
| 167 |
+
if prefix is None:
|
| 168 |
+
return _valid_locales(out_locales, normalize)
|
| 169 |
+
|
| 170 |
+
pattern = re.compile(f"{prefix}.*")
|
| 171 |
+
found = pattern.findall("\n".join(out_locales))
|
| 172 |
+
return _valid_locales(found, normalize)
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_testing/__init__.py
ADDED
|
@@ -0,0 +1,635 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
from decimal import Decimal
|
| 4 |
+
import operator
|
| 5 |
+
import os
|
| 6 |
+
from sys import byteorder
|
| 7 |
+
from typing import (
|
| 8 |
+
TYPE_CHECKING,
|
| 9 |
+
Callable,
|
| 10 |
+
ContextManager,
|
| 11 |
+
)
|
| 12 |
+
import warnings
|
| 13 |
+
|
| 14 |
+
import numpy as np
|
| 15 |
+
|
| 16 |
+
from pandas._config import using_string_dtype
|
| 17 |
+
from pandas._config.localization import (
|
| 18 |
+
can_set_locale,
|
| 19 |
+
get_locales,
|
| 20 |
+
set_locale,
|
| 21 |
+
)
|
| 22 |
+
|
| 23 |
+
from pandas.compat import pa_version_under10p1
|
| 24 |
+
|
| 25 |
+
import pandas as pd
|
| 26 |
+
from pandas import (
|
| 27 |
+
ArrowDtype,
|
| 28 |
+
DataFrame,
|
| 29 |
+
Index,
|
| 30 |
+
MultiIndex,
|
| 31 |
+
RangeIndex,
|
| 32 |
+
Series,
|
| 33 |
+
)
|
| 34 |
+
from pandas._testing._io import (
|
| 35 |
+
round_trip_localpath,
|
| 36 |
+
round_trip_pathlib,
|
| 37 |
+
round_trip_pickle,
|
| 38 |
+
write_to_compressed,
|
| 39 |
+
)
|
| 40 |
+
from pandas._testing._warnings import (
|
| 41 |
+
assert_produces_warning,
|
| 42 |
+
maybe_produces_warning,
|
| 43 |
+
)
|
| 44 |
+
from pandas._testing.asserters import (
|
| 45 |
+
assert_almost_equal,
|
| 46 |
+
assert_attr_equal,
|
| 47 |
+
assert_categorical_equal,
|
| 48 |
+
assert_class_equal,
|
| 49 |
+
assert_contains_all,
|
| 50 |
+
assert_copy,
|
| 51 |
+
assert_datetime_array_equal,
|
| 52 |
+
assert_dict_equal,
|
| 53 |
+
assert_equal,
|
| 54 |
+
assert_extension_array_equal,
|
| 55 |
+
assert_frame_equal,
|
| 56 |
+
assert_index_equal,
|
| 57 |
+
assert_indexing_slices_equivalent,
|
| 58 |
+
assert_interval_array_equal,
|
| 59 |
+
assert_is_sorted,
|
| 60 |
+
assert_is_valid_plot_return_object,
|
| 61 |
+
assert_metadata_equivalent,
|
| 62 |
+
assert_numpy_array_equal,
|
| 63 |
+
assert_period_array_equal,
|
| 64 |
+
assert_series_equal,
|
| 65 |
+
assert_sp_array_equal,
|
| 66 |
+
assert_timedelta_array_equal,
|
| 67 |
+
raise_assert_detail,
|
| 68 |
+
)
|
| 69 |
+
from pandas._testing.compat import (
|
| 70 |
+
get_dtype,
|
| 71 |
+
get_obj,
|
| 72 |
+
)
|
| 73 |
+
from pandas._testing.contexts import (
|
| 74 |
+
assert_cow_warning,
|
| 75 |
+
decompress_file,
|
| 76 |
+
ensure_clean,
|
| 77 |
+
raises_chained_assignment_error,
|
| 78 |
+
set_timezone,
|
| 79 |
+
use_numexpr,
|
| 80 |
+
with_csv_dialect,
|
| 81 |
+
)
|
| 82 |
+
from pandas.core.arrays import (
|
| 83 |
+
ArrowExtensionArray,
|
| 84 |
+
BaseMaskedArray,
|
| 85 |
+
NumpyExtensionArray,
|
| 86 |
+
)
|
| 87 |
+
from pandas.core.arrays._mixins import NDArrayBackedExtensionArray
|
| 88 |
+
from pandas.core.construction import extract_array
|
| 89 |
+
|
| 90 |
+
if TYPE_CHECKING:
|
| 91 |
+
from pandas._typing import (
|
| 92 |
+
Dtype,
|
| 93 |
+
NpDtype,
|
| 94 |
+
)
|
| 95 |
+
|
| 96 |
+
|
| 97 |
+
UNSIGNED_INT_NUMPY_DTYPES: list[NpDtype] = ["uint8", "uint16", "uint32", "uint64"]
|
| 98 |
+
UNSIGNED_INT_EA_DTYPES: list[Dtype] = ["UInt8", "UInt16", "UInt32", "UInt64"]
|
| 99 |
+
SIGNED_INT_NUMPY_DTYPES: list[NpDtype] = [int, "int8", "int16", "int32", "int64"]
|
| 100 |
+
SIGNED_INT_EA_DTYPES: list[Dtype] = ["Int8", "Int16", "Int32", "Int64"]
|
| 101 |
+
ALL_INT_NUMPY_DTYPES = UNSIGNED_INT_NUMPY_DTYPES + SIGNED_INT_NUMPY_DTYPES
|
| 102 |
+
ALL_INT_EA_DTYPES = UNSIGNED_INT_EA_DTYPES + SIGNED_INT_EA_DTYPES
|
| 103 |
+
ALL_INT_DTYPES: list[Dtype] = [*ALL_INT_NUMPY_DTYPES, *ALL_INT_EA_DTYPES]
|
| 104 |
+
|
| 105 |
+
FLOAT_NUMPY_DTYPES: list[NpDtype] = [float, "float32", "float64"]
|
| 106 |
+
FLOAT_EA_DTYPES: list[Dtype] = ["Float32", "Float64"]
|
| 107 |
+
ALL_FLOAT_DTYPES: list[Dtype] = [*FLOAT_NUMPY_DTYPES, *FLOAT_EA_DTYPES]
|
| 108 |
+
|
| 109 |
+
COMPLEX_DTYPES: list[Dtype] = [complex, "complex64", "complex128"]
|
| 110 |
+
if using_string_dtype():
|
| 111 |
+
STRING_DTYPES: list[Dtype] = ["U"]
|
| 112 |
+
else:
|
| 113 |
+
STRING_DTYPES: list[Dtype] = [str, "str", "U"] # type: ignore[no-redef]
|
| 114 |
+
COMPLEX_FLOAT_DTYPES: list[Dtype] = [*COMPLEX_DTYPES, *FLOAT_NUMPY_DTYPES]
|
| 115 |
+
|
| 116 |
+
DATETIME64_DTYPES: list[Dtype] = ["datetime64[ns]", "M8[ns]"]
|
| 117 |
+
TIMEDELTA64_DTYPES: list[Dtype] = ["timedelta64[ns]", "m8[ns]"]
|
| 118 |
+
|
| 119 |
+
BOOL_DTYPES: list[Dtype] = [bool, "bool"]
|
| 120 |
+
BYTES_DTYPES: list[Dtype] = [bytes, "bytes"]
|
| 121 |
+
OBJECT_DTYPES: list[Dtype] = [object, "object"]
|
| 122 |
+
|
| 123 |
+
ALL_REAL_NUMPY_DTYPES = FLOAT_NUMPY_DTYPES + ALL_INT_NUMPY_DTYPES
|
| 124 |
+
ALL_REAL_EXTENSION_DTYPES = FLOAT_EA_DTYPES + ALL_INT_EA_DTYPES
|
| 125 |
+
ALL_REAL_DTYPES: list[Dtype] = [*ALL_REAL_NUMPY_DTYPES, *ALL_REAL_EXTENSION_DTYPES]
|
| 126 |
+
ALL_NUMERIC_DTYPES: list[Dtype] = [*ALL_REAL_DTYPES, *COMPLEX_DTYPES]
|
| 127 |
+
|
| 128 |
+
ALL_NUMPY_DTYPES = (
|
| 129 |
+
ALL_REAL_NUMPY_DTYPES
|
| 130 |
+
+ COMPLEX_DTYPES
|
| 131 |
+
+ STRING_DTYPES
|
| 132 |
+
+ DATETIME64_DTYPES
|
| 133 |
+
+ TIMEDELTA64_DTYPES
|
| 134 |
+
+ BOOL_DTYPES
|
| 135 |
+
+ OBJECT_DTYPES
|
| 136 |
+
+ BYTES_DTYPES
|
| 137 |
+
)
|
| 138 |
+
|
| 139 |
+
NARROW_NP_DTYPES = [
|
| 140 |
+
np.float16,
|
| 141 |
+
np.float32,
|
| 142 |
+
np.int8,
|
| 143 |
+
np.int16,
|
| 144 |
+
np.int32,
|
| 145 |
+
np.uint8,
|
| 146 |
+
np.uint16,
|
| 147 |
+
np.uint32,
|
| 148 |
+
]
|
| 149 |
+
|
| 150 |
+
PYTHON_DATA_TYPES = [
|
| 151 |
+
str,
|
| 152 |
+
int,
|
| 153 |
+
float,
|
| 154 |
+
complex,
|
| 155 |
+
list,
|
| 156 |
+
tuple,
|
| 157 |
+
range,
|
| 158 |
+
dict,
|
| 159 |
+
set,
|
| 160 |
+
frozenset,
|
| 161 |
+
bool,
|
| 162 |
+
bytes,
|
| 163 |
+
bytearray,
|
| 164 |
+
memoryview,
|
| 165 |
+
]
|
| 166 |
+
|
| 167 |
+
ENDIAN = {"little": "<", "big": ">"}[byteorder]
|
| 168 |
+
|
| 169 |
+
NULL_OBJECTS = [None, np.nan, pd.NaT, float("nan"), pd.NA, Decimal("NaN")]
|
| 170 |
+
NP_NAT_OBJECTS = [
|
| 171 |
+
cls("NaT", unit)
|
| 172 |
+
for cls in [np.datetime64, np.timedelta64]
|
| 173 |
+
for unit in [
|
| 174 |
+
"Y",
|
| 175 |
+
"M",
|
| 176 |
+
"W",
|
| 177 |
+
"D",
|
| 178 |
+
"h",
|
| 179 |
+
"m",
|
| 180 |
+
"s",
|
| 181 |
+
"ms",
|
| 182 |
+
"us",
|
| 183 |
+
"ns",
|
| 184 |
+
"ps",
|
| 185 |
+
"fs",
|
| 186 |
+
"as",
|
| 187 |
+
]
|
| 188 |
+
]
|
| 189 |
+
|
| 190 |
+
if not pa_version_under10p1:
|
| 191 |
+
import pyarrow as pa
|
| 192 |
+
|
| 193 |
+
UNSIGNED_INT_PYARROW_DTYPES = [pa.uint8(), pa.uint16(), pa.uint32(), pa.uint64()]
|
| 194 |
+
SIGNED_INT_PYARROW_DTYPES = [pa.int8(), pa.int16(), pa.int32(), pa.int64()]
|
| 195 |
+
ALL_INT_PYARROW_DTYPES = UNSIGNED_INT_PYARROW_DTYPES + SIGNED_INT_PYARROW_DTYPES
|
| 196 |
+
ALL_INT_PYARROW_DTYPES_STR_REPR = [
|
| 197 |
+
str(ArrowDtype(typ)) for typ in ALL_INT_PYARROW_DTYPES
|
| 198 |
+
]
|
| 199 |
+
|
| 200 |
+
# pa.float16 doesn't seem supported
|
| 201 |
+
# https://github.com/apache/arrow/blob/master/python/pyarrow/src/arrow/python/helpers.cc#L86
|
| 202 |
+
FLOAT_PYARROW_DTYPES = [pa.float32(), pa.float64()]
|
| 203 |
+
FLOAT_PYARROW_DTYPES_STR_REPR = [
|
| 204 |
+
str(ArrowDtype(typ)) for typ in FLOAT_PYARROW_DTYPES
|
| 205 |
+
]
|
| 206 |
+
DECIMAL_PYARROW_DTYPES = [pa.decimal128(7, 3)]
|
| 207 |
+
STRING_PYARROW_DTYPES = [pa.string()]
|
| 208 |
+
BINARY_PYARROW_DTYPES = [pa.binary()]
|
| 209 |
+
|
| 210 |
+
TIME_PYARROW_DTYPES = [
|
| 211 |
+
pa.time32("s"),
|
| 212 |
+
pa.time32("ms"),
|
| 213 |
+
pa.time64("us"),
|
| 214 |
+
pa.time64("ns"),
|
| 215 |
+
]
|
| 216 |
+
DATE_PYARROW_DTYPES = [pa.date32(), pa.date64()]
|
| 217 |
+
DATETIME_PYARROW_DTYPES = [
|
| 218 |
+
pa.timestamp(unit=unit, tz=tz)
|
| 219 |
+
for unit in ["s", "ms", "us", "ns"]
|
| 220 |
+
for tz in [None, "UTC", "US/Pacific", "US/Eastern"]
|
| 221 |
+
]
|
| 222 |
+
TIMEDELTA_PYARROW_DTYPES = [pa.duration(unit) for unit in ["s", "ms", "us", "ns"]]
|
| 223 |
+
|
| 224 |
+
BOOL_PYARROW_DTYPES = [pa.bool_()]
|
| 225 |
+
|
| 226 |
+
# TODO: Add container like pyarrow types:
|
| 227 |
+
# https://arrow.apache.org/docs/python/api/datatypes.html#factory-functions
|
| 228 |
+
ALL_PYARROW_DTYPES = (
|
| 229 |
+
ALL_INT_PYARROW_DTYPES
|
| 230 |
+
+ FLOAT_PYARROW_DTYPES
|
| 231 |
+
+ DECIMAL_PYARROW_DTYPES
|
| 232 |
+
+ STRING_PYARROW_DTYPES
|
| 233 |
+
+ BINARY_PYARROW_DTYPES
|
| 234 |
+
+ TIME_PYARROW_DTYPES
|
| 235 |
+
+ DATE_PYARROW_DTYPES
|
| 236 |
+
+ DATETIME_PYARROW_DTYPES
|
| 237 |
+
+ TIMEDELTA_PYARROW_DTYPES
|
| 238 |
+
+ BOOL_PYARROW_DTYPES
|
| 239 |
+
)
|
| 240 |
+
ALL_REAL_PYARROW_DTYPES_STR_REPR = (
|
| 241 |
+
ALL_INT_PYARROW_DTYPES_STR_REPR + FLOAT_PYARROW_DTYPES_STR_REPR
|
| 242 |
+
)
|
| 243 |
+
else:
|
| 244 |
+
FLOAT_PYARROW_DTYPES_STR_REPR = []
|
| 245 |
+
ALL_INT_PYARROW_DTYPES_STR_REPR = []
|
| 246 |
+
ALL_PYARROW_DTYPES = []
|
| 247 |
+
ALL_REAL_PYARROW_DTYPES_STR_REPR = []
|
| 248 |
+
|
| 249 |
+
ALL_REAL_NULLABLE_DTYPES = (
|
| 250 |
+
FLOAT_NUMPY_DTYPES + ALL_REAL_EXTENSION_DTYPES + ALL_REAL_PYARROW_DTYPES_STR_REPR
|
| 251 |
+
)
|
| 252 |
+
|
| 253 |
+
arithmetic_dunder_methods = [
|
| 254 |
+
"__add__",
|
| 255 |
+
"__radd__",
|
| 256 |
+
"__sub__",
|
| 257 |
+
"__rsub__",
|
| 258 |
+
"__mul__",
|
| 259 |
+
"__rmul__",
|
| 260 |
+
"__floordiv__",
|
| 261 |
+
"__rfloordiv__",
|
| 262 |
+
"__truediv__",
|
| 263 |
+
"__rtruediv__",
|
| 264 |
+
"__pow__",
|
| 265 |
+
"__rpow__",
|
| 266 |
+
"__mod__",
|
| 267 |
+
"__rmod__",
|
| 268 |
+
]
|
| 269 |
+
|
| 270 |
+
comparison_dunder_methods = ["__eq__", "__ne__", "__le__", "__lt__", "__ge__", "__gt__"]
|
| 271 |
+
|
| 272 |
+
|
| 273 |
+
# -----------------------------------------------------------------------------
|
| 274 |
+
# Comparators
|
| 275 |
+
|
| 276 |
+
|
| 277 |
+
def box_expected(expected, box_cls, transpose: bool = True):
|
| 278 |
+
"""
|
| 279 |
+
Helper function to wrap the expected output of a test in a given box_class.
|
| 280 |
+
|
| 281 |
+
Parameters
|
| 282 |
+
----------
|
| 283 |
+
expected : np.ndarray, Index, Series
|
| 284 |
+
box_cls : {Index, Series, DataFrame}
|
| 285 |
+
|
| 286 |
+
Returns
|
| 287 |
+
-------
|
| 288 |
+
subclass of box_cls
|
| 289 |
+
"""
|
| 290 |
+
if box_cls is pd.array:
|
| 291 |
+
if isinstance(expected, RangeIndex):
|
| 292 |
+
# pd.array would return an IntegerArray
|
| 293 |
+
expected = NumpyExtensionArray(np.asarray(expected._values))
|
| 294 |
+
else:
|
| 295 |
+
expected = pd.array(expected, copy=False)
|
| 296 |
+
elif box_cls is Index:
|
| 297 |
+
with warnings.catch_warnings():
|
| 298 |
+
warnings.filterwarnings("ignore", "Dtype inference", category=FutureWarning)
|
| 299 |
+
expected = Index(expected)
|
| 300 |
+
elif box_cls is Series:
|
| 301 |
+
with warnings.catch_warnings():
|
| 302 |
+
warnings.filterwarnings("ignore", "Dtype inference", category=FutureWarning)
|
| 303 |
+
expected = Series(expected)
|
| 304 |
+
elif box_cls is DataFrame:
|
| 305 |
+
with warnings.catch_warnings():
|
| 306 |
+
warnings.filterwarnings("ignore", "Dtype inference", category=FutureWarning)
|
| 307 |
+
expected = Series(expected).to_frame()
|
| 308 |
+
if transpose:
|
| 309 |
+
# for vector operations, we need a DataFrame to be a single-row,
|
| 310 |
+
# not a single-column, in order to operate against non-DataFrame
|
| 311 |
+
# vectors of the same length. But convert to two rows to avoid
|
| 312 |
+
# single-row special cases in datetime arithmetic
|
| 313 |
+
expected = expected.T
|
| 314 |
+
expected = pd.concat([expected] * 2, ignore_index=True)
|
| 315 |
+
elif box_cls is np.ndarray or box_cls is np.array:
|
| 316 |
+
expected = np.array(expected)
|
| 317 |
+
elif box_cls is to_array:
|
| 318 |
+
expected = to_array(expected)
|
| 319 |
+
else:
|
| 320 |
+
raise NotImplementedError(box_cls)
|
| 321 |
+
return expected
|
| 322 |
+
|
| 323 |
+
|
| 324 |
+
def to_array(obj):
|
| 325 |
+
"""
|
| 326 |
+
Similar to pd.array, but does not cast numpy dtypes to nullable dtypes.
|
| 327 |
+
"""
|
| 328 |
+
# temporary implementation until we get pd.array in place
|
| 329 |
+
dtype = getattr(obj, "dtype", None)
|
| 330 |
+
|
| 331 |
+
if dtype is None:
|
| 332 |
+
return np.asarray(obj)
|
| 333 |
+
|
| 334 |
+
return extract_array(obj, extract_numpy=True)
|
| 335 |
+
|
| 336 |
+
|
| 337 |
+
class SubclassedSeries(Series):
|
| 338 |
+
_metadata = ["testattr", "name"]
|
| 339 |
+
|
| 340 |
+
@property
|
| 341 |
+
def _constructor(self):
|
| 342 |
+
# For testing, those properties return a generic callable, and not
|
| 343 |
+
# the actual class. In this case that is equivalent, but it is to
|
| 344 |
+
# ensure we don't rely on the property returning a class
|
| 345 |
+
# See https://github.com/pandas-dev/pandas/pull/46018 and
|
| 346 |
+
# https://github.com/pandas-dev/pandas/issues/32638 and linked issues
|
| 347 |
+
return lambda *args, **kwargs: SubclassedSeries(*args, **kwargs)
|
| 348 |
+
|
| 349 |
+
@property
|
| 350 |
+
def _constructor_expanddim(self):
|
| 351 |
+
return lambda *args, **kwargs: SubclassedDataFrame(*args, **kwargs)
|
| 352 |
+
|
| 353 |
+
|
| 354 |
+
class SubclassedDataFrame(DataFrame):
|
| 355 |
+
_metadata = ["testattr"]
|
| 356 |
+
|
| 357 |
+
@property
|
| 358 |
+
def _constructor(self):
|
| 359 |
+
return lambda *args, **kwargs: SubclassedDataFrame(*args, **kwargs)
|
| 360 |
+
|
| 361 |
+
@property
|
| 362 |
+
def _constructor_sliced(self):
|
| 363 |
+
return lambda *args, **kwargs: SubclassedSeries(*args, **kwargs)
|
| 364 |
+
|
| 365 |
+
|
| 366 |
+
def convert_rows_list_to_csv_str(rows_list: list[str]) -> str:
|
| 367 |
+
"""
|
| 368 |
+
Convert list of CSV rows to single CSV-formatted string for current OS.
|
| 369 |
+
|
| 370 |
+
This method is used for creating expected value of to_csv() method.
|
| 371 |
+
|
| 372 |
+
Parameters
|
| 373 |
+
----------
|
| 374 |
+
rows_list : List[str]
|
| 375 |
+
Each element represents the row of csv.
|
| 376 |
+
|
| 377 |
+
Returns
|
| 378 |
+
-------
|
| 379 |
+
str
|
| 380 |
+
Expected output of to_csv() in current OS.
|
| 381 |
+
"""
|
| 382 |
+
sep = os.linesep
|
| 383 |
+
return sep.join(rows_list) + sep
|
| 384 |
+
|
| 385 |
+
|
| 386 |
+
def external_error_raised(expected_exception: type[Exception]) -> ContextManager:
|
| 387 |
+
"""
|
| 388 |
+
Helper function to mark pytest.raises that have an external error message.
|
| 389 |
+
|
| 390 |
+
Parameters
|
| 391 |
+
----------
|
| 392 |
+
expected_exception : Exception
|
| 393 |
+
Expected error to raise.
|
| 394 |
+
|
| 395 |
+
Returns
|
| 396 |
+
-------
|
| 397 |
+
Callable
|
| 398 |
+
Regular `pytest.raises` function with `match` equal to `None`.
|
| 399 |
+
"""
|
| 400 |
+
import pytest
|
| 401 |
+
|
| 402 |
+
return pytest.raises(expected_exception, match=None)
|
| 403 |
+
|
| 404 |
+
|
| 405 |
+
cython_table = pd.core.common._cython_table.items()
|
| 406 |
+
|
| 407 |
+
|
| 408 |
+
def get_cython_table_params(ndframe, func_names_and_expected):
|
| 409 |
+
"""
|
| 410 |
+
Combine frame, functions from com._cython_table
|
| 411 |
+
keys and expected result.
|
| 412 |
+
|
| 413 |
+
Parameters
|
| 414 |
+
----------
|
| 415 |
+
ndframe : DataFrame or Series
|
| 416 |
+
func_names_and_expected : Sequence of two items
|
| 417 |
+
The first item is a name of a NDFrame method ('sum', 'prod') etc.
|
| 418 |
+
The second item is the expected return value.
|
| 419 |
+
|
| 420 |
+
Returns
|
| 421 |
+
-------
|
| 422 |
+
list
|
| 423 |
+
List of three items (DataFrame, function, expected result)
|
| 424 |
+
"""
|
| 425 |
+
results = []
|
| 426 |
+
for func_name, expected in func_names_and_expected:
|
| 427 |
+
results.append((ndframe, func_name, expected))
|
| 428 |
+
results += [
|
| 429 |
+
(ndframe, func, expected)
|
| 430 |
+
for func, name in cython_table
|
| 431 |
+
if name == func_name
|
| 432 |
+
]
|
| 433 |
+
return results
|
| 434 |
+
|
| 435 |
+
|
| 436 |
+
def get_op_from_name(op_name: str) -> Callable:
|
| 437 |
+
"""
|
| 438 |
+
The operator function for a given op name.
|
| 439 |
+
|
| 440 |
+
Parameters
|
| 441 |
+
----------
|
| 442 |
+
op_name : str
|
| 443 |
+
The op name, in form of "add" or "__add__".
|
| 444 |
+
|
| 445 |
+
Returns
|
| 446 |
+
-------
|
| 447 |
+
function
|
| 448 |
+
A function performing the operation.
|
| 449 |
+
"""
|
| 450 |
+
short_opname = op_name.strip("_")
|
| 451 |
+
try:
|
| 452 |
+
op = getattr(operator, short_opname)
|
| 453 |
+
except AttributeError:
|
| 454 |
+
# Assume it is the reverse operator
|
| 455 |
+
rop = getattr(operator, short_opname[1:])
|
| 456 |
+
op = lambda x, y: rop(y, x)
|
| 457 |
+
|
| 458 |
+
return op
|
| 459 |
+
|
| 460 |
+
|
| 461 |
+
# -----------------------------------------------------------------------------
|
| 462 |
+
# Indexing test helpers
|
| 463 |
+
|
| 464 |
+
|
| 465 |
+
def getitem(x):
|
| 466 |
+
return x
|
| 467 |
+
|
| 468 |
+
|
| 469 |
+
def setitem(x):
|
| 470 |
+
return x
|
| 471 |
+
|
| 472 |
+
|
| 473 |
+
def loc(x):
|
| 474 |
+
return x.loc
|
| 475 |
+
|
| 476 |
+
|
| 477 |
+
def iloc(x):
|
| 478 |
+
return x.iloc
|
| 479 |
+
|
| 480 |
+
|
| 481 |
+
def at(x):
|
| 482 |
+
return x.at
|
| 483 |
+
|
| 484 |
+
|
| 485 |
+
def iat(x):
|
| 486 |
+
return x.iat
|
| 487 |
+
|
| 488 |
+
|
| 489 |
+
# -----------------------------------------------------------------------------
|
| 490 |
+
|
| 491 |
+
_UNITS = ["s", "ms", "us", "ns"]
|
| 492 |
+
|
| 493 |
+
|
| 494 |
+
def get_finest_unit(left: str, right: str):
|
| 495 |
+
"""
|
| 496 |
+
Find the higher of two datetime64 units.
|
| 497 |
+
"""
|
| 498 |
+
if _UNITS.index(left) >= _UNITS.index(right):
|
| 499 |
+
return left
|
| 500 |
+
return right
|
| 501 |
+
|
| 502 |
+
|
| 503 |
+
def shares_memory(left, right) -> bool:
|
| 504 |
+
"""
|
| 505 |
+
Pandas-compat for np.shares_memory.
|
| 506 |
+
"""
|
| 507 |
+
if isinstance(left, np.ndarray) and isinstance(right, np.ndarray):
|
| 508 |
+
return np.shares_memory(left, right)
|
| 509 |
+
elif isinstance(left, np.ndarray):
|
| 510 |
+
# Call with reversed args to get to unpacking logic below.
|
| 511 |
+
return shares_memory(right, left)
|
| 512 |
+
|
| 513 |
+
if isinstance(left, RangeIndex):
|
| 514 |
+
return False
|
| 515 |
+
if isinstance(left, MultiIndex):
|
| 516 |
+
return shares_memory(left._codes, right)
|
| 517 |
+
if isinstance(left, (Index, Series)):
|
| 518 |
+
if isinstance(right, (Index, Series)):
|
| 519 |
+
return shares_memory(left._values, right._values)
|
| 520 |
+
return shares_memory(left._values, right)
|
| 521 |
+
|
| 522 |
+
if isinstance(left, NDArrayBackedExtensionArray):
|
| 523 |
+
return shares_memory(left._ndarray, right)
|
| 524 |
+
if isinstance(left, pd.core.arrays.SparseArray):
|
| 525 |
+
return shares_memory(left.sp_values, right)
|
| 526 |
+
if isinstance(left, pd.core.arrays.IntervalArray):
|
| 527 |
+
return shares_memory(left._left, right) or shares_memory(left._right, right)
|
| 528 |
+
|
| 529 |
+
if isinstance(left, ArrowExtensionArray):
|
| 530 |
+
if isinstance(right, ArrowExtensionArray):
|
| 531 |
+
# https://github.com/pandas-dev/pandas/pull/43930#discussion_r736862669
|
| 532 |
+
left_pa_data = left._pa_array
|
| 533 |
+
right_pa_data = right._pa_array
|
| 534 |
+
left_buf1 = left_pa_data.chunk(0).buffers()[1]
|
| 535 |
+
right_buf1 = right_pa_data.chunk(0).buffers()[1]
|
| 536 |
+
return left_buf1.address == right_buf1.address
|
| 537 |
+
else:
|
| 538 |
+
# if we have one one ArrowExtensionArray and one other array, assume
|
| 539 |
+
# they can only share memory if they share the same numpy buffer
|
| 540 |
+
return np.shares_memory(left, right)
|
| 541 |
+
|
| 542 |
+
if isinstance(left, BaseMaskedArray) and isinstance(right, BaseMaskedArray):
|
| 543 |
+
# By convention, we'll say these share memory if they share *either*
|
| 544 |
+
# the _data or the _mask
|
| 545 |
+
return np.shares_memory(left._data, right._data) or np.shares_memory(
|
| 546 |
+
left._mask, right._mask
|
| 547 |
+
)
|
| 548 |
+
|
| 549 |
+
if isinstance(left, DataFrame) and len(left._mgr.arrays) == 1:
|
| 550 |
+
arr = left._mgr.arrays[0]
|
| 551 |
+
return shares_memory(arr, right)
|
| 552 |
+
|
| 553 |
+
raise NotImplementedError(type(left), type(right))
|
| 554 |
+
|
| 555 |
+
|
| 556 |
+
__all__ = [
|
| 557 |
+
"ALL_INT_EA_DTYPES",
|
| 558 |
+
"ALL_INT_NUMPY_DTYPES",
|
| 559 |
+
"ALL_NUMPY_DTYPES",
|
| 560 |
+
"ALL_REAL_NUMPY_DTYPES",
|
| 561 |
+
"assert_almost_equal",
|
| 562 |
+
"assert_attr_equal",
|
| 563 |
+
"assert_categorical_equal",
|
| 564 |
+
"assert_class_equal",
|
| 565 |
+
"assert_contains_all",
|
| 566 |
+
"assert_copy",
|
| 567 |
+
"assert_datetime_array_equal",
|
| 568 |
+
"assert_dict_equal",
|
| 569 |
+
"assert_equal",
|
| 570 |
+
"assert_extension_array_equal",
|
| 571 |
+
"assert_frame_equal",
|
| 572 |
+
"assert_index_equal",
|
| 573 |
+
"assert_indexing_slices_equivalent",
|
| 574 |
+
"assert_interval_array_equal",
|
| 575 |
+
"assert_is_sorted",
|
| 576 |
+
"assert_is_valid_plot_return_object",
|
| 577 |
+
"assert_metadata_equivalent",
|
| 578 |
+
"assert_numpy_array_equal",
|
| 579 |
+
"assert_period_array_equal",
|
| 580 |
+
"assert_produces_warning",
|
| 581 |
+
"assert_series_equal",
|
| 582 |
+
"assert_sp_array_equal",
|
| 583 |
+
"assert_timedelta_array_equal",
|
| 584 |
+
"assert_cow_warning",
|
| 585 |
+
"at",
|
| 586 |
+
"BOOL_DTYPES",
|
| 587 |
+
"box_expected",
|
| 588 |
+
"BYTES_DTYPES",
|
| 589 |
+
"can_set_locale",
|
| 590 |
+
"COMPLEX_DTYPES",
|
| 591 |
+
"convert_rows_list_to_csv_str",
|
| 592 |
+
"DATETIME64_DTYPES",
|
| 593 |
+
"decompress_file",
|
| 594 |
+
"ENDIAN",
|
| 595 |
+
"ensure_clean",
|
| 596 |
+
"external_error_raised",
|
| 597 |
+
"FLOAT_EA_DTYPES",
|
| 598 |
+
"FLOAT_NUMPY_DTYPES",
|
| 599 |
+
"get_cython_table_params",
|
| 600 |
+
"get_dtype",
|
| 601 |
+
"getitem",
|
| 602 |
+
"get_locales",
|
| 603 |
+
"get_finest_unit",
|
| 604 |
+
"get_obj",
|
| 605 |
+
"get_op_from_name",
|
| 606 |
+
"iat",
|
| 607 |
+
"iloc",
|
| 608 |
+
"loc",
|
| 609 |
+
"maybe_produces_warning",
|
| 610 |
+
"NARROW_NP_DTYPES",
|
| 611 |
+
"NP_NAT_OBJECTS",
|
| 612 |
+
"NULL_OBJECTS",
|
| 613 |
+
"OBJECT_DTYPES",
|
| 614 |
+
"raise_assert_detail",
|
| 615 |
+
"raises_chained_assignment_error",
|
| 616 |
+
"round_trip_localpath",
|
| 617 |
+
"round_trip_pathlib",
|
| 618 |
+
"round_trip_pickle",
|
| 619 |
+
"setitem",
|
| 620 |
+
"set_locale",
|
| 621 |
+
"set_timezone",
|
| 622 |
+
"shares_memory",
|
| 623 |
+
"SIGNED_INT_EA_DTYPES",
|
| 624 |
+
"SIGNED_INT_NUMPY_DTYPES",
|
| 625 |
+
"STRING_DTYPES",
|
| 626 |
+
"SubclassedDataFrame",
|
| 627 |
+
"SubclassedSeries",
|
| 628 |
+
"TIMEDELTA64_DTYPES",
|
| 629 |
+
"to_array",
|
| 630 |
+
"UNSIGNED_INT_EA_DTYPES",
|
| 631 |
+
"UNSIGNED_INT_NUMPY_DTYPES",
|
| 632 |
+
"use_numexpr",
|
| 633 |
+
"with_csv_dialect",
|
| 634 |
+
"write_to_compressed",
|
| 635 |
+
]
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_testing/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (14.2 kB). View file
|
|
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_testing/__pycache__/_io.cpython-310.pyc
ADDED
|
Binary file (4.44 kB). View file
|
|
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_testing/__pycache__/_warnings.cpython-310.pyc
ADDED
|
Binary file (6.56 kB). View file
|
|
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_testing/__pycache__/asserters.cpython-310.pyc
ADDED
|
Binary file (33.6 kB). View file
|
|
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_testing/__pycache__/compat.cpython-310.pyc
ADDED
|
Binary file (999 Bytes). View file
|
|
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_testing/__pycache__/contexts.cpython-310.pyc
ADDED
|
Binary file (6.38 kB). View file
|
|
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_testing/_hypothesis.py
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Hypothesis data generator helpers.
|
| 3 |
+
"""
|
| 4 |
+
from datetime import datetime
|
| 5 |
+
|
| 6 |
+
from hypothesis import strategies as st
|
| 7 |
+
from hypothesis.extra.dateutil import timezones as dateutil_timezones
|
| 8 |
+
from hypothesis.extra.pytz import timezones as pytz_timezones
|
| 9 |
+
|
| 10 |
+
from pandas.compat import is_platform_windows
|
| 11 |
+
|
| 12 |
+
import pandas as pd
|
| 13 |
+
|
| 14 |
+
from pandas.tseries.offsets import (
|
| 15 |
+
BMonthBegin,
|
| 16 |
+
BMonthEnd,
|
| 17 |
+
BQuarterBegin,
|
| 18 |
+
BQuarterEnd,
|
| 19 |
+
BYearBegin,
|
| 20 |
+
BYearEnd,
|
| 21 |
+
MonthBegin,
|
| 22 |
+
MonthEnd,
|
| 23 |
+
QuarterBegin,
|
| 24 |
+
QuarterEnd,
|
| 25 |
+
YearBegin,
|
| 26 |
+
YearEnd,
|
| 27 |
+
)
|
| 28 |
+
|
| 29 |
+
OPTIONAL_INTS = st.lists(st.one_of(st.integers(), st.none()), max_size=10, min_size=3)
|
| 30 |
+
|
| 31 |
+
OPTIONAL_FLOATS = st.lists(st.one_of(st.floats(), st.none()), max_size=10, min_size=3)
|
| 32 |
+
|
| 33 |
+
OPTIONAL_TEXT = st.lists(st.one_of(st.none(), st.text()), max_size=10, min_size=3)
|
| 34 |
+
|
| 35 |
+
OPTIONAL_DICTS = st.lists(
|
| 36 |
+
st.one_of(st.none(), st.dictionaries(st.text(), st.integers())),
|
| 37 |
+
max_size=10,
|
| 38 |
+
min_size=3,
|
| 39 |
+
)
|
| 40 |
+
|
| 41 |
+
OPTIONAL_LISTS = st.lists(
|
| 42 |
+
st.one_of(st.none(), st.lists(st.text(), max_size=10, min_size=3)),
|
| 43 |
+
max_size=10,
|
| 44 |
+
min_size=3,
|
| 45 |
+
)
|
| 46 |
+
|
| 47 |
+
OPTIONAL_ONE_OF_ALL = st.one_of(
|
| 48 |
+
OPTIONAL_DICTS, OPTIONAL_FLOATS, OPTIONAL_INTS, OPTIONAL_LISTS, OPTIONAL_TEXT
|
| 49 |
+
)
|
| 50 |
+
|
| 51 |
+
if is_platform_windows():
|
| 52 |
+
DATETIME_NO_TZ = st.datetimes(min_value=datetime(1900, 1, 1))
|
| 53 |
+
else:
|
| 54 |
+
DATETIME_NO_TZ = st.datetimes()
|
| 55 |
+
|
| 56 |
+
DATETIME_JAN_1_1900_OPTIONAL_TZ = st.datetimes(
|
| 57 |
+
min_value=pd.Timestamp(
|
| 58 |
+
1900, 1, 1
|
| 59 |
+
).to_pydatetime(), # pyright: ignore[reportGeneralTypeIssues]
|
| 60 |
+
max_value=pd.Timestamp(
|
| 61 |
+
1900, 1, 1
|
| 62 |
+
).to_pydatetime(), # pyright: ignore[reportGeneralTypeIssues]
|
| 63 |
+
timezones=st.one_of(st.none(), dateutil_timezones(), pytz_timezones()),
|
| 64 |
+
)
|
| 65 |
+
|
| 66 |
+
DATETIME_IN_PD_TIMESTAMP_RANGE_NO_TZ = st.datetimes(
|
| 67 |
+
min_value=pd.Timestamp.min.to_pydatetime(warn=False),
|
| 68 |
+
max_value=pd.Timestamp.max.to_pydatetime(warn=False),
|
| 69 |
+
)
|
| 70 |
+
|
| 71 |
+
INT_NEG_999_TO_POS_999 = st.integers(-999, 999)
|
| 72 |
+
|
| 73 |
+
# The strategy for each type is registered in conftest.py, as they don't carry
|
| 74 |
+
# enough runtime information (e.g. type hints) to infer how to build them.
|
| 75 |
+
YQM_OFFSET = st.one_of(
|
| 76 |
+
*map(
|
| 77 |
+
st.from_type,
|
| 78 |
+
[
|
| 79 |
+
MonthBegin,
|
| 80 |
+
MonthEnd,
|
| 81 |
+
BMonthBegin,
|
| 82 |
+
BMonthEnd,
|
| 83 |
+
QuarterBegin,
|
| 84 |
+
QuarterEnd,
|
| 85 |
+
BQuarterBegin,
|
| 86 |
+
BQuarterEnd,
|
| 87 |
+
YearBegin,
|
| 88 |
+
YearEnd,
|
| 89 |
+
BYearBegin,
|
| 90 |
+
BYearEnd,
|
| 91 |
+
],
|
| 92 |
+
)
|
| 93 |
+
)
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_testing/_io.py
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
import gzip
|
| 4 |
+
import io
|
| 5 |
+
import pathlib
|
| 6 |
+
import tarfile
|
| 7 |
+
from typing import (
|
| 8 |
+
TYPE_CHECKING,
|
| 9 |
+
Any,
|
| 10 |
+
Callable,
|
| 11 |
+
)
|
| 12 |
+
import uuid
|
| 13 |
+
import zipfile
|
| 14 |
+
|
| 15 |
+
from pandas.compat import (
|
| 16 |
+
get_bz2_file,
|
| 17 |
+
get_lzma_file,
|
| 18 |
+
)
|
| 19 |
+
from pandas.compat._optional import import_optional_dependency
|
| 20 |
+
|
| 21 |
+
import pandas as pd
|
| 22 |
+
from pandas._testing.contexts import ensure_clean
|
| 23 |
+
|
| 24 |
+
if TYPE_CHECKING:
|
| 25 |
+
from pandas._typing import (
|
| 26 |
+
FilePath,
|
| 27 |
+
ReadPickleBuffer,
|
| 28 |
+
)
|
| 29 |
+
|
| 30 |
+
from pandas import (
|
| 31 |
+
DataFrame,
|
| 32 |
+
Series,
|
| 33 |
+
)
|
| 34 |
+
|
| 35 |
+
# ------------------------------------------------------------------
|
| 36 |
+
# File-IO
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
def round_trip_pickle(
|
| 40 |
+
obj: Any, path: FilePath | ReadPickleBuffer | None = None
|
| 41 |
+
) -> DataFrame | Series:
|
| 42 |
+
"""
|
| 43 |
+
Pickle an object and then read it again.
|
| 44 |
+
|
| 45 |
+
Parameters
|
| 46 |
+
----------
|
| 47 |
+
obj : any object
|
| 48 |
+
The object to pickle and then re-read.
|
| 49 |
+
path : str, path object or file-like object, default None
|
| 50 |
+
The path where the pickled object is written and then read.
|
| 51 |
+
|
| 52 |
+
Returns
|
| 53 |
+
-------
|
| 54 |
+
pandas object
|
| 55 |
+
The original object that was pickled and then re-read.
|
| 56 |
+
"""
|
| 57 |
+
_path = path
|
| 58 |
+
if _path is None:
|
| 59 |
+
_path = f"__{uuid.uuid4()}__.pickle"
|
| 60 |
+
with ensure_clean(_path) as temp_path:
|
| 61 |
+
pd.to_pickle(obj, temp_path)
|
| 62 |
+
return pd.read_pickle(temp_path)
|
| 63 |
+
|
| 64 |
+
|
| 65 |
+
def round_trip_pathlib(writer, reader, path: str | None = None):
|
| 66 |
+
"""
|
| 67 |
+
Write an object to file specified by a pathlib.Path and read it back
|
| 68 |
+
|
| 69 |
+
Parameters
|
| 70 |
+
----------
|
| 71 |
+
writer : callable bound to pandas object
|
| 72 |
+
IO writing function (e.g. DataFrame.to_csv )
|
| 73 |
+
reader : callable
|
| 74 |
+
IO reading function (e.g. pd.read_csv )
|
| 75 |
+
path : str, default None
|
| 76 |
+
The path where the object is written and then read.
|
| 77 |
+
|
| 78 |
+
Returns
|
| 79 |
+
-------
|
| 80 |
+
pandas object
|
| 81 |
+
The original object that was serialized and then re-read.
|
| 82 |
+
"""
|
| 83 |
+
Path = pathlib.Path
|
| 84 |
+
if path is None:
|
| 85 |
+
path = "___pathlib___"
|
| 86 |
+
with ensure_clean(path) as path:
|
| 87 |
+
writer(Path(path)) # type: ignore[arg-type]
|
| 88 |
+
obj = reader(Path(path)) # type: ignore[arg-type]
|
| 89 |
+
return obj
|
| 90 |
+
|
| 91 |
+
|
| 92 |
+
def round_trip_localpath(writer, reader, path: str | None = None):
|
| 93 |
+
"""
|
| 94 |
+
Write an object to file specified by a py.path LocalPath and read it back.
|
| 95 |
+
|
| 96 |
+
Parameters
|
| 97 |
+
----------
|
| 98 |
+
writer : callable bound to pandas object
|
| 99 |
+
IO writing function (e.g. DataFrame.to_csv )
|
| 100 |
+
reader : callable
|
| 101 |
+
IO reading function (e.g. pd.read_csv )
|
| 102 |
+
path : str, default None
|
| 103 |
+
The path where the object is written and then read.
|
| 104 |
+
|
| 105 |
+
Returns
|
| 106 |
+
-------
|
| 107 |
+
pandas object
|
| 108 |
+
The original object that was serialized and then re-read.
|
| 109 |
+
"""
|
| 110 |
+
import pytest
|
| 111 |
+
|
| 112 |
+
LocalPath = pytest.importorskip("py.path").local
|
| 113 |
+
if path is None:
|
| 114 |
+
path = "___localpath___"
|
| 115 |
+
with ensure_clean(path) as path:
|
| 116 |
+
writer(LocalPath(path))
|
| 117 |
+
obj = reader(LocalPath(path))
|
| 118 |
+
return obj
|
| 119 |
+
|
| 120 |
+
|
| 121 |
+
def write_to_compressed(compression, path, data, dest: str = "test") -> None:
|
| 122 |
+
"""
|
| 123 |
+
Write data to a compressed file.
|
| 124 |
+
|
| 125 |
+
Parameters
|
| 126 |
+
----------
|
| 127 |
+
compression : {'gzip', 'bz2', 'zip', 'xz', 'zstd'}
|
| 128 |
+
The compression type to use.
|
| 129 |
+
path : str
|
| 130 |
+
The file path to write the data.
|
| 131 |
+
data : str
|
| 132 |
+
The data to write.
|
| 133 |
+
dest : str, default "test"
|
| 134 |
+
The destination file (for ZIP only)
|
| 135 |
+
|
| 136 |
+
Raises
|
| 137 |
+
------
|
| 138 |
+
ValueError : An invalid compression value was passed in.
|
| 139 |
+
"""
|
| 140 |
+
args: tuple[Any, ...] = (data,)
|
| 141 |
+
mode = "wb"
|
| 142 |
+
method = "write"
|
| 143 |
+
compress_method: Callable
|
| 144 |
+
|
| 145 |
+
if compression == "zip":
|
| 146 |
+
compress_method = zipfile.ZipFile
|
| 147 |
+
mode = "w"
|
| 148 |
+
args = (dest, data)
|
| 149 |
+
method = "writestr"
|
| 150 |
+
elif compression == "tar":
|
| 151 |
+
compress_method = tarfile.TarFile
|
| 152 |
+
mode = "w"
|
| 153 |
+
file = tarfile.TarInfo(name=dest)
|
| 154 |
+
bytes = io.BytesIO(data)
|
| 155 |
+
file.size = len(data)
|
| 156 |
+
args = (file, bytes)
|
| 157 |
+
method = "addfile"
|
| 158 |
+
elif compression == "gzip":
|
| 159 |
+
compress_method = gzip.GzipFile
|
| 160 |
+
elif compression == "bz2":
|
| 161 |
+
compress_method = get_bz2_file()
|
| 162 |
+
elif compression == "zstd":
|
| 163 |
+
compress_method = import_optional_dependency("zstandard").open
|
| 164 |
+
elif compression == "xz":
|
| 165 |
+
compress_method = get_lzma_file()
|
| 166 |
+
else:
|
| 167 |
+
raise ValueError(f"Unrecognized compression type: {compression}")
|
| 168 |
+
|
| 169 |
+
with compress_method(path, mode=mode) as f:
|
| 170 |
+
getattr(f, method)(*args)
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_testing/_warnings.py
ADDED
|
@@ -0,0 +1,232 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
from contextlib import (
|
| 4 |
+
contextmanager,
|
| 5 |
+
nullcontext,
|
| 6 |
+
)
|
| 7 |
+
import inspect
|
| 8 |
+
import re
|
| 9 |
+
import sys
|
| 10 |
+
from typing import (
|
| 11 |
+
TYPE_CHECKING,
|
| 12 |
+
Literal,
|
| 13 |
+
cast,
|
| 14 |
+
)
|
| 15 |
+
import warnings
|
| 16 |
+
|
| 17 |
+
from pandas.compat import PY311
|
| 18 |
+
|
| 19 |
+
if TYPE_CHECKING:
|
| 20 |
+
from collections.abc import (
|
| 21 |
+
Generator,
|
| 22 |
+
Sequence,
|
| 23 |
+
)
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
@contextmanager
|
| 27 |
+
def assert_produces_warning(
|
| 28 |
+
expected_warning: type[Warning] | bool | tuple[type[Warning], ...] | None = Warning,
|
| 29 |
+
filter_level: Literal[
|
| 30 |
+
"error", "ignore", "always", "default", "module", "once"
|
| 31 |
+
] = "always",
|
| 32 |
+
check_stacklevel: bool = True,
|
| 33 |
+
raise_on_extra_warnings: bool = True,
|
| 34 |
+
match: str | None = None,
|
| 35 |
+
) -> Generator[list[warnings.WarningMessage], None, None]:
|
| 36 |
+
"""
|
| 37 |
+
Context manager for running code expected to either raise a specific warning,
|
| 38 |
+
multiple specific warnings, or not raise any warnings. Verifies that the code
|
| 39 |
+
raises the expected warning(s), and that it does not raise any other unexpected
|
| 40 |
+
warnings. It is basically a wrapper around ``warnings.catch_warnings``.
|
| 41 |
+
|
| 42 |
+
Parameters
|
| 43 |
+
----------
|
| 44 |
+
expected_warning : {Warning, False, tuple[Warning, ...], None}, default Warning
|
| 45 |
+
The type of Exception raised. ``exception.Warning`` is the base
|
| 46 |
+
class for all warnings. To raise multiple types of exceptions,
|
| 47 |
+
pass them as a tuple. To check that no warning is returned,
|
| 48 |
+
specify ``False`` or ``None``.
|
| 49 |
+
filter_level : str or None, default "always"
|
| 50 |
+
Specifies whether warnings are ignored, displayed, or turned
|
| 51 |
+
into errors.
|
| 52 |
+
Valid values are:
|
| 53 |
+
|
| 54 |
+
* "error" - turns matching warnings into exceptions
|
| 55 |
+
* "ignore" - discard the warning
|
| 56 |
+
* "always" - always emit a warning
|
| 57 |
+
* "default" - print the warning the first time it is generated
|
| 58 |
+
from each location
|
| 59 |
+
* "module" - print the warning the first time it is generated
|
| 60 |
+
from each module
|
| 61 |
+
* "once" - print the warning the first time it is generated
|
| 62 |
+
|
| 63 |
+
check_stacklevel : bool, default True
|
| 64 |
+
If True, displays the line that called the function containing
|
| 65 |
+
the warning to show were the function is called. Otherwise, the
|
| 66 |
+
line that implements the function is displayed.
|
| 67 |
+
raise_on_extra_warnings : bool, default True
|
| 68 |
+
Whether extra warnings not of the type `expected_warning` should
|
| 69 |
+
cause the test to fail.
|
| 70 |
+
match : str, optional
|
| 71 |
+
Match warning message.
|
| 72 |
+
|
| 73 |
+
Examples
|
| 74 |
+
--------
|
| 75 |
+
>>> import warnings
|
| 76 |
+
>>> with assert_produces_warning():
|
| 77 |
+
... warnings.warn(UserWarning())
|
| 78 |
+
...
|
| 79 |
+
>>> with assert_produces_warning(False):
|
| 80 |
+
... warnings.warn(RuntimeWarning())
|
| 81 |
+
...
|
| 82 |
+
Traceback (most recent call last):
|
| 83 |
+
...
|
| 84 |
+
AssertionError: Caused unexpected warning(s): ['RuntimeWarning'].
|
| 85 |
+
>>> with assert_produces_warning(UserWarning):
|
| 86 |
+
... warnings.warn(RuntimeWarning())
|
| 87 |
+
Traceback (most recent call last):
|
| 88 |
+
...
|
| 89 |
+
AssertionError: Did not see expected warning of class 'UserWarning'.
|
| 90 |
+
|
| 91 |
+
..warn:: This is *not* thread-safe.
|
| 92 |
+
"""
|
| 93 |
+
__tracebackhide__ = True
|
| 94 |
+
|
| 95 |
+
with warnings.catch_warnings(record=True) as w:
|
| 96 |
+
warnings.simplefilter(filter_level)
|
| 97 |
+
try:
|
| 98 |
+
yield w
|
| 99 |
+
finally:
|
| 100 |
+
if expected_warning:
|
| 101 |
+
expected_warning = cast(type[Warning], expected_warning)
|
| 102 |
+
_assert_caught_expected_warning(
|
| 103 |
+
caught_warnings=w,
|
| 104 |
+
expected_warning=expected_warning,
|
| 105 |
+
match=match,
|
| 106 |
+
check_stacklevel=check_stacklevel,
|
| 107 |
+
)
|
| 108 |
+
if raise_on_extra_warnings:
|
| 109 |
+
_assert_caught_no_extra_warnings(
|
| 110 |
+
caught_warnings=w,
|
| 111 |
+
expected_warning=expected_warning,
|
| 112 |
+
)
|
| 113 |
+
|
| 114 |
+
|
| 115 |
+
def maybe_produces_warning(warning: type[Warning], condition: bool, **kwargs):
|
| 116 |
+
"""
|
| 117 |
+
Return a context manager that possibly checks a warning based on the condition
|
| 118 |
+
"""
|
| 119 |
+
if condition:
|
| 120 |
+
return assert_produces_warning(warning, **kwargs)
|
| 121 |
+
else:
|
| 122 |
+
return nullcontext()
|
| 123 |
+
|
| 124 |
+
|
| 125 |
+
def _assert_caught_expected_warning(
|
| 126 |
+
*,
|
| 127 |
+
caught_warnings: Sequence[warnings.WarningMessage],
|
| 128 |
+
expected_warning: type[Warning],
|
| 129 |
+
match: str | None,
|
| 130 |
+
check_stacklevel: bool,
|
| 131 |
+
) -> None:
|
| 132 |
+
"""Assert that there was the expected warning among the caught warnings."""
|
| 133 |
+
saw_warning = False
|
| 134 |
+
matched_message = False
|
| 135 |
+
unmatched_messages = []
|
| 136 |
+
|
| 137 |
+
for actual_warning in caught_warnings:
|
| 138 |
+
if issubclass(actual_warning.category, expected_warning):
|
| 139 |
+
saw_warning = True
|
| 140 |
+
|
| 141 |
+
if check_stacklevel:
|
| 142 |
+
_assert_raised_with_correct_stacklevel(actual_warning)
|
| 143 |
+
|
| 144 |
+
if match is not None:
|
| 145 |
+
if re.search(match, str(actual_warning.message)):
|
| 146 |
+
matched_message = True
|
| 147 |
+
else:
|
| 148 |
+
unmatched_messages.append(actual_warning.message)
|
| 149 |
+
|
| 150 |
+
if not saw_warning:
|
| 151 |
+
raise AssertionError(
|
| 152 |
+
f"Did not see expected warning of class "
|
| 153 |
+
f"{repr(expected_warning.__name__)}"
|
| 154 |
+
)
|
| 155 |
+
|
| 156 |
+
if match and not matched_message:
|
| 157 |
+
raise AssertionError(
|
| 158 |
+
f"Did not see warning {repr(expected_warning.__name__)} "
|
| 159 |
+
f"matching '{match}'. The emitted warning messages are "
|
| 160 |
+
f"{unmatched_messages}"
|
| 161 |
+
)
|
| 162 |
+
|
| 163 |
+
|
| 164 |
+
def _assert_caught_no_extra_warnings(
|
| 165 |
+
*,
|
| 166 |
+
caught_warnings: Sequence[warnings.WarningMessage],
|
| 167 |
+
expected_warning: type[Warning] | bool | tuple[type[Warning], ...] | None,
|
| 168 |
+
) -> None:
|
| 169 |
+
"""Assert that no extra warnings apart from the expected ones are caught."""
|
| 170 |
+
extra_warnings = []
|
| 171 |
+
|
| 172 |
+
for actual_warning in caught_warnings:
|
| 173 |
+
if _is_unexpected_warning(actual_warning, expected_warning):
|
| 174 |
+
# GH#38630 pytest.filterwarnings does not suppress these.
|
| 175 |
+
if actual_warning.category == ResourceWarning:
|
| 176 |
+
# GH 44732: Don't make the CI flaky by filtering SSL-related
|
| 177 |
+
# ResourceWarning from dependencies
|
| 178 |
+
if "unclosed <ssl.SSLSocket" in str(actual_warning.message):
|
| 179 |
+
continue
|
| 180 |
+
# GH 44844: Matplotlib leaves font files open during the entire process
|
| 181 |
+
# upon import. Don't make CI flaky if ResourceWarning raised
|
| 182 |
+
# due to these open files.
|
| 183 |
+
if any("matplotlib" in mod for mod in sys.modules):
|
| 184 |
+
continue
|
| 185 |
+
if PY311 and actual_warning.category == EncodingWarning:
|
| 186 |
+
# EncodingWarnings are checked in the CI
|
| 187 |
+
# pyproject.toml errors on EncodingWarnings in pandas
|
| 188 |
+
# Ignore EncodingWarnings from other libraries
|
| 189 |
+
continue
|
| 190 |
+
extra_warnings.append(
|
| 191 |
+
(
|
| 192 |
+
actual_warning.category.__name__,
|
| 193 |
+
actual_warning.message,
|
| 194 |
+
actual_warning.filename,
|
| 195 |
+
actual_warning.lineno,
|
| 196 |
+
)
|
| 197 |
+
)
|
| 198 |
+
|
| 199 |
+
if extra_warnings:
|
| 200 |
+
raise AssertionError(f"Caused unexpected warning(s): {repr(extra_warnings)}")
|
| 201 |
+
|
| 202 |
+
|
| 203 |
+
def _is_unexpected_warning(
|
| 204 |
+
actual_warning: warnings.WarningMessage,
|
| 205 |
+
expected_warning: type[Warning] | bool | tuple[type[Warning], ...] | None,
|
| 206 |
+
) -> bool:
|
| 207 |
+
"""Check if the actual warning issued is unexpected."""
|
| 208 |
+
if actual_warning and not expected_warning:
|
| 209 |
+
return True
|
| 210 |
+
expected_warning = cast(type[Warning], expected_warning)
|
| 211 |
+
return bool(not issubclass(actual_warning.category, expected_warning))
|
| 212 |
+
|
| 213 |
+
|
| 214 |
+
def _assert_raised_with_correct_stacklevel(
|
| 215 |
+
actual_warning: warnings.WarningMessage,
|
| 216 |
+
) -> None:
|
| 217 |
+
# https://stackoverflow.com/questions/17407119/python-inspect-stack-is-slow
|
| 218 |
+
frame = inspect.currentframe()
|
| 219 |
+
for _ in range(4):
|
| 220 |
+
frame = frame.f_back # type: ignore[union-attr]
|
| 221 |
+
try:
|
| 222 |
+
caller_filename = inspect.getfile(frame) # type: ignore[arg-type]
|
| 223 |
+
finally:
|
| 224 |
+
# See note in
|
| 225 |
+
# https://docs.python.org/3/library/inspect.html#inspect.Traceback
|
| 226 |
+
del frame
|
| 227 |
+
msg = (
|
| 228 |
+
"Warning not set with correct stacklevel. "
|
| 229 |
+
f"File where warning is raised: {actual_warning.filename} != "
|
| 230 |
+
f"{caller_filename}. Warning message: {actual_warning.message}"
|
| 231 |
+
)
|
| 232 |
+
assert actual_warning.filename == caller_filename, msg
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_testing/asserters.py
ADDED
|
@@ -0,0 +1,1459 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
import operator
|
| 4 |
+
from typing import (
|
| 5 |
+
TYPE_CHECKING,
|
| 6 |
+
Literal,
|
| 7 |
+
NoReturn,
|
| 8 |
+
cast,
|
| 9 |
+
)
|
| 10 |
+
|
| 11 |
+
import numpy as np
|
| 12 |
+
|
| 13 |
+
from pandas._libs import lib
|
| 14 |
+
from pandas._libs.missing import is_matching_na
|
| 15 |
+
from pandas._libs.sparse import SparseIndex
|
| 16 |
+
import pandas._libs.testing as _testing
|
| 17 |
+
from pandas._libs.tslibs.np_datetime import compare_mismatched_resolutions
|
| 18 |
+
|
| 19 |
+
from pandas.core.dtypes.common import (
|
| 20 |
+
is_bool,
|
| 21 |
+
is_float_dtype,
|
| 22 |
+
is_integer_dtype,
|
| 23 |
+
is_number,
|
| 24 |
+
is_numeric_dtype,
|
| 25 |
+
needs_i8_conversion,
|
| 26 |
+
)
|
| 27 |
+
from pandas.core.dtypes.dtypes import (
|
| 28 |
+
CategoricalDtype,
|
| 29 |
+
DatetimeTZDtype,
|
| 30 |
+
ExtensionDtype,
|
| 31 |
+
NumpyEADtype,
|
| 32 |
+
)
|
| 33 |
+
from pandas.core.dtypes.missing import array_equivalent
|
| 34 |
+
|
| 35 |
+
import pandas as pd
|
| 36 |
+
from pandas import (
|
| 37 |
+
Categorical,
|
| 38 |
+
DataFrame,
|
| 39 |
+
DatetimeIndex,
|
| 40 |
+
Index,
|
| 41 |
+
IntervalDtype,
|
| 42 |
+
IntervalIndex,
|
| 43 |
+
MultiIndex,
|
| 44 |
+
PeriodIndex,
|
| 45 |
+
RangeIndex,
|
| 46 |
+
Series,
|
| 47 |
+
TimedeltaIndex,
|
| 48 |
+
)
|
| 49 |
+
from pandas.core.arrays import (
|
| 50 |
+
DatetimeArray,
|
| 51 |
+
ExtensionArray,
|
| 52 |
+
IntervalArray,
|
| 53 |
+
PeriodArray,
|
| 54 |
+
TimedeltaArray,
|
| 55 |
+
)
|
| 56 |
+
from pandas.core.arrays.datetimelike import DatetimeLikeArrayMixin
|
| 57 |
+
from pandas.core.arrays.string_ import StringDtype
|
| 58 |
+
from pandas.core.indexes.api import safe_sort_index
|
| 59 |
+
|
| 60 |
+
from pandas.io.formats.printing import pprint_thing
|
| 61 |
+
|
| 62 |
+
if TYPE_CHECKING:
|
| 63 |
+
from pandas._typing import DtypeObj
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
def assert_almost_equal(
|
| 67 |
+
left,
|
| 68 |
+
right,
|
| 69 |
+
check_dtype: bool | Literal["equiv"] = "equiv",
|
| 70 |
+
rtol: float = 1.0e-5,
|
| 71 |
+
atol: float = 1.0e-8,
|
| 72 |
+
**kwargs,
|
| 73 |
+
) -> None:
|
| 74 |
+
"""
|
| 75 |
+
Check that the left and right objects are approximately equal.
|
| 76 |
+
|
| 77 |
+
By approximately equal, we refer to objects that are numbers or that
|
| 78 |
+
contain numbers which may be equivalent to specific levels of precision.
|
| 79 |
+
|
| 80 |
+
Parameters
|
| 81 |
+
----------
|
| 82 |
+
left : object
|
| 83 |
+
right : object
|
| 84 |
+
check_dtype : bool or {'equiv'}, default 'equiv'
|
| 85 |
+
Check dtype if both a and b are the same type. If 'equiv' is passed in,
|
| 86 |
+
then `RangeIndex` and `Index` with int64 dtype are also considered
|
| 87 |
+
equivalent when doing type checking.
|
| 88 |
+
rtol : float, default 1e-5
|
| 89 |
+
Relative tolerance.
|
| 90 |
+
atol : float, default 1e-8
|
| 91 |
+
Absolute tolerance.
|
| 92 |
+
"""
|
| 93 |
+
if isinstance(left, Index):
|
| 94 |
+
assert_index_equal(
|
| 95 |
+
left,
|
| 96 |
+
right,
|
| 97 |
+
check_exact=False,
|
| 98 |
+
exact=check_dtype,
|
| 99 |
+
rtol=rtol,
|
| 100 |
+
atol=atol,
|
| 101 |
+
**kwargs,
|
| 102 |
+
)
|
| 103 |
+
|
| 104 |
+
elif isinstance(left, Series):
|
| 105 |
+
assert_series_equal(
|
| 106 |
+
left,
|
| 107 |
+
right,
|
| 108 |
+
check_exact=False,
|
| 109 |
+
check_dtype=check_dtype,
|
| 110 |
+
rtol=rtol,
|
| 111 |
+
atol=atol,
|
| 112 |
+
**kwargs,
|
| 113 |
+
)
|
| 114 |
+
|
| 115 |
+
elif isinstance(left, DataFrame):
|
| 116 |
+
assert_frame_equal(
|
| 117 |
+
left,
|
| 118 |
+
right,
|
| 119 |
+
check_exact=False,
|
| 120 |
+
check_dtype=check_dtype,
|
| 121 |
+
rtol=rtol,
|
| 122 |
+
atol=atol,
|
| 123 |
+
**kwargs,
|
| 124 |
+
)
|
| 125 |
+
|
| 126 |
+
else:
|
| 127 |
+
# Other sequences.
|
| 128 |
+
if check_dtype:
|
| 129 |
+
if is_number(left) and is_number(right):
|
| 130 |
+
# Do not compare numeric classes, like np.float64 and float.
|
| 131 |
+
pass
|
| 132 |
+
elif is_bool(left) and is_bool(right):
|
| 133 |
+
# Do not compare bool classes, like np.bool_ and bool.
|
| 134 |
+
pass
|
| 135 |
+
else:
|
| 136 |
+
if isinstance(left, np.ndarray) or isinstance(right, np.ndarray):
|
| 137 |
+
obj = "numpy array"
|
| 138 |
+
else:
|
| 139 |
+
obj = "Input"
|
| 140 |
+
assert_class_equal(left, right, obj=obj)
|
| 141 |
+
|
| 142 |
+
# if we have "equiv", this becomes True
|
| 143 |
+
_testing.assert_almost_equal(
|
| 144 |
+
left, right, check_dtype=bool(check_dtype), rtol=rtol, atol=atol, **kwargs
|
| 145 |
+
)
|
| 146 |
+
|
| 147 |
+
|
| 148 |
+
def _check_isinstance(left, right, cls) -> None:
|
| 149 |
+
"""
|
| 150 |
+
Helper method for our assert_* methods that ensures that
|
| 151 |
+
the two objects being compared have the right type before
|
| 152 |
+
proceeding with the comparison.
|
| 153 |
+
|
| 154 |
+
Parameters
|
| 155 |
+
----------
|
| 156 |
+
left : The first object being compared.
|
| 157 |
+
right : The second object being compared.
|
| 158 |
+
cls : The class type to check against.
|
| 159 |
+
|
| 160 |
+
Raises
|
| 161 |
+
------
|
| 162 |
+
AssertionError : Either `left` or `right` is not an instance of `cls`.
|
| 163 |
+
"""
|
| 164 |
+
cls_name = cls.__name__
|
| 165 |
+
|
| 166 |
+
if not isinstance(left, cls):
|
| 167 |
+
raise AssertionError(
|
| 168 |
+
f"{cls_name} Expected type {cls}, found {type(left)} instead"
|
| 169 |
+
)
|
| 170 |
+
if not isinstance(right, cls):
|
| 171 |
+
raise AssertionError(
|
| 172 |
+
f"{cls_name} Expected type {cls}, found {type(right)} instead"
|
| 173 |
+
)
|
| 174 |
+
|
| 175 |
+
|
| 176 |
+
def assert_dict_equal(left, right, compare_keys: bool = True) -> None:
|
| 177 |
+
_check_isinstance(left, right, dict)
|
| 178 |
+
_testing.assert_dict_equal(left, right, compare_keys=compare_keys)
|
| 179 |
+
|
| 180 |
+
|
| 181 |
+
def assert_index_equal(
|
| 182 |
+
left: Index,
|
| 183 |
+
right: Index,
|
| 184 |
+
exact: bool | str = "equiv",
|
| 185 |
+
check_names: bool = True,
|
| 186 |
+
check_exact: bool = True,
|
| 187 |
+
check_categorical: bool = True,
|
| 188 |
+
check_order: bool = True,
|
| 189 |
+
rtol: float = 1.0e-5,
|
| 190 |
+
atol: float = 1.0e-8,
|
| 191 |
+
obj: str = "Index",
|
| 192 |
+
) -> None:
|
| 193 |
+
"""
|
| 194 |
+
Check that left and right Index are equal.
|
| 195 |
+
|
| 196 |
+
Parameters
|
| 197 |
+
----------
|
| 198 |
+
left : Index
|
| 199 |
+
right : Index
|
| 200 |
+
exact : bool or {'equiv'}, default 'equiv'
|
| 201 |
+
Whether to check the Index class, dtype and inferred_type
|
| 202 |
+
are identical. If 'equiv', then RangeIndex can be substituted for
|
| 203 |
+
Index with an int64 dtype as well.
|
| 204 |
+
check_names : bool, default True
|
| 205 |
+
Whether to check the names attribute.
|
| 206 |
+
check_exact : bool, default True
|
| 207 |
+
Whether to compare number exactly.
|
| 208 |
+
check_categorical : bool, default True
|
| 209 |
+
Whether to compare internal Categorical exactly.
|
| 210 |
+
check_order : bool, default True
|
| 211 |
+
Whether to compare the order of index entries as well as their values.
|
| 212 |
+
If True, both indexes must contain the same elements, in the same order.
|
| 213 |
+
If False, both indexes must contain the same elements, but in any order.
|
| 214 |
+
rtol : float, default 1e-5
|
| 215 |
+
Relative tolerance. Only used when check_exact is False.
|
| 216 |
+
atol : float, default 1e-8
|
| 217 |
+
Absolute tolerance. Only used when check_exact is False.
|
| 218 |
+
obj : str, default 'Index'
|
| 219 |
+
Specify object name being compared, internally used to show appropriate
|
| 220 |
+
assertion message.
|
| 221 |
+
|
| 222 |
+
Examples
|
| 223 |
+
--------
|
| 224 |
+
>>> from pandas import testing as tm
|
| 225 |
+
>>> a = pd.Index([1, 2, 3])
|
| 226 |
+
>>> b = pd.Index([1, 2, 3])
|
| 227 |
+
>>> tm.assert_index_equal(a, b)
|
| 228 |
+
"""
|
| 229 |
+
__tracebackhide__ = True
|
| 230 |
+
|
| 231 |
+
def _check_types(left, right, obj: str = "Index") -> None:
|
| 232 |
+
if not exact:
|
| 233 |
+
return
|
| 234 |
+
|
| 235 |
+
assert_class_equal(left, right, exact=exact, obj=obj)
|
| 236 |
+
assert_attr_equal("inferred_type", left, right, obj=obj)
|
| 237 |
+
|
| 238 |
+
# Skip exact dtype checking when `check_categorical` is False
|
| 239 |
+
if isinstance(left.dtype, CategoricalDtype) and isinstance(
|
| 240 |
+
right.dtype, CategoricalDtype
|
| 241 |
+
):
|
| 242 |
+
if check_categorical:
|
| 243 |
+
assert_attr_equal("dtype", left, right, obj=obj)
|
| 244 |
+
assert_index_equal(left.categories, right.categories, exact=exact)
|
| 245 |
+
return
|
| 246 |
+
|
| 247 |
+
assert_attr_equal("dtype", left, right, obj=obj)
|
| 248 |
+
|
| 249 |
+
# instance validation
|
| 250 |
+
_check_isinstance(left, right, Index)
|
| 251 |
+
|
| 252 |
+
# class / dtype comparison
|
| 253 |
+
_check_types(left, right, obj=obj)
|
| 254 |
+
|
| 255 |
+
# level comparison
|
| 256 |
+
if left.nlevels != right.nlevels:
|
| 257 |
+
msg1 = f"{obj} levels are different"
|
| 258 |
+
msg2 = f"{left.nlevels}, {left}"
|
| 259 |
+
msg3 = f"{right.nlevels}, {right}"
|
| 260 |
+
raise_assert_detail(obj, msg1, msg2, msg3)
|
| 261 |
+
|
| 262 |
+
# length comparison
|
| 263 |
+
if len(left) != len(right):
|
| 264 |
+
msg1 = f"{obj} length are different"
|
| 265 |
+
msg2 = f"{len(left)}, {left}"
|
| 266 |
+
msg3 = f"{len(right)}, {right}"
|
| 267 |
+
raise_assert_detail(obj, msg1, msg2, msg3)
|
| 268 |
+
|
| 269 |
+
# If order doesn't matter then sort the index entries
|
| 270 |
+
if not check_order:
|
| 271 |
+
left = safe_sort_index(left)
|
| 272 |
+
right = safe_sort_index(right)
|
| 273 |
+
|
| 274 |
+
# MultiIndex special comparison for little-friendly error messages
|
| 275 |
+
if isinstance(left, MultiIndex):
|
| 276 |
+
right = cast(MultiIndex, right)
|
| 277 |
+
|
| 278 |
+
for level in range(left.nlevels):
|
| 279 |
+
lobj = f"MultiIndex level [{level}]"
|
| 280 |
+
try:
|
| 281 |
+
# try comparison on levels/codes to avoid densifying MultiIndex
|
| 282 |
+
assert_index_equal(
|
| 283 |
+
left.levels[level],
|
| 284 |
+
right.levels[level],
|
| 285 |
+
exact=exact,
|
| 286 |
+
check_names=check_names,
|
| 287 |
+
check_exact=check_exact,
|
| 288 |
+
check_categorical=check_categorical,
|
| 289 |
+
rtol=rtol,
|
| 290 |
+
atol=atol,
|
| 291 |
+
obj=lobj,
|
| 292 |
+
)
|
| 293 |
+
assert_numpy_array_equal(left.codes[level], right.codes[level])
|
| 294 |
+
except AssertionError:
|
| 295 |
+
llevel = left.get_level_values(level)
|
| 296 |
+
rlevel = right.get_level_values(level)
|
| 297 |
+
|
| 298 |
+
assert_index_equal(
|
| 299 |
+
llevel,
|
| 300 |
+
rlevel,
|
| 301 |
+
exact=exact,
|
| 302 |
+
check_names=check_names,
|
| 303 |
+
check_exact=check_exact,
|
| 304 |
+
check_categorical=check_categorical,
|
| 305 |
+
rtol=rtol,
|
| 306 |
+
atol=atol,
|
| 307 |
+
obj=lobj,
|
| 308 |
+
)
|
| 309 |
+
# get_level_values may change dtype
|
| 310 |
+
_check_types(left.levels[level], right.levels[level], obj=obj)
|
| 311 |
+
|
| 312 |
+
# skip exact index checking when `check_categorical` is False
|
| 313 |
+
elif check_exact and check_categorical:
|
| 314 |
+
if not left.equals(right):
|
| 315 |
+
mismatch = left._values != right._values
|
| 316 |
+
|
| 317 |
+
if not isinstance(mismatch, np.ndarray):
|
| 318 |
+
mismatch = cast("ExtensionArray", mismatch).fillna(True)
|
| 319 |
+
|
| 320 |
+
diff = np.sum(mismatch.astype(int)) * 100.0 / len(left)
|
| 321 |
+
msg = f"{obj} values are different ({np.round(diff, 5)} %)"
|
| 322 |
+
raise_assert_detail(obj, msg, left, right)
|
| 323 |
+
else:
|
| 324 |
+
# if we have "equiv", this becomes True
|
| 325 |
+
exact_bool = bool(exact)
|
| 326 |
+
_testing.assert_almost_equal(
|
| 327 |
+
left.values,
|
| 328 |
+
right.values,
|
| 329 |
+
rtol=rtol,
|
| 330 |
+
atol=atol,
|
| 331 |
+
check_dtype=exact_bool,
|
| 332 |
+
obj=obj,
|
| 333 |
+
lobj=left,
|
| 334 |
+
robj=right,
|
| 335 |
+
)
|
| 336 |
+
|
| 337 |
+
# metadata comparison
|
| 338 |
+
if check_names:
|
| 339 |
+
assert_attr_equal("names", left, right, obj=obj)
|
| 340 |
+
if isinstance(left, PeriodIndex) or isinstance(right, PeriodIndex):
|
| 341 |
+
assert_attr_equal("dtype", left, right, obj=obj)
|
| 342 |
+
if isinstance(left, IntervalIndex) or isinstance(right, IntervalIndex):
|
| 343 |
+
assert_interval_array_equal(left._values, right._values)
|
| 344 |
+
|
| 345 |
+
if check_categorical:
|
| 346 |
+
if isinstance(left.dtype, CategoricalDtype) or isinstance(
|
| 347 |
+
right.dtype, CategoricalDtype
|
| 348 |
+
):
|
| 349 |
+
assert_categorical_equal(left._values, right._values, obj=f"{obj} category")
|
| 350 |
+
|
| 351 |
+
|
| 352 |
+
def assert_class_equal(
|
| 353 |
+
left, right, exact: bool | str = True, obj: str = "Input"
|
| 354 |
+
) -> None:
|
| 355 |
+
"""
|
| 356 |
+
Checks classes are equal.
|
| 357 |
+
"""
|
| 358 |
+
__tracebackhide__ = True
|
| 359 |
+
|
| 360 |
+
def repr_class(x):
|
| 361 |
+
if isinstance(x, Index):
|
| 362 |
+
# return Index as it is to include values in the error message
|
| 363 |
+
return x
|
| 364 |
+
|
| 365 |
+
return type(x).__name__
|
| 366 |
+
|
| 367 |
+
def is_class_equiv(idx: Index) -> bool:
|
| 368 |
+
"""Classes that are a RangeIndex (sub-)instance or exactly an `Index` .
|
| 369 |
+
|
| 370 |
+
This only checks class equivalence. There is a separate check that the
|
| 371 |
+
dtype is int64.
|
| 372 |
+
"""
|
| 373 |
+
return type(idx) is Index or isinstance(idx, RangeIndex)
|
| 374 |
+
|
| 375 |
+
if type(left) == type(right):
|
| 376 |
+
return
|
| 377 |
+
|
| 378 |
+
if exact == "equiv":
|
| 379 |
+
if is_class_equiv(left) and is_class_equiv(right):
|
| 380 |
+
return
|
| 381 |
+
|
| 382 |
+
msg = f"{obj} classes are different"
|
| 383 |
+
raise_assert_detail(obj, msg, repr_class(left), repr_class(right))
|
| 384 |
+
|
| 385 |
+
|
| 386 |
+
def assert_attr_equal(attr: str, left, right, obj: str = "Attributes") -> None:
|
| 387 |
+
"""
|
| 388 |
+
Check attributes are equal. Both objects must have attribute.
|
| 389 |
+
|
| 390 |
+
Parameters
|
| 391 |
+
----------
|
| 392 |
+
attr : str
|
| 393 |
+
Attribute name being compared.
|
| 394 |
+
left : object
|
| 395 |
+
right : object
|
| 396 |
+
obj : str, default 'Attributes'
|
| 397 |
+
Specify object name being compared, internally used to show appropriate
|
| 398 |
+
assertion message
|
| 399 |
+
"""
|
| 400 |
+
__tracebackhide__ = True
|
| 401 |
+
|
| 402 |
+
left_attr = getattr(left, attr)
|
| 403 |
+
right_attr = getattr(right, attr)
|
| 404 |
+
|
| 405 |
+
if left_attr is right_attr or is_matching_na(left_attr, right_attr):
|
| 406 |
+
# e.g. both np.nan, both NaT, both pd.NA, ...
|
| 407 |
+
return None
|
| 408 |
+
|
| 409 |
+
try:
|
| 410 |
+
result = left_attr == right_attr
|
| 411 |
+
except TypeError:
|
| 412 |
+
# datetimetz on rhs may raise TypeError
|
| 413 |
+
result = False
|
| 414 |
+
if (left_attr is pd.NA) ^ (right_attr is pd.NA):
|
| 415 |
+
result = False
|
| 416 |
+
elif not isinstance(result, bool):
|
| 417 |
+
result = result.all()
|
| 418 |
+
|
| 419 |
+
if not result:
|
| 420 |
+
msg = f'Attribute "{attr}" are different'
|
| 421 |
+
raise_assert_detail(obj, msg, left_attr, right_attr)
|
| 422 |
+
return None
|
| 423 |
+
|
| 424 |
+
|
| 425 |
+
def assert_is_valid_plot_return_object(objs) -> None:
|
| 426 |
+
from matplotlib.artist import Artist
|
| 427 |
+
from matplotlib.axes import Axes
|
| 428 |
+
|
| 429 |
+
if isinstance(objs, (Series, np.ndarray)):
|
| 430 |
+
if isinstance(objs, Series):
|
| 431 |
+
objs = objs._values
|
| 432 |
+
for el in objs.ravel():
|
| 433 |
+
msg = (
|
| 434 |
+
"one of 'objs' is not a matplotlib Axes instance, "
|
| 435 |
+
f"type encountered {repr(type(el).__name__)}"
|
| 436 |
+
)
|
| 437 |
+
assert isinstance(el, (Axes, dict)), msg
|
| 438 |
+
else:
|
| 439 |
+
msg = (
|
| 440 |
+
"objs is neither an ndarray of Artist instances nor a single "
|
| 441 |
+
"ArtistArtist instance, tuple, or dict, 'objs' is a "
|
| 442 |
+
f"{repr(type(objs).__name__)}"
|
| 443 |
+
)
|
| 444 |
+
assert isinstance(objs, (Artist, tuple, dict)), msg
|
| 445 |
+
|
| 446 |
+
|
| 447 |
+
def assert_is_sorted(seq) -> None:
|
| 448 |
+
"""Assert that the sequence is sorted."""
|
| 449 |
+
if isinstance(seq, (Index, Series)):
|
| 450 |
+
seq = seq.values
|
| 451 |
+
# sorting does not change precisions
|
| 452 |
+
if isinstance(seq, np.ndarray):
|
| 453 |
+
assert_numpy_array_equal(seq, np.sort(np.array(seq)))
|
| 454 |
+
else:
|
| 455 |
+
assert_extension_array_equal(seq, seq[seq.argsort()])
|
| 456 |
+
|
| 457 |
+
|
| 458 |
+
def assert_categorical_equal(
|
| 459 |
+
left,
|
| 460 |
+
right,
|
| 461 |
+
check_dtype: bool = True,
|
| 462 |
+
check_category_order: bool = True,
|
| 463 |
+
obj: str = "Categorical",
|
| 464 |
+
) -> None:
|
| 465 |
+
"""
|
| 466 |
+
Test that Categoricals are equivalent.
|
| 467 |
+
|
| 468 |
+
Parameters
|
| 469 |
+
----------
|
| 470 |
+
left : Categorical
|
| 471 |
+
right : Categorical
|
| 472 |
+
check_dtype : bool, default True
|
| 473 |
+
Check that integer dtype of the codes are the same.
|
| 474 |
+
check_category_order : bool, default True
|
| 475 |
+
Whether the order of the categories should be compared, which
|
| 476 |
+
implies identical integer codes. If False, only the resulting
|
| 477 |
+
values are compared. The ordered attribute is
|
| 478 |
+
checked regardless.
|
| 479 |
+
obj : str, default 'Categorical'
|
| 480 |
+
Specify object name being compared, internally used to show appropriate
|
| 481 |
+
assertion message.
|
| 482 |
+
"""
|
| 483 |
+
_check_isinstance(left, right, Categorical)
|
| 484 |
+
|
| 485 |
+
exact: bool | str
|
| 486 |
+
if isinstance(left.categories, RangeIndex) or isinstance(
|
| 487 |
+
right.categories, RangeIndex
|
| 488 |
+
):
|
| 489 |
+
exact = "equiv"
|
| 490 |
+
else:
|
| 491 |
+
# We still want to require exact matches for Index
|
| 492 |
+
exact = True
|
| 493 |
+
|
| 494 |
+
if check_category_order:
|
| 495 |
+
assert_index_equal(
|
| 496 |
+
left.categories, right.categories, obj=f"{obj}.categories", exact=exact
|
| 497 |
+
)
|
| 498 |
+
assert_numpy_array_equal(
|
| 499 |
+
left.codes, right.codes, check_dtype=check_dtype, obj=f"{obj}.codes"
|
| 500 |
+
)
|
| 501 |
+
else:
|
| 502 |
+
try:
|
| 503 |
+
lc = left.categories.sort_values()
|
| 504 |
+
rc = right.categories.sort_values()
|
| 505 |
+
except TypeError:
|
| 506 |
+
# e.g. '<' not supported between instances of 'int' and 'str'
|
| 507 |
+
lc, rc = left.categories, right.categories
|
| 508 |
+
assert_index_equal(lc, rc, obj=f"{obj}.categories", exact=exact)
|
| 509 |
+
assert_index_equal(
|
| 510 |
+
left.categories.take(left.codes),
|
| 511 |
+
right.categories.take(right.codes),
|
| 512 |
+
obj=f"{obj}.values",
|
| 513 |
+
exact=exact,
|
| 514 |
+
)
|
| 515 |
+
|
| 516 |
+
assert_attr_equal("ordered", left, right, obj=obj)
|
| 517 |
+
|
| 518 |
+
|
| 519 |
+
def assert_interval_array_equal(
|
| 520 |
+
left, right, exact: bool | Literal["equiv"] = "equiv", obj: str = "IntervalArray"
|
| 521 |
+
) -> None:
|
| 522 |
+
"""
|
| 523 |
+
Test that two IntervalArrays are equivalent.
|
| 524 |
+
|
| 525 |
+
Parameters
|
| 526 |
+
----------
|
| 527 |
+
left, right : IntervalArray
|
| 528 |
+
The IntervalArrays to compare.
|
| 529 |
+
exact : bool or {'equiv'}, default 'equiv'
|
| 530 |
+
Whether to check the Index class, dtype and inferred_type
|
| 531 |
+
are identical. If 'equiv', then RangeIndex can be substituted for
|
| 532 |
+
Index with an int64 dtype as well.
|
| 533 |
+
obj : str, default 'IntervalArray'
|
| 534 |
+
Specify object name being compared, internally used to show appropriate
|
| 535 |
+
assertion message
|
| 536 |
+
"""
|
| 537 |
+
_check_isinstance(left, right, IntervalArray)
|
| 538 |
+
|
| 539 |
+
kwargs = {}
|
| 540 |
+
if left._left.dtype.kind in "mM":
|
| 541 |
+
# We have a DatetimeArray or TimedeltaArray
|
| 542 |
+
kwargs["check_freq"] = False
|
| 543 |
+
|
| 544 |
+
assert_equal(left._left, right._left, obj=f"{obj}.left", **kwargs)
|
| 545 |
+
assert_equal(left._right, right._right, obj=f"{obj}.left", **kwargs)
|
| 546 |
+
|
| 547 |
+
assert_attr_equal("closed", left, right, obj=obj)
|
| 548 |
+
|
| 549 |
+
|
| 550 |
+
def assert_period_array_equal(left, right, obj: str = "PeriodArray") -> None:
|
| 551 |
+
_check_isinstance(left, right, PeriodArray)
|
| 552 |
+
|
| 553 |
+
assert_numpy_array_equal(left._ndarray, right._ndarray, obj=f"{obj}._ndarray")
|
| 554 |
+
assert_attr_equal("dtype", left, right, obj=obj)
|
| 555 |
+
|
| 556 |
+
|
| 557 |
+
def assert_datetime_array_equal(
|
| 558 |
+
left, right, obj: str = "DatetimeArray", check_freq: bool = True
|
| 559 |
+
) -> None:
|
| 560 |
+
__tracebackhide__ = True
|
| 561 |
+
_check_isinstance(left, right, DatetimeArray)
|
| 562 |
+
|
| 563 |
+
assert_numpy_array_equal(left._ndarray, right._ndarray, obj=f"{obj}._ndarray")
|
| 564 |
+
if check_freq:
|
| 565 |
+
assert_attr_equal("freq", left, right, obj=obj)
|
| 566 |
+
assert_attr_equal("tz", left, right, obj=obj)
|
| 567 |
+
|
| 568 |
+
|
| 569 |
+
def assert_timedelta_array_equal(
|
| 570 |
+
left, right, obj: str = "TimedeltaArray", check_freq: bool = True
|
| 571 |
+
) -> None:
|
| 572 |
+
__tracebackhide__ = True
|
| 573 |
+
_check_isinstance(left, right, TimedeltaArray)
|
| 574 |
+
assert_numpy_array_equal(left._ndarray, right._ndarray, obj=f"{obj}._ndarray")
|
| 575 |
+
if check_freq:
|
| 576 |
+
assert_attr_equal("freq", left, right, obj=obj)
|
| 577 |
+
|
| 578 |
+
|
| 579 |
+
def raise_assert_detail(
|
| 580 |
+
obj, message, left, right, diff=None, first_diff=None, index_values=None
|
| 581 |
+
) -> NoReturn:
|
| 582 |
+
__tracebackhide__ = True
|
| 583 |
+
|
| 584 |
+
msg = f"""{obj} are different
|
| 585 |
+
|
| 586 |
+
{message}"""
|
| 587 |
+
|
| 588 |
+
if isinstance(index_values, Index):
|
| 589 |
+
index_values = np.asarray(index_values)
|
| 590 |
+
|
| 591 |
+
if isinstance(index_values, np.ndarray):
|
| 592 |
+
msg += f"\n[index]: {pprint_thing(index_values)}"
|
| 593 |
+
|
| 594 |
+
if isinstance(left, np.ndarray):
|
| 595 |
+
left = pprint_thing(left)
|
| 596 |
+
elif isinstance(left, (CategoricalDtype, NumpyEADtype)):
|
| 597 |
+
left = repr(left)
|
| 598 |
+
elif isinstance(left, StringDtype):
|
| 599 |
+
# TODO(infer_string) this special case could be avoided if we have
|
| 600 |
+
# a more informative repr https://github.com/pandas-dev/pandas/issues/59342
|
| 601 |
+
left = f"StringDtype(storage={left.storage}, na_value={left.na_value})"
|
| 602 |
+
|
| 603 |
+
if isinstance(right, np.ndarray):
|
| 604 |
+
right = pprint_thing(right)
|
| 605 |
+
elif isinstance(right, (CategoricalDtype, NumpyEADtype)):
|
| 606 |
+
right = repr(right)
|
| 607 |
+
elif isinstance(right, StringDtype):
|
| 608 |
+
right = f"StringDtype(storage={right.storage}, na_value={right.na_value})"
|
| 609 |
+
|
| 610 |
+
msg += f"""
|
| 611 |
+
[left]: {left}
|
| 612 |
+
[right]: {right}"""
|
| 613 |
+
|
| 614 |
+
if diff is not None:
|
| 615 |
+
msg += f"\n[diff]: {diff}"
|
| 616 |
+
|
| 617 |
+
if first_diff is not None:
|
| 618 |
+
msg += f"\n{first_diff}"
|
| 619 |
+
|
| 620 |
+
raise AssertionError(msg)
|
| 621 |
+
|
| 622 |
+
|
| 623 |
+
def assert_numpy_array_equal(
|
| 624 |
+
left,
|
| 625 |
+
right,
|
| 626 |
+
strict_nan: bool = False,
|
| 627 |
+
check_dtype: bool | Literal["equiv"] = True,
|
| 628 |
+
err_msg=None,
|
| 629 |
+
check_same=None,
|
| 630 |
+
obj: str = "numpy array",
|
| 631 |
+
index_values=None,
|
| 632 |
+
) -> None:
|
| 633 |
+
"""
|
| 634 |
+
Check that 'np.ndarray' is equivalent.
|
| 635 |
+
|
| 636 |
+
Parameters
|
| 637 |
+
----------
|
| 638 |
+
left, right : numpy.ndarray or iterable
|
| 639 |
+
The two arrays to be compared.
|
| 640 |
+
strict_nan : bool, default False
|
| 641 |
+
If True, consider NaN and None to be different.
|
| 642 |
+
check_dtype : bool, default True
|
| 643 |
+
Check dtype if both a and b are np.ndarray.
|
| 644 |
+
err_msg : str, default None
|
| 645 |
+
If provided, used as assertion message.
|
| 646 |
+
check_same : None|'copy'|'same', default None
|
| 647 |
+
Ensure left and right refer/do not refer to the same memory area.
|
| 648 |
+
obj : str, default 'numpy array'
|
| 649 |
+
Specify object name being compared, internally used to show appropriate
|
| 650 |
+
assertion message.
|
| 651 |
+
index_values : Index | numpy.ndarray, default None
|
| 652 |
+
optional index (shared by both left and right), used in output.
|
| 653 |
+
"""
|
| 654 |
+
__tracebackhide__ = True
|
| 655 |
+
|
| 656 |
+
# instance validation
|
| 657 |
+
# Show a detailed error message when classes are different
|
| 658 |
+
assert_class_equal(left, right, obj=obj)
|
| 659 |
+
# both classes must be an np.ndarray
|
| 660 |
+
_check_isinstance(left, right, np.ndarray)
|
| 661 |
+
|
| 662 |
+
def _get_base(obj):
|
| 663 |
+
return obj.base if getattr(obj, "base", None) is not None else obj
|
| 664 |
+
|
| 665 |
+
left_base = _get_base(left)
|
| 666 |
+
right_base = _get_base(right)
|
| 667 |
+
|
| 668 |
+
if check_same == "same":
|
| 669 |
+
if left_base is not right_base:
|
| 670 |
+
raise AssertionError(f"{repr(left_base)} is not {repr(right_base)}")
|
| 671 |
+
elif check_same == "copy":
|
| 672 |
+
if left_base is right_base:
|
| 673 |
+
raise AssertionError(f"{repr(left_base)} is {repr(right_base)}")
|
| 674 |
+
|
| 675 |
+
def _raise(left, right, err_msg) -> NoReturn:
|
| 676 |
+
if err_msg is None:
|
| 677 |
+
if left.shape != right.shape:
|
| 678 |
+
raise_assert_detail(
|
| 679 |
+
obj, f"{obj} shapes are different", left.shape, right.shape
|
| 680 |
+
)
|
| 681 |
+
|
| 682 |
+
diff = 0
|
| 683 |
+
for left_arr, right_arr in zip(left, right):
|
| 684 |
+
# count up differences
|
| 685 |
+
if not array_equivalent(left_arr, right_arr, strict_nan=strict_nan):
|
| 686 |
+
diff += 1
|
| 687 |
+
|
| 688 |
+
diff = diff * 100.0 / left.size
|
| 689 |
+
msg = f"{obj} values are different ({np.round(diff, 5)} %)"
|
| 690 |
+
raise_assert_detail(obj, msg, left, right, index_values=index_values)
|
| 691 |
+
|
| 692 |
+
raise AssertionError(err_msg)
|
| 693 |
+
|
| 694 |
+
# compare shape and values
|
| 695 |
+
if not array_equivalent(left, right, strict_nan=strict_nan):
|
| 696 |
+
_raise(left, right, err_msg)
|
| 697 |
+
|
| 698 |
+
if check_dtype:
|
| 699 |
+
if isinstance(left, np.ndarray) and isinstance(right, np.ndarray):
|
| 700 |
+
assert_attr_equal("dtype", left, right, obj=obj)
|
| 701 |
+
|
| 702 |
+
|
| 703 |
+
def assert_extension_array_equal(
|
| 704 |
+
left,
|
| 705 |
+
right,
|
| 706 |
+
check_dtype: bool | Literal["equiv"] = True,
|
| 707 |
+
index_values=None,
|
| 708 |
+
check_exact: bool | lib.NoDefault = lib.no_default,
|
| 709 |
+
rtol: float | lib.NoDefault = lib.no_default,
|
| 710 |
+
atol: float | lib.NoDefault = lib.no_default,
|
| 711 |
+
obj: str = "ExtensionArray",
|
| 712 |
+
) -> None:
|
| 713 |
+
"""
|
| 714 |
+
Check that left and right ExtensionArrays are equal.
|
| 715 |
+
|
| 716 |
+
Parameters
|
| 717 |
+
----------
|
| 718 |
+
left, right : ExtensionArray
|
| 719 |
+
The two arrays to compare.
|
| 720 |
+
check_dtype : bool, default True
|
| 721 |
+
Whether to check if the ExtensionArray dtypes are identical.
|
| 722 |
+
index_values : Index | numpy.ndarray, default None
|
| 723 |
+
Optional index (shared by both left and right), used in output.
|
| 724 |
+
check_exact : bool, default False
|
| 725 |
+
Whether to compare number exactly.
|
| 726 |
+
|
| 727 |
+
.. versionchanged:: 2.2.0
|
| 728 |
+
|
| 729 |
+
Defaults to True for integer dtypes if none of
|
| 730 |
+
``check_exact``, ``rtol`` and ``atol`` are specified.
|
| 731 |
+
rtol : float, default 1e-5
|
| 732 |
+
Relative tolerance. Only used when check_exact is False.
|
| 733 |
+
atol : float, default 1e-8
|
| 734 |
+
Absolute tolerance. Only used when check_exact is False.
|
| 735 |
+
obj : str, default 'ExtensionArray'
|
| 736 |
+
Specify object name being compared, internally used to show appropriate
|
| 737 |
+
assertion message.
|
| 738 |
+
|
| 739 |
+
.. versionadded:: 2.0.0
|
| 740 |
+
|
| 741 |
+
Notes
|
| 742 |
+
-----
|
| 743 |
+
Missing values are checked separately from valid values.
|
| 744 |
+
A mask of missing values is computed for each and checked to match.
|
| 745 |
+
The remaining all-valid values are cast to object dtype and checked.
|
| 746 |
+
|
| 747 |
+
Examples
|
| 748 |
+
--------
|
| 749 |
+
>>> from pandas import testing as tm
|
| 750 |
+
>>> a = pd.Series([1, 2, 3, 4])
|
| 751 |
+
>>> b, c = a.array, a.array
|
| 752 |
+
>>> tm.assert_extension_array_equal(b, c)
|
| 753 |
+
"""
|
| 754 |
+
if (
|
| 755 |
+
check_exact is lib.no_default
|
| 756 |
+
and rtol is lib.no_default
|
| 757 |
+
and atol is lib.no_default
|
| 758 |
+
):
|
| 759 |
+
check_exact = (
|
| 760 |
+
is_numeric_dtype(left.dtype)
|
| 761 |
+
and not is_float_dtype(left.dtype)
|
| 762 |
+
or is_numeric_dtype(right.dtype)
|
| 763 |
+
and not is_float_dtype(right.dtype)
|
| 764 |
+
)
|
| 765 |
+
elif check_exact is lib.no_default:
|
| 766 |
+
check_exact = False
|
| 767 |
+
|
| 768 |
+
rtol = rtol if rtol is not lib.no_default else 1.0e-5
|
| 769 |
+
atol = atol if atol is not lib.no_default else 1.0e-8
|
| 770 |
+
|
| 771 |
+
assert isinstance(left, ExtensionArray), "left is not an ExtensionArray"
|
| 772 |
+
assert isinstance(right, ExtensionArray), "right is not an ExtensionArray"
|
| 773 |
+
if check_dtype:
|
| 774 |
+
assert_attr_equal("dtype", left, right, obj=f"Attributes of {obj}")
|
| 775 |
+
|
| 776 |
+
if (
|
| 777 |
+
isinstance(left, DatetimeLikeArrayMixin)
|
| 778 |
+
and isinstance(right, DatetimeLikeArrayMixin)
|
| 779 |
+
and type(right) == type(left)
|
| 780 |
+
):
|
| 781 |
+
# GH 52449
|
| 782 |
+
if not check_dtype and left.dtype.kind in "mM":
|
| 783 |
+
if not isinstance(left.dtype, np.dtype):
|
| 784 |
+
l_unit = cast(DatetimeTZDtype, left.dtype).unit
|
| 785 |
+
else:
|
| 786 |
+
l_unit = np.datetime_data(left.dtype)[0]
|
| 787 |
+
if not isinstance(right.dtype, np.dtype):
|
| 788 |
+
r_unit = cast(DatetimeTZDtype, right.dtype).unit
|
| 789 |
+
else:
|
| 790 |
+
r_unit = np.datetime_data(right.dtype)[0]
|
| 791 |
+
if (
|
| 792 |
+
l_unit != r_unit
|
| 793 |
+
and compare_mismatched_resolutions(
|
| 794 |
+
left._ndarray, right._ndarray, operator.eq
|
| 795 |
+
).all()
|
| 796 |
+
):
|
| 797 |
+
return
|
| 798 |
+
# Avoid slow object-dtype comparisons
|
| 799 |
+
# np.asarray for case where we have a np.MaskedArray
|
| 800 |
+
assert_numpy_array_equal(
|
| 801 |
+
np.asarray(left.asi8),
|
| 802 |
+
np.asarray(right.asi8),
|
| 803 |
+
index_values=index_values,
|
| 804 |
+
obj=obj,
|
| 805 |
+
)
|
| 806 |
+
return
|
| 807 |
+
|
| 808 |
+
left_na = np.asarray(left.isna())
|
| 809 |
+
right_na = np.asarray(right.isna())
|
| 810 |
+
assert_numpy_array_equal(
|
| 811 |
+
left_na, right_na, obj=f"{obj} NA mask", index_values=index_values
|
| 812 |
+
)
|
| 813 |
+
|
| 814 |
+
# Specifically for StringArrayNumpySemantics, validate here we have a valid array
|
| 815 |
+
if (
|
| 816 |
+
isinstance(left.dtype, StringDtype)
|
| 817 |
+
and left.dtype.storage == "python"
|
| 818 |
+
and left.dtype.na_value is np.nan
|
| 819 |
+
):
|
| 820 |
+
assert np.all(
|
| 821 |
+
[np.isnan(val) for val in left._ndarray[left_na]] # type: ignore[attr-defined]
|
| 822 |
+
), "wrong missing value sentinels"
|
| 823 |
+
if (
|
| 824 |
+
isinstance(right.dtype, StringDtype)
|
| 825 |
+
and right.dtype.storage == "python"
|
| 826 |
+
and right.dtype.na_value is np.nan
|
| 827 |
+
):
|
| 828 |
+
assert np.all(
|
| 829 |
+
[np.isnan(val) for val in right._ndarray[right_na]] # type: ignore[attr-defined]
|
| 830 |
+
), "wrong missing value sentinels"
|
| 831 |
+
|
| 832 |
+
left_valid = left[~left_na].to_numpy(dtype=object)
|
| 833 |
+
right_valid = right[~right_na].to_numpy(dtype=object)
|
| 834 |
+
if check_exact:
|
| 835 |
+
assert_numpy_array_equal(
|
| 836 |
+
left_valid, right_valid, obj=obj, index_values=index_values
|
| 837 |
+
)
|
| 838 |
+
else:
|
| 839 |
+
_testing.assert_almost_equal(
|
| 840 |
+
left_valid,
|
| 841 |
+
right_valid,
|
| 842 |
+
check_dtype=bool(check_dtype),
|
| 843 |
+
rtol=rtol,
|
| 844 |
+
atol=atol,
|
| 845 |
+
obj=obj,
|
| 846 |
+
index_values=index_values,
|
| 847 |
+
)
|
| 848 |
+
|
| 849 |
+
|
| 850 |
+
# This could be refactored to use the NDFrame.equals method
|
| 851 |
+
def assert_series_equal(
|
| 852 |
+
left,
|
| 853 |
+
right,
|
| 854 |
+
check_dtype: bool | Literal["equiv"] = True,
|
| 855 |
+
check_index_type: bool | Literal["equiv"] = "equiv",
|
| 856 |
+
check_series_type: bool = True,
|
| 857 |
+
check_names: bool = True,
|
| 858 |
+
check_exact: bool | lib.NoDefault = lib.no_default,
|
| 859 |
+
check_datetimelike_compat: bool = False,
|
| 860 |
+
check_categorical: bool = True,
|
| 861 |
+
check_category_order: bool = True,
|
| 862 |
+
check_freq: bool = True,
|
| 863 |
+
check_flags: bool = True,
|
| 864 |
+
rtol: float | lib.NoDefault = lib.no_default,
|
| 865 |
+
atol: float | lib.NoDefault = lib.no_default,
|
| 866 |
+
obj: str = "Series",
|
| 867 |
+
*,
|
| 868 |
+
check_index: bool = True,
|
| 869 |
+
check_like: bool = False,
|
| 870 |
+
) -> None:
|
| 871 |
+
"""
|
| 872 |
+
Check that left and right Series are equal.
|
| 873 |
+
|
| 874 |
+
Parameters
|
| 875 |
+
----------
|
| 876 |
+
left : Series
|
| 877 |
+
right : Series
|
| 878 |
+
check_dtype : bool, default True
|
| 879 |
+
Whether to check the Series dtype is identical.
|
| 880 |
+
check_index_type : bool or {'equiv'}, default 'equiv'
|
| 881 |
+
Whether to check the Index class, dtype and inferred_type
|
| 882 |
+
are identical.
|
| 883 |
+
check_series_type : bool, default True
|
| 884 |
+
Whether to check the Series class is identical.
|
| 885 |
+
check_names : bool, default True
|
| 886 |
+
Whether to check the Series and Index names attribute.
|
| 887 |
+
check_exact : bool, default False
|
| 888 |
+
Whether to compare number exactly.
|
| 889 |
+
|
| 890 |
+
.. versionchanged:: 2.2.0
|
| 891 |
+
|
| 892 |
+
Defaults to True for integer dtypes if none of
|
| 893 |
+
``check_exact``, ``rtol`` and ``atol`` are specified.
|
| 894 |
+
check_datetimelike_compat : bool, default False
|
| 895 |
+
Compare datetime-like which is comparable ignoring dtype.
|
| 896 |
+
check_categorical : bool, default True
|
| 897 |
+
Whether to compare internal Categorical exactly.
|
| 898 |
+
check_category_order : bool, default True
|
| 899 |
+
Whether to compare category order of internal Categoricals.
|
| 900 |
+
check_freq : bool, default True
|
| 901 |
+
Whether to check the `freq` attribute on a DatetimeIndex or TimedeltaIndex.
|
| 902 |
+
check_flags : bool, default True
|
| 903 |
+
Whether to check the `flags` attribute.
|
| 904 |
+
rtol : float, default 1e-5
|
| 905 |
+
Relative tolerance. Only used when check_exact is False.
|
| 906 |
+
atol : float, default 1e-8
|
| 907 |
+
Absolute tolerance. Only used when check_exact is False.
|
| 908 |
+
obj : str, default 'Series'
|
| 909 |
+
Specify object name being compared, internally used to show appropriate
|
| 910 |
+
assertion message.
|
| 911 |
+
check_index : bool, default True
|
| 912 |
+
Whether to check index equivalence. If False, then compare only values.
|
| 913 |
+
|
| 914 |
+
.. versionadded:: 1.3.0
|
| 915 |
+
check_like : bool, default False
|
| 916 |
+
If True, ignore the order of the index. Must be False if check_index is False.
|
| 917 |
+
Note: same labels must be with the same data.
|
| 918 |
+
|
| 919 |
+
.. versionadded:: 1.5.0
|
| 920 |
+
|
| 921 |
+
Examples
|
| 922 |
+
--------
|
| 923 |
+
>>> from pandas import testing as tm
|
| 924 |
+
>>> a = pd.Series([1, 2, 3, 4])
|
| 925 |
+
>>> b = pd.Series([1, 2, 3, 4])
|
| 926 |
+
>>> tm.assert_series_equal(a, b)
|
| 927 |
+
"""
|
| 928 |
+
__tracebackhide__ = True
|
| 929 |
+
check_exact_index = False if check_exact is lib.no_default else check_exact
|
| 930 |
+
if (
|
| 931 |
+
check_exact is lib.no_default
|
| 932 |
+
and rtol is lib.no_default
|
| 933 |
+
and atol is lib.no_default
|
| 934 |
+
):
|
| 935 |
+
check_exact = (
|
| 936 |
+
is_numeric_dtype(left.dtype)
|
| 937 |
+
and not is_float_dtype(left.dtype)
|
| 938 |
+
or is_numeric_dtype(right.dtype)
|
| 939 |
+
and not is_float_dtype(right.dtype)
|
| 940 |
+
)
|
| 941 |
+
elif check_exact is lib.no_default:
|
| 942 |
+
check_exact = False
|
| 943 |
+
|
| 944 |
+
rtol = rtol if rtol is not lib.no_default else 1.0e-5
|
| 945 |
+
atol = atol if atol is not lib.no_default else 1.0e-8
|
| 946 |
+
|
| 947 |
+
if not check_index and check_like:
|
| 948 |
+
raise ValueError("check_like must be False if check_index is False")
|
| 949 |
+
|
| 950 |
+
# instance validation
|
| 951 |
+
_check_isinstance(left, right, Series)
|
| 952 |
+
|
| 953 |
+
if check_series_type:
|
| 954 |
+
assert_class_equal(left, right, obj=obj)
|
| 955 |
+
|
| 956 |
+
# length comparison
|
| 957 |
+
if len(left) != len(right):
|
| 958 |
+
msg1 = f"{len(left)}, {left.index}"
|
| 959 |
+
msg2 = f"{len(right)}, {right.index}"
|
| 960 |
+
raise_assert_detail(obj, "Series length are different", msg1, msg2)
|
| 961 |
+
|
| 962 |
+
if check_flags:
|
| 963 |
+
assert left.flags == right.flags, f"{repr(left.flags)} != {repr(right.flags)}"
|
| 964 |
+
|
| 965 |
+
if check_index:
|
| 966 |
+
# GH #38183
|
| 967 |
+
assert_index_equal(
|
| 968 |
+
left.index,
|
| 969 |
+
right.index,
|
| 970 |
+
exact=check_index_type,
|
| 971 |
+
check_names=check_names,
|
| 972 |
+
check_exact=check_exact_index,
|
| 973 |
+
check_categorical=check_categorical,
|
| 974 |
+
check_order=not check_like,
|
| 975 |
+
rtol=rtol,
|
| 976 |
+
atol=atol,
|
| 977 |
+
obj=f"{obj}.index",
|
| 978 |
+
)
|
| 979 |
+
|
| 980 |
+
if check_like:
|
| 981 |
+
left = left.reindex_like(right)
|
| 982 |
+
|
| 983 |
+
if check_freq and isinstance(left.index, (DatetimeIndex, TimedeltaIndex)):
|
| 984 |
+
lidx = left.index
|
| 985 |
+
ridx = right.index
|
| 986 |
+
assert lidx.freq == ridx.freq, (lidx.freq, ridx.freq)
|
| 987 |
+
|
| 988 |
+
if check_dtype:
|
| 989 |
+
# We want to skip exact dtype checking when `check_categorical`
|
| 990 |
+
# is False. We'll still raise if only one is a `Categorical`,
|
| 991 |
+
# regardless of `check_categorical`
|
| 992 |
+
if (
|
| 993 |
+
isinstance(left.dtype, CategoricalDtype)
|
| 994 |
+
and isinstance(right.dtype, CategoricalDtype)
|
| 995 |
+
and not check_categorical
|
| 996 |
+
):
|
| 997 |
+
pass
|
| 998 |
+
else:
|
| 999 |
+
assert_attr_equal("dtype", left, right, obj=f"Attributes of {obj}")
|
| 1000 |
+
if check_exact:
|
| 1001 |
+
left_values = left._values
|
| 1002 |
+
right_values = right._values
|
| 1003 |
+
# Only check exact if dtype is numeric
|
| 1004 |
+
if isinstance(left_values, ExtensionArray) and isinstance(
|
| 1005 |
+
right_values, ExtensionArray
|
| 1006 |
+
):
|
| 1007 |
+
assert_extension_array_equal(
|
| 1008 |
+
left_values,
|
| 1009 |
+
right_values,
|
| 1010 |
+
check_dtype=check_dtype,
|
| 1011 |
+
index_values=left.index,
|
| 1012 |
+
obj=str(obj),
|
| 1013 |
+
)
|
| 1014 |
+
else:
|
| 1015 |
+
# convert both to NumPy if not, check_dtype would raise earlier
|
| 1016 |
+
lv, rv = left_values, right_values
|
| 1017 |
+
if isinstance(left_values, ExtensionArray):
|
| 1018 |
+
lv = left_values.to_numpy()
|
| 1019 |
+
if isinstance(right_values, ExtensionArray):
|
| 1020 |
+
rv = right_values.to_numpy()
|
| 1021 |
+
assert_numpy_array_equal(
|
| 1022 |
+
lv,
|
| 1023 |
+
rv,
|
| 1024 |
+
check_dtype=check_dtype,
|
| 1025 |
+
obj=str(obj),
|
| 1026 |
+
index_values=left.index,
|
| 1027 |
+
)
|
| 1028 |
+
elif check_datetimelike_compat and (
|
| 1029 |
+
needs_i8_conversion(left.dtype) or needs_i8_conversion(right.dtype)
|
| 1030 |
+
):
|
| 1031 |
+
# we want to check only if we have compat dtypes
|
| 1032 |
+
# e.g. integer and M|m are NOT compat, but we can simply check
|
| 1033 |
+
# the values in that case
|
| 1034 |
+
|
| 1035 |
+
# datetimelike may have different objects (e.g. datetime.datetime
|
| 1036 |
+
# vs Timestamp) but will compare equal
|
| 1037 |
+
if not Index(left._values).equals(Index(right._values)):
|
| 1038 |
+
msg = (
|
| 1039 |
+
f"[datetimelike_compat=True] {left._values} "
|
| 1040 |
+
f"is not equal to {right._values}."
|
| 1041 |
+
)
|
| 1042 |
+
raise AssertionError(msg)
|
| 1043 |
+
elif isinstance(left.dtype, IntervalDtype) and isinstance(
|
| 1044 |
+
right.dtype, IntervalDtype
|
| 1045 |
+
):
|
| 1046 |
+
assert_interval_array_equal(left.array, right.array)
|
| 1047 |
+
elif isinstance(left.dtype, CategoricalDtype) or isinstance(
|
| 1048 |
+
right.dtype, CategoricalDtype
|
| 1049 |
+
):
|
| 1050 |
+
_testing.assert_almost_equal(
|
| 1051 |
+
left._values,
|
| 1052 |
+
right._values,
|
| 1053 |
+
rtol=rtol,
|
| 1054 |
+
atol=atol,
|
| 1055 |
+
check_dtype=bool(check_dtype),
|
| 1056 |
+
obj=str(obj),
|
| 1057 |
+
index_values=left.index,
|
| 1058 |
+
)
|
| 1059 |
+
elif isinstance(left.dtype, ExtensionDtype) and isinstance(
|
| 1060 |
+
right.dtype, ExtensionDtype
|
| 1061 |
+
):
|
| 1062 |
+
assert_extension_array_equal(
|
| 1063 |
+
left._values,
|
| 1064 |
+
right._values,
|
| 1065 |
+
rtol=rtol,
|
| 1066 |
+
atol=atol,
|
| 1067 |
+
check_dtype=check_dtype,
|
| 1068 |
+
index_values=left.index,
|
| 1069 |
+
obj=str(obj),
|
| 1070 |
+
)
|
| 1071 |
+
elif is_extension_array_dtype_and_needs_i8_conversion(
|
| 1072 |
+
left.dtype, right.dtype
|
| 1073 |
+
) or is_extension_array_dtype_and_needs_i8_conversion(right.dtype, left.dtype):
|
| 1074 |
+
assert_extension_array_equal(
|
| 1075 |
+
left._values,
|
| 1076 |
+
right._values,
|
| 1077 |
+
check_dtype=check_dtype,
|
| 1078 |
+
index_values=left.index,
|
| 1079 |
+
obj=str(obj),
|
| 1080 |
+
)
|
| 1081 |
+
elif needs_i8_conversion(left.dtype) and needs_i8_conversion(right.dtype):
|
| 1082 |
+
# DatetimeArray or TimedeltaArray
|
| 1083 |
+
assert_extension_array_equal(
|
| 1084 |
+
left._values,
|
| 1085 |
+
right._values,
|
| 1086 |
+
check_dtype=check_dtype,
|
| 1087 |
+
index_values=left.index,
|
| 1088 |
+
obj=str(obj),
|
| 1089 |
+
)
|
| 1090 |
+
else:
|
| 1091 |
+
_testing.assert_almost_equal(
|
| 1092 |
+
left._values,
|
| 1093 |
+
right._values,
|
| 1094 |
+
rtol=rtol,
|
| 1095 |
+
atol=atol,
|
| 1096 |
+
check_dtype=bool(check_dtype),
|
| 1097 |
+
obj=str(obj),
|
| 1098 |
+
index_values=left.index,
|
| 1099 |
+
)
|
| 1100 |
+
|
| 1101 |
+
# metadata comparison
|
| 1102 |
+
if check_names:
|
| 1103 |
+
assert_attr_equal("name", left, right, obj=obj)
|
| 1104 |
+
|
| 1105 |
+
if check_categorical:
|
| 1106 |
+
if isinstance(left.dtype, CategoricalDtype) or isinstance(
|
| 1107 |
+
right.dtype, CategoricalDtype
|
| 1108 |
+
):
|
| 1109 |
+
assert_categorical_equal(
|
| 1110 |
+
left._values,
|
| 1111 |
+
right._values,
|
| 1112 |
+
obj=f"{obj} category",
|
| 1113 |
+
check_category_order=check_category_order,
|
| 1114 |
+
)
|
| 1115 |
+
|
| 1116 |
+
|
| 1117 |
+
# This could be refactored to use the NDFrame.equals method
|
| 1118 |
+
def assert_frame_equal(
|
| 1119 |
+
left,
|
| 1120 |
+
right,
|
| 1121 |
+
check_dtype: bool | Literal["equiv"] = True,
|
| 1122 |
+
check_index_type: bool | Literal["equiv"] = "equiv",
|
| 1123 |
+
check_column_type: bool | Literal["equiv"] = "equiv",
|
| 1124 |
+
check_frame_type: bool = True,
|
| 1125 |
+
check_names: bool = True,
|
| 1126 |
+
by_blocks: bool = False,
|
| 1127 |
+
check_exact: bool | lib.NoDefault = lib.no_default,
|
| 1128 |
+
check_datetimelike_compat: bool = False,
|
| 1129 |
+
check_categorical: bool = True,
|
| 1130 |
+
check_like: bool = False,
|
| 1131 |
+
check_freq: bool = True,
|
| 1132 |
+
check_flags: bool = True,
|
| 1133 |
+
rtol: float | lib.NoDefault = lib.no_default,
|
| 1134 |
+
atol: float | lib.NoDefault = lib.no_default,
|
| 1135 |
+
obj: str = "DataFrame",
|
| 1136 |
+
) -> None:
|
| 1137 |
+
"""
|
| 1138 |
+
Check that left and right DataFrame are equal.
|
| 1139 |
+
|
| 1140 |
+
This function is intended to compare two DataFrames and output any
|
| 1141 |
+
differences. It is mostly intended for use in unit tests.
|
| 1142 |
+
Additional parameters allow varying the strictness of the
|
| 1143 |
+
equality checks performed.
|
| 1144 |
+
|
| 1145 |
+
Parameters
|
| 1146 |
+
----------
|
| 1147 |
+
left : DataFrame
|
| 1148 |
+
First DataFrame to compare.
|
| 1149 |
+
right : DataFrame
|
| 1150 |
+
Second DataFrame to compare.
|
| 1151 |
+
check_dtype : bool, default True
|
| 1152 |
+
Whether to check the DataFrame dtype is identical.
|
| 1153 |
+
check_index_type : bool or {'equiv'}, default 'equiv'
|
| 1154 |
+
Whether to check the Index class, dtype and inferred_type
|
| 1155 |
+
are identical.
|
| 1156 |
+
check_column_type : bool or {'equiv'}, default 'equiv'
|
| 1157 |
+
Whether to check the columns class, dtype and inferred_type
|
| 1158 |
+
are identical. Is passed as the ``exact`` argument of
|
| 1159 |
+
:func:`assert_index_equal`.
|
| 1160 |
+
check_frame_type : bool, default True
|
| 1161 |
+
Whether to check the DataFrame class is identical.
|
| 1162 |
+
check_names : bool, default True
|
| 1163 |
+
Whether to check that the `names` attribute for both the `index`
|
| 1164 |
+
and `column` attributes of the DataFrame is identical.
|
| 1165 |
+
by_blocks : bool, default False
|
| 1166 |
+
Specify how to compare internal data. If False, compare by columns.
|
| 1167 |
+
If True, compare by blocks.
|
| 1168 |
+
check_exact : bool, default False
|
| 1169 |
+
Whether to compare number exactly.
|
| 1170 |
+
|
| 1171 |
+
.. versionchanged:: 2.2.0
|
| 1172 |
+
|
| 1173 |
+
Defaults to True for integer dtypes if none of
|
| 1174 |
+
``check_exact``, ``rtol`` and ``atol`` are specified.
|
| 1175 |
+
check_datetimelike_compat : bool, default False
|
| 1176 |
+
Compare datetime-like which is comparable ignoring dtype.
|
| 1177 |
+
check_categorical : bool, default True
|
| 1178 |
+
Whether to compare internal Categorical exactly.
|
| 1179 |
+
check_like : bool, default False
|
| 1180 |
+
If True, ignore the order of index & columns.
|
| 1181 |
+
Note: index labels must match their respective rows
|
| 1182 |
+
(same as in columns) - same labels must be with the same data.
|
| 1183 |
+
check_freq : bool, default True
|
| 1184 |
+
Whether to check the `freq` attribute on a DatetimeIndex or TimedeltaIndex.
|
| 1185 |
+
check_flags : bool, default True
|
| 1186 |
+
Whether to check the `flags` attribute.
|
| 1187 |
+
rtol : float, default 1e-5
|
| 1188 |
+
Relative tolerance. Only used when check_exact is False.
|
| 1189 |
+
atol : float, default 1e-8
|
| 1190 |
+
Absolute tolerance. Only used when check_exact is False.
|
| 1191 |
+
obj : str, default 'DataFrame'
|
| 1192 |
+
Specify object name being compared, internally used to show appropriate
|
| 1193 |
+
assertion message.
|
| 1194 |
+
|
| 1195 |
+
See Also
|
| 1196 |
+
--------
|
| 1197 |
+
assert_series_equal : Equivalent method for asserting Series equality.
|
| 1198 |
+
DataFrame.equals : Check DataFrame equality.
|
| 1199 |
+
|
| 1200 |
+
Examples
|
| 1201 |
+
--------
|
| 1202 |
+
This example shows comparing two DataFrames that are equal
|
| 1203 |
+
but with columns of differing dtypes.
|
| 1204 |
+
|
| 1205 |
+
>>> from pandas.testing import assert_frame_equal
|
| 1206 |
+
>>> df1 = pd.DataFrame({'a': [1, 2], 'b': [3, 4]})
|
| 1207 |
+
>>> df2 = pd.DataFrame({'a': [1, 2], 'b': [3.0, 4.0]})
|
| 1208 |
+
|
| 1209 |
+
df1 equals itself.
|
| 1210 |
+
|
| 1211 |
+
>>> assert_frame_equal(df1, df1)
|
| 1212 |
+
|
| 1213 |
+
df1 differs from df2 as column 'b' is of a different type.
|
| 1214 |
+
|
| 1215 |
+
>>> assert_frame_equal(df1, df2)
|
| 1216 |
+
Traceback (most recent call last):
|
| 1217 |
+
...
|
| 1218 |
+
AssertionError: Attributes of DataFrame.iloc[:, 1] (column name="b") are different
|
| 1219 |
+
|
| 1220 |
+
Attribute "dtype" are different
|
| 1221 |
+
[left]: int64
|
| 1222 |
+
[right]: float64
|
| 1223 |
+
|
| 1224 |
+
Ignore differing dtypes in columns with check_dtype.
|
| 1225 |
+
|
| 1226 |
+
>>> assert_frame_equal(df1, df2, check_dtype=False)
|
| 1227 |
+
"""
|
| 1228 |
+
__tracebackhide__ = True
|
| 1229 |
+
_rtol = rtol if rtol is not lib.no_default else 1.0e-5
|
| 1230 |
+
_atol = atol if atol is not lib.no_default else 1.0e-8
|
| 1231 |
+
_check_exact = check_exact if check_exact is not lib.no_default else False
|
| 1232 |
+
|
| 1233 |
+
# instance validation
|
| 1234 |
+
_check_isinstance(left, right, DataFrame)
|
| 1235 |
+
|
| 1236 |
+
if check_frame_type:
|
| 1237 |
+
assert isinstance(left, type(right))
|
| 1238 |
+
# assert_class_equal(left, right, obj=obj)
|
| 1239 |
+
|
| 1240 |
+
# shape comparison
|
| 1241 |
+
if left.shape != right.shape:
|
| 1242 |
+
raise_assert_detail(
|
| 1243 |
+
obj, f"{obj} shape mismatch", f"{repr(left.shape)}", f"{repr(right.shape)}"
|
| 1244 |
+
)
|
| 1245 |
+
|
| 1246 |
+
if check_flags:
|
| 1247 |
+
assert left.flags == right.flags, f"{repr(left.flags)} != {repr(right.flags)}"
|
| 1248 |
+
|
| 1249 |
+
# index comparison
|
| 1250 |
+
assert_index_equal(
|
| 1251 |
+
left.index,
|
| 1252 |
+
right.index,
|
| 1253 |
+
exact=check_index_type,
|
| 1254 |
+
check_names=check_names,
|
| 1255 |
+
check_exact=_check_exact,
|
| 1256 |
+
check_categorical=check_categorical,
|
| 1257 |
+
check_order=not check_like,
|
| 1258 |
+
rtol=_rtol,
|
| 1259 |
+
atol=_atol,
|
| 1260 |
+
obj=f"{obj}.index",
|
| 1261 |
+
)
|
| 1262 |
+
|
| 1263 |
+
# column comparison
|
| 1264 |
+
assert_index_equal(
|
| 1265 |
+
left.columns,
|
| 1266 |
+
right.columns,
|
| 1267 |
+
exact=check_column_type,
|
| 1268 |
+
check_names=check_names,
|
| 1269 |
+
check_exact=_check_exact,
|
| 1270 |
+
check_categorical=check_categorical,
|
| 1271 |
+
check_order=not check_like,
|
| 1272 |
+
rtol=_rtol,
|
| 1273 |
+
atol=_atol,
|
| 1274 |
+
obj=f"{obj}.columns",
|
| 1275 |
+
)
|
| 1276 |
+
|
| 1277 |
+
if check_like:
|
| 1278 |
+
left = left.reindex_like(right)
|
| 1279 |
+
|
| 1280 |
+
# compare by blocks
|
| 1281 |
+
if by_blocks:
|
| 1282 |
+
rblocks = right._to_dict_of_blocks()
|
| 1283 |
+
lblocks = left._to_dict_of_blocks()
|
| 1284 |
+
for dtype in list(set(list(lblocks.keys()) + list(rblocks.keys()))):
|
| 1285 |
+
assert dtype in lblocks
|
| 1286 |
+
assert dtype in rblocks
|
| 1287 |
+
assert_frame_equal(
|
| 1288 |
+
lblocks[dtype], rblocks[dtype], check_dtype=check_dtype, obj=obj
|
| 1289 |
+
)
|
| 1290 |
+
|
| 1291 |
+
# compare by columns
|
| 1292 |
+
else:
|
| 1293 |
+
for i, col in enumerate(left.columns):
|
| 1294 |
+
# We have already checked that columns match, so we can do
|
| 1295 |
+
# fast location-based lookups
|
| 1296 |
+
lcol = left._ixs(i, axis=1)
|
| 1297 |
+
rcol = right._ixs(i, axis=1)
|
| 1298 |
+
|
| 1299 |
+
# GH #38183
|
| 1300 |
+
# use check_index=False, because we do not want to run
|
| 1301 |
+
# assert_index_equal for each column,
|
| 1302 |
+
# as we already checked it for the whole dataframe before.
|
| 1303 |
+
assert_series_equal(
|
| 1304 |
+
lcol,
|
| 1305 |
+
rcol,
|
| 1306 |
+
check_dtype=check_dtype,
|
| 1307 |
+
check_index_type=check_index_type,
|
| 1308 |
+
check_exact=check_exact,
|
| 1309 |
+
check_names=check_names,
|
| 1310 |
+
check_datetimelike_compat=check_datetimelike_compat,
|
| 1311 |
+
check_categorical=check_categorical,
|
| 1312 |
+
check_freq=check_freq,
|
| 1313 |
+
obj=f'{obj}.iloc[:, {i}] (column name="{col}")',
|
| 1314 |
+
rtol=rtol,
|
| 1315 |
+
atol=atol,
|
| 1316 |
+
check_index=False,
|
| 1317 |
+
check_flags=False,
|
| 1318 |
+
)
|
| 1319 |
+
|
| 1320 |
+
|
| 1321 |
+
def assert_equal(left, right, **kwargs) -> None:
|
| 1322 |
+
"""
|
| 1323 |
+
Wrapper for tm.assert_*_equal to dispatch to the appropriate test function.
|
| 1324 |
+
|
| 1325 |
+
Parameters
|
| 1326 |
+
----------
|
| 1327 |
+
left, right : Index, Series, DataFrame, ExtensionArray, or np.ndarray
|
| 1328 |
+
The two items to be compared.
|
| 1329 |
+
**kwargs
|
| 1330 |
+
All keyword arguments are passed through to the underlying assert method.
|
| 1331 |
+
"""
|
| 1332 |
+
__tracebackhide__ = True
|
| 1333 |
+
|
| 1334 |
+
if isinstance(left, Index):
|
| 1335 |
+
assert_index_equal(left, right, **kwargs)
|
| 1336 |
+
if isinstance(left, (DatetimeIndex, TimedeltaIndex)):
|
| 1337 |
+
assert left.freq == right.freq, (left.freq, right.freq)
|
| 1338 |
+
elif isinstance(left, Series):
|
| 1339 |
+
assert_series_equal(left, right, **kwargs)
|
| 1340 |
+
elif isinstance(left, DataFrame):
|
| 1341 |
+
assert_frame_equal(left, right, **kwargs)
|
| 1342 |
+
elif isinstance(left, IntervalArray):
|
| 1343 |
+
assert_interval_array_equal(left, right, **kwargs)
|
| 1344 |
+
elif isinstance(left, PeriodArray):
|
| 1345 |
+
assert_period_array_equal(left, right, **kwargs)
|
| 1346 |
+
elif isinstance(left, DatetimeArray):
|
| 1347 |
+
assert_datetime_array_equal(left, right, **kwargs)
|
| 1348 |
+
elif isinstance(left, TimedeltaArray):
|
| 1349 |
+
assert_timedelta_array_equal(left, right, **kwargs)
|
| 1350 |
+
elif isinstance(left, ExtensionArray):
|
| 1351 |
+
assert_extension_array_equal(left, right, **kwargs)
|
| 1352 |
+
elif isinstance(left, np.ndarray):
|
| 1353 |
+
assert_numpy_array_equal(left, right, **kwargs)
|
| 1354 |
+
elif isinstance(left, str):
|
| 1355 |
+
assert kwargs == {}
|
| 1356 |
+
assert left == right
|
| 1357 |
+
else:
|
| 1358 |
+
assert kwargs == {}
|
| 1359 |
+
assert_almost_equal(left, right)
|
| 1360 |
+
|
| 1361 |
+
|
| 1362 |
+
def assert_sp_array_equal(left, right) -> None:
|
| 1363 |
+
"""
|
| 1364 |
+
Check that the left and right SparseArray are equal.
|
| 1365 |
+
|
| 1366 |
+
Parameters
|
| 1367 |
+
----------
|
| 1368 |
+
left : SparseArray
|
| 1369 |
+
right : SparseArray
|
| 1370 |
+
"""
|
| 1371 |
+
_check_isinstance(left, right, pd.arrays.SparseArray)
|
| 1372 |
+
|
| 1373 |
+
assert_numpy_array_equal(left.sp_values, right.sp_values)
|
| 1374 |
+
|
| 1375 |
+
# SparseIndex comparison
|
| 1376 |
+
assert isinstance(left.sp_index, SparseIndex)
|
| 1377 |
+
assert isinstance(right.sp_index, SparseIndex)
|
| 1378 |
+
|
| 1379 |
+
left_index = left.sp_index
|
| 1380 |
+
right_index = right.sp_index
|
| 1381 |
+
|
| 1382 |
+
if not left_index.equals(right_index):
|
| 1383 |
+
raise_assert_detail(
|
| 1384 |
+
"SparseArray.index", "index are not equal", left_index, right_index
|
| 1385 |
+
)
|
| 1386 |
+
else:
|
| 1387 |
+
# Just ensure a
|
| 1388 |
+
pass
|
| 1389 |
+
|
| 1390 |
+
assert_attr_equal("fill_value", left, right)
|
| 1391 |
+
assert_attr_equal("dtype", left, right)
|
| 1392 |
+
assert_numpy_array_equal(left.to_dense(), right.to_dense())
|
| 1393 |
+
|
| 1394 |
+
|
| 1395 |
+
def assert_contains_all(iterable, dic) -> None:
|
| 1396 |
+
for k in iterable:
|
| 1397 |
+
assert k in dic, f"Did not contain item: {repr(k)}"
|
| 1398 |
+
|
| 1399 |
+
|
| 1400 |
+
def assert_copy(iter1, iter2, **eql_kwargs) -> None:
|
| 1401 |
+
"""
|
| 1402 |
+
iter1, iter2: iterables that produce elements
|
| 1403 |
+
comparable with assert_almost_equal
|
| 1404 |
+
|
| 1405 |
+
Checks that the elements are equal, but not
|
| 1406 |
+
the same object. (Does not check that items
|
| 1407 |
+
in sequences are also not the same object)
|
| 1408 |
+
"""
|
| 1409 |
+
for elem1, elem2 in zip(iter1, iter2):
|
| 1410 |
+
assert_almost_equal(elem1, elem2, **eql_kwargs)
|
| 1411 |
+
msg = (
|
| 1412 |
+
f"Expected object {repr(type(elem1))} and object {repr(type(elem2))} to be "
|
| 1413 |
+
"different objects, but they were the same object."
|
| 1414 |
+
)
|
| 1415 |
+
assert elem1 is not elem2, msg
|
| 1416 |
+
|
| 1417 |
+
|
| 1418 |
+
def is_extension_array_dtype_and_needs_i8_conversion(
|
| 1419 |
+
left_dtype: DtypeObj, right_dtype: DtypeObj
|
| 1420 |
+
) -> bool:
|
| 1421 |
+
"""
|
| 1422 |
+
Checks that we have the combination of an ExtensionArraydtype and
|
| 1423 |
+
a dtype that should be converted to int64
|
| 1424 |
+
|
| 1425 |
+
Returns
|
| 1426 |
+
-------
|
| 1427 |
+
bool
|
| 1428 |
+
|
| 1429 |
+
Related to issue #37609
|
| 1430 |
+
"""
|
| 1431 |
+
return isinstance(left_dtype, ExtensionDtype) and needs_i8_conversion(right_dtype)
|
| 1432 |
+
|
| 1433 |
+
|
| 1434 |
+
def assert_indexing_slices_equivalent(ser: Series, l_slc: slice, i_slc: slice) -> None:
|
| 1435 |
+
"""
|
| 1436 |
+
Check that ser.iloc[i_slc] matches ser.loc[l_slc] and, if applicable,
|
| 1437 |
+
ser[l_slc].
|
| 1438 |
+
"""
|
| 1439 |
+
expected = ser.iloc[i_slc]
|
| 1440 |
+
|
| 1441 |
+
assert_series_equal(ser.loc[l_slc], expected)
|
| 1442 |
+
|
| 1443 |
+
if not is_integer_dtype(ser.index):
|
| 1444 |
+
# For integer indices, .loc and plain getitem are position-based.
|
| 1445 |
+
assert_series_equal(ser[l_slc], expected)
|
| 1446 |
+
|
| 1447 |
+
|
| 1448 |
+
def assert_metadata_equivalent(
|
| 1449 |
+
left: DataFrame | Series, right: DataFrame | Series | None = None
|
| 1450 |
+
) -> None:
|
| 1451 |
+
"""
|
| 1452 |
+
Check that ._metadata attributes are equivalent.
|
| 1453 |
+
"""
|
| 1454 |
+
for attr in left._metadata:
|
| 1455 |
+
val = getattr(left, attr, None)
|
| 1456 |
+
if right is None:
|
| 1457 |
+
assert val is None
|
| 1458 |
+
else:
|
| 1459 |
+
assert val == getattr(right, attr, None)
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_testing/compat.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Helpers for sharing tests between DataFrame/Series
|
| 3 |
+
"""
|
| 4 |
+
from __future__ import annotations
|
| 5 |
+
|
| 6 |
+
from typing import TYPE_CHECKING
|
| 7 |
+
|
| 8 |
+
from pandas import DataFrame
|
| 9 |
+
|
| 10 |
+
if TYPE_CHECKING:
|
| 11 |
+
from pandas._typing import DtypeObj
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
def get_dtype(obj) -> DtypeObj:
|
| 15 |
+
if isinstance(obj, DataFrame):
|
| 16 |
+
# Note: we are assuming only one column
|
| 17 |
+
return obj.dtypes.iat[0]
|
| 18 |
+
else:
|
| 19 |
+
return obj.dtype
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
def get_obj(df: DataFrame, klass):
|
| 23 |
+
"""
|
| 24 |
+
For sharing tests using frame_or_series, either return the DataFrame
|
| 25 |
+
unchanged or return it's first column as a Series.
|
| 26 |
+
"""
|
| 27 |
+
if klass is DataFrame:
|
| 28 |
+
return df
|
| 29 |
+
return df._ixs(0, axis=1)
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/_testing/contexts.py
ADDED
|
@@ -0,0 +1,261 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
from contextlib import contextmanager
|
| 4 |
+
import os
|
| 5 |
+
from pathlib import Path
|
| 6 |
+
import tempfile
|
| 7 |
+
from typing import (
|
| 8 |
+
IO,
|
| 9 |
+
TYPE_CHECKING,
|
| 10 |
+
Any,
|
| 11 |
+
)
|
| 12 |
+
import uuid
|
| 13 |
+
|
| 14 |
+
from pandas._config import using_copy_on_write
|
| 15 |
+
|
| 16 |
+
from pandas.compat import (
|
| 17 |
+
PYPY,
|
| 18 |
+
WARNING_CHECK_DISABLED,
|
| 19 |
+
)
|
| 20 |
+
from pandas.errors import ChainedAssignmentError
|
| 21 |
+
|
| 22 |
+
from pandas import set_option
|
| 23 |
+
|
| 24 |
+
from pandas.io.common import get_handle
|
| 25 |
+
|
| 26 |
+
if TYPE_CHECKING:
|
| 27 |
+
from collections.abc import Generator
|
| 28 |
+
|
| 29 |
+
from pandas._typing import (
|
| 30 |
+
BaseBuffer,
|
| 31 |
+
CompressionOptions,
|
| 32 |
+
FilePath,
|
| 33 |
+
)
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
@contextmanager
|
| 37 |
+
def decompress_file(
|
| 38 |
+
path: FilePath | BaseBuffer, compression: CompressionOptions
|
| 39 |
+
) -> Generator[IO[bytes], None, None]:
|
| 40 |
+
"""
|
| 41 |
+
Open a compressed file and return a file object.
|
| 42 |
+
|
| 43 |
+
Parameters
|
| 44 |
+
----------
|
| 45 |
+
path : str
|
| 46 |
+
The path where the file is read from.
|
| 47 |
+
|
| 48 |
+
compression : {'gzip', 'bz2', 'zip', 'xz', 'zstd', None}
|
| 49 |
+
Name of the decompression to use
|
| 50 |
+
|
| 51 |
+
Returns
|
| 52 |
+
-------
|
| 53 |
+
file object
|
| 54 |
+
"""
|
| 55 |
+
with get_handle(path, "rb", compression=compression, is_text=False) as handle:
|
| 56 |
+
yield handle.handle
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
@contextmanager
|
| 60 |
+
def set_timezone(tz: str) -> Generator[None, None, None]:
|
| 61 |
+
"""
|
| 62 |
+
Context manager for temporarily setting a timezone.
|
| 63 |
+
|
| 64 |
+
Parameters
|
| 65 |
+
----------
|
| 66 |
+
tz : str
|
| 67 |
+
A string representing a valid timezone.
|
| 68 |
+
|
| 69 |
+
Examples
|
| 70 |
+
--------
|
| 71 |
+
>>> from datetime import datetime
|
| 72 |
+
>>> from dateutil.tz import tzlocal
|
| 73 |
+
>>> tzlocal().tzname(datetime(2021, 1, 1)) # doctest: +SKIP
|
| 74 |
+
'IST'
|
| 75 |
+
|
| 76 |
+
>>> with set_timezone('US/Eastern'):
|
| 77 |
+
... tzlocal().tzname(datetime(2021, 1, 1))
|
| 78 |
+
...
|
| 79 |
+
'EST'
|
| 80 |
+
"""
|
| 81 |
+
import time
|
| 82 |
+
|
| 83 |
+
def setTZ(tz) -> None:
|
| 84 |
+
if hasattr(time, "tzset"):
|
| 85 |
+
if tz is None:
|
| 86 |
+
try:
|
| 87 |
+
del os.environ["TZ"]
|
| 88 |
+
except KeyError:
|
| 89 |
+
pass
|
| 90 |
+
else:
|
| 91 |
+
os.environ["TZ"] = tz
|
| 92 |
+
time.tzset()
|
| 93 |
+
|
| 94 |
+
orig_tz = os.environ.get("TZ")
|
| 95 |
+
setTZ(tz)
|
| 96 |
+
try:
|
| 97 |
+
yield
|
| 98 |
+
finally:
|
| 99 |
+
setTZ(orig_tz)
|
| 100 |
+
|
| 101 |
+
|
| 102 |
+
@contextmanager
|
| 103 |
+
def ensure_clean(
|
| 104 |
+
filename=None, return_filelike: bool = False, **kwargs: Any
|
| 105 |
+
) -> Generator[Any, None, None]:
|
| 106 |
+
"""
|
| 107 |
+
Gets a temporary path and agrees to remove on close.
|
| 108 |
+
|
| 109 |
+
This implementation does not use tempfile.mkstemp to avoid having a file handle.
|
| 110 |
+
If the code using the returned path wants to delete the file itself, windows
|
| 111 |
+
requires that no program has a file handle to it.
|
| 112 |
+
|
| 113 |
+
Parameters
|
| 114 |
+
----------
|
| 115 |
+
filename : str (optional)
|
| 116 |
+
suffix of the created file.
|
| 117 |
+
return_filelike : bool (default False)
|
| 118 |
+
if True, returns a file-like which is *always* cleaned. Necessary for
|
| 119 |
+
savefig and other functions which want to append extensions.
|
| 120 |
+
**kwargs
|
| 121 |
+
Additional keywords are passed to open().
|
| 122 |
+
|
| 123 |
+
"""
|
| 124 |
+
folder = Path(tempfile.gettempdir())
|
| 125 |
+
|
| 126 |
+
if filename is None:
|
| 127 |
+
filename = ""
|
| 128 |
+
filename = str(uuid.uuid4()) + filename
|
| 129 |
+
path = folder / filename
|
| 130 |
+
|
| 131 |
+
path.touch()
|
| 132 |
+
|
| 133 |
+
handle_or_str: str | IO = str(path)
|
| 134 |
+
encoding = kwargs.pop("encoding", None)
|
| 135 |
+
if return_filelike:
|
| 136 |
+
kwargs.setdefault("mode", "w+b")
|
| 137 |
+
if encoding is None and "b" not in kwargs["mode"]:
|
| 138 |
+
encoding = "utf-8"
|
| 139 |
+
handle_or_str = open(path, encoding=encoding, **kwargs)
|
| 140 |
+
|
| 141 |
+
try:
|
| 142 |
+
yield handle_or_str
|
| 143 |
+
finally:
|
| 144 |
+
if not isinstance(handle_or_str, str):
|
| 145 |
+
handle_or_str.close()
|
| 146 |
+
if path.is_file():
|
| 147 |
+
path.unlink()
|
| 148 |
+
|
| 149 |
+
|
| 150 |
+
@contextmanager
|
| 151 |
+
def with_csv_dialect(name: str, **kwargs) -> Generator[None, None, None]:
|
| 152 |
+
"""
|
| 153 |
+
Context manager to temporarily register a CSV dialect for parsing CSV.
|
| 154 |
+
|
| 155 |
+
Parameters
|
| 156 |
+
----------
|
| 157 |
+
name : str
|
| 158 |
+
The name of the dialect.
|
| 159 |
+
kwargs : mapping
|
| 160 |
+
The parameters for the dialect.
|
| 161 |
+
|
| 162 |
+
Raises
|
| 163 |
+
------
|
| 164 |
+
ValueError : the name of the dialect conflicts with a builtin one.
|
| 165 |
+
|
| 166 |
+
See Also
|
| 167 |
+
--------
|
| 168 |
+
csv : Python's CSV library.
|
| 169 |
+
"""
|
| 170 |
+
import csv
|
| 171 |
+
|
| 172 |
+
_BUILTIN_DIALECTS = {"excel", "excel-tab", "unix"}
|
| 173 |
+
|
| 174 |
+
if name in _BUILTIN_DIALECTS:
|
| 175 |
+
raise ValueError("Cannot override builtin dialect.")
|
| 176 |
+
|
| 177 |
+
csv.register_dialect(name, **kwargs)
|
| 178 |
+
try:
|
| 179 |
+
yield
|
| 180 |
+
finally:
|
| 181 |
+
csv.unregister_dialect(name)
|
| 182 |
+
|
| 183 |
+
|
| 184 |
+
@contextmanager
|
| 185 |
+
def use_numexpr(use, min_elements=None) -> Generator[None, None, None]:
|
| 186 |
+
from pandas.core.computation import expressions as expr
|
| 187 |
+
|
| 188 |
+
if min_elements is None:
|
| 189 |
+
min_elements = expr._MIN_ELEMENTS
|
| 190 |
+
|
| 191 |
+
olduse = expr.USE_NUMEXPR
|
| 192 |
+
oldmin = expr._MIN_ELEMENTS
|
| 193 |
+
set_option("compute.use_numexpr", use)
|
| 194 |
+
expr._MIN_ELEMENTS = min_elements
|
| 195 |
+
try:
|
| 196 |
+
yield
|
| 197 |
+
finally:
|
| 198 |
+
expr._MIN_ELEMENTS = oldmin
|
| 199 |
+
set_option("compute.use_numexpr", olduse)
|
| 200 |
+
|
| 201 |
+
|
| 202 |
+
def raises_chained_assignment_error(warn=True, extra_warnings=(), extra_match=()):
|
| 203 |
+
from pandas._testing import assert_produces_warning
|
| 204 |
+
|
| 205 |
+
if not warn:
|
| 206 |
+
from contextlib import nullcontext
|
| 207 |
+
|
| 208 |
+
return nullcontext()
|
| 209 |
+
|
| 210 |
+
if (PYPY or WARNING_CHECK_DISABLED) and not extra_warnings:
|
| 211 |
+
from contextlib import nullcontext
|
| 212 |
+
|
| 213 |
+
return nullcontext()
|
| 214 |
+
elif (PYPY or WARNING_CHECK_DISABLED) and extra_warnings:
|
| 215 |
+
return assert_produces_warning(
|
| 216 |
+
extra_warnings,
|
| 217 |
+
match="|".join(extra_match),
|
| 218 |
+
)
|
| 219 |
+
else:
|
| 220 |
+
if using_copy_on_write():
|
| 221 |
+
warning = ChainedAssignmentError
|
| 222 |
+
match = (
|
| 223 |
+
"A value is trying to be set on a copy of a DataFrame or Series "
|
| 224 |
+
"through chained assignment"
|
| 225 |
+
)
|
| 226 |
+
else:
|
| 227 |
+
warning = FutureWarning # type: ignore[assignment]
|
| 228 |
+
# TODO update match
|
| 229 |
+
match = "ChainedAssignmentError"
|
| 230 |
+
if extra_warnings:
|
| 231 |
+
warning = (warning, *extra_warnings) # type: ignore[assignment]
|
| 232 |
+
return assert_produces_warning(
|
| 233 |
+
warning,
|
| 234 |
+
match="|".join((match, *extra_match)),
|
| 235 |
+
)
|
| 236 |
+
|
| 237 |
+
|
| 238 |
+
def assert_cow_warning(warn=True, match=None, **kwargs):
|
| 239 |
+
"""
|
| 240 |
+
Assert that a warning is raised in the CoW warning mode.
|
| 241 |
+
|
| 242 |
+
Parameters
|
| 243 |
+
----------
|
| 244 |
+
warn : bool, default True
|
| 245 |
+
By default, check that a warning is raised. Can be turned off by passing False.
|
| 246 |
+
match : str
|
| 247 |
+
The warning message to match against, if different from the default.
|
| 248 |
+
kwargs
|
| 249 |
+
Passed through to assert_produces_warning
|
| 250 |
+
"""
|
| 251 |
+
from pandas._testing import assert_produces_warning
|
| 252 |
+
|
| 253 |
+
if not warn or WARNING_CHECK_DISABLED:
|
| 254 |
+
from contextlib import nullcontext
|
| 255 |
+
|
| 256 |
+
return nullcontext()
|
| 257 |
+
|
| 258 |
+
if not match:
|
| 259 |
+
match = "Setting a value on a view"
|
| 260 |
+
|
| 261 |
+
return assert_produces_warning(FutureWarning, match=match, **kwargs)
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/core/arrays/__init__.py
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from pandas.core.arrays.arrow import ArrowExtensionArray
|
| 2 |
+
from pandas.core.arrays.base import (
|
| 3 |
+
ExtensionArray,
|
| 4 |
+
ExtensionOpsMixin,
|
| 5 |
+
ExtensionScalarOpsMixin,
|
| 6 |
+
)
|
| 7 |
+
from pandas.core.arrays.boolean import BooleanArray
|
| 8 |
+
from pandas.core.arrays.categorical import Categorical
|
| 9 |
+
from pandas.core.arrays.datetimes import DatetimeArray
|
| 10 |
+
from pandas.core.arrays.floating import FloatingArray
|
| 11 |
+
from pandas.core.arrays.integer import IntegerArray
|
| 12 |
+
from pandas.core.arrays.interval import IntervalArray
|
| 13 |
+
from pandas.core.arrays.masked import BaseMaskedArray
|
| 14 |
+
from pandas.core.arrays.numpy_ import NumpyExtensionArray
|
| 15 |
+
from pandas.core.arrays.period import (
|
| 16 |
+
PeriodArray,
|
| 17 |
+
period_array,
|
| 18 |
+
)
|
| 19 |
+
from pandas.core.arrays.sparse import SparseArray
|
| 20 |
+
from pandas.core.arrays.string_ import StringArray
|
| 21 |
+
from pandas.core.arrays.string_arrow import ArrowStringArray
|
| 22 |
+
from pandas.core.arrays.timedeltas import TimedeltaArray
|
| 23 |
+
|
| 24 |
+
__all__ = [
|
| 25 |
+
"ArrowExtensionArray",
|
| 26 |
+
"ExtensionArray",
|
| 27 |
+
"ExtensionOpsMixin",
|
| 28 |
+
"ExtensionScalarOpsMixin",
|
| 29 |
+
"ArrowStringArray",
|
| 30 |
+
"BaseMaskedArray",
|
| 31 |
+
"BooleanArray",
|
| 32 |
+
"Categorical",
|
| 33 |
+
"DatetimeArray",
|
| 34 |
+
"FloatingArray",
|
| 35 |
+
"IntegerArray",
|
| 36 |
+
"IntervalArray",
|
| 37 |
+
"NumpyExtensionArray",
|
| 38 |
+
"PeriodArray",
|
| 39 |
+
"period_array",
|
| 40 |
+
"SparseArray",
|
| 41 |
+
"StringArray",
|
| 42 |
+
"TimedeltaArray",
|
| 43 |
+
]
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/core/arrays/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (1.4 kB). View file
|
|
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/core/arrays/__pycache__/_arrow_string_mixins.cpython-310.pyc
ADDED
|
Binary file (12 kB). View file
|
|
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/core/arrays/__pycache__/_mixins.cpython-310.pyc
ADDED
|
Binary file (14.3 kB). View file
|
|
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/core/arrays/__pycache__/_ranges.cpython-310.pyc
ADDED
|
Binary file (4.89 kB). View file
|
|
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/core/arrays/__pycache__/_utils.cpython-310.pyc
ADDED
|
Binary file (1.45 kB). View file
|
|
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/core/arrays/__pycache__/base.cpython-310.pyc
ADDED
|
Binary file (75 kB). View file
|
|
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/core/arrays/__pycache__/boolean.cpython-310.pyc
ADDED
|
Binary file (10.6 kB). View file
|
|
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/core/arrays/__pycache__/categorical.cpython-310.pyc
ADDED
|
Binary file (82 kB). View file
|
|
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/core/arrays/__pycache__/datetimelike.cpython-310.pyc
ADDED
|
Binary file (64.1 kB). View file
|
|
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/core/arrays/__pycache__/datetimes.cpython-310.pyc
ADDED
|
Binary file (70.9 kB). View file
|
|
|
Scripts_Climate_n_LAI_to_Yield/.venv/lib/python3.10/site-packages/pandas/core/arrays/__pycache__/floating.cpython-310.pyc
ADDED
|
Binary file (4.74 kB). View file
|
|
|