Skip to content

Commit 77f3f90

Browse files
authored
Merge pull request #1 from iwmihq/modeltest
tested dam model
2 parents 20dd587 + dd8b83d commit 77f3f90

File tree

693 files changed

+279185
-5
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

693 files changed

+279185
-5
lines changed

Use_cases/README.md

Lines changed: 0 additions & 5 deletions
This file was deleted.
57.7 KB
Loading
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
import sys
2+
import os
3+
import re
4+
import importlib
5+
import warnings
6+
7+
8+
is_pypy = '__pypy__' in sys.builtin_module_names
9+
10+
11+
warnings.filterwarnings('ignore',
12+
'.+ distutils .+ deprecated',
13+
DeprecationWarning)
14+
15+
16+
def warn_distutils_present():
17+
if 'distutils' not in sys.modules:
18+
return
19+
if is_pypy and sys.version_info < (3, 7):
20+
# PyPy for 3.6 unconditionally imports distutils, so bypass the warning
21+
# https://foss.heptapod.net/pypy/pypy/-/blob/be829135bc0d758997b3566062999ee8b23872b4/lib-python/3/site.py#L250
22+
return
23+
warnings.warn(
24+
"Distutils was imported before Setuptools, but importing Setuptools "
25+
"also replaces the `distutils` module in `sys.modules`. This may lead "
26+
"to undesirable behaviors or errors. To avoid these issues, avoid "
27+
"using distutils directly, ensure that setuptools is installed in the "
28+
"traditional way (e.g. not an editable install), and/or make sure "
29+
"that setuptools is always imported before distutils.")
30+
31+
32+
def clear_distutils():
33+
if 'distutils' not in sys.modules:
34+
return
35+
warnings.warn("Setuptools is replacing distutils.")
36+
mods = [name for name in sys.modules if re.match(r'distutils\b', name)]
37+
for name in mods:
38+
del sys.modules[name]
39+
40+
41+
def enabled():
42+
"""
43+
Allow selection of distutils by environment variable.
44+
"""
45+
which = os.environ.get('SETUPTOOLS_USE_DISTUTILS', 'stdlib')
46+
return which == 'local'
47+
48+
49+
def ensure_local_distutils():
50+
clear_distutils()
51+
distutils = importlib.import_module('setuptools._distutils')
52+
distutils.__name__ = 'distutils'
53+
sys.modules['distutils'] = distutils
54+
55+
# sanity check that submodules load as expected
56+
core = importlib.import_module('distutils.core')
57+
assert '_distutils' in core.__file__, core.__file__
58+
59+
60+
def do_override():
61+
"""
62+
Ensure that the local copy of distutils is preferred over stdlib.
63+
64+
See https://github.com/pypa/setuptools/issues/417#issuecomment-392298401
65+
for more motivation.
66+
"""
67+
if enabled():
68+
warn_distutils_present()
69+
ensure_local_distutils()
70+
71+
72+
class DistutilsMetaFinder:
73+
def find_spec(self, fullname, path, target=None):
74+
if path is not None:
75+
return
76+
77+
method_name = 'spec_for_{fullname}'.format(**locals())
78+
method = getattr(self, method_name, lambda: None)
79+
return method()
80+
81+
def spec_for_distutils(self):
82+
import importlib.abc
83+
import importlib.util
84+
85+
class DistutilsLoader(importlib.abc.Loader):
86+
87+
def create_module(self, spec):
88+
return importlib.import_module('setuptools._distutils')
89+
90+
def exec_module(self, module):
91+
pass
92+
93+
return importlib.util.spec_from_loader('distutils', DistutilsLoader())
94+
95+
def spec_for_pip(self):
96+
"""
97+
Ensure stdlib distutils when running under pip.
98+
See pypa/pip#8761 for rationale.
99+
"""
100+
if self.pip_imported_during_build():
101+
return
102+
clear_distutils()
103+
self.spec_for_distutils = lambda: None
104+
105+
@staticmethod
106+
def pip_imported_during_build():
107+
"""
108+
Detect if pip is being imported in a build script. Ref #2355.
109+
"""
110+
import traceback
111+
return any(
112+
frame.f_globals['__file__'].endswith('setup.py')
113+
for frame, line in traceback.walk_stack(None)
114+
)
115+
116+
117+
DISTUTILS_FINDER = DistutilsMetaFinder()
118+
119+
120+
def add_shim():
121+
sys.meta_path.insert(0, DISTUTILS_FINDER)
122+
123+
124+
def remove_shim():
125+
try:
126+
sys.meta_path.remove(DISTUTILS_FINDER)
127+
except ValueError:
128+
pass
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__import__('_distutils_hack').do_override()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import os; var = 'SETUPTOOLS_USE_DISTUTILS'; enabled = os.environ.get(var, 'stdlib') == 'local'; enabled and __import__('_distutils_hack').add_shim();
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pip
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright (c) 2008-present The pip developers (see AUTHORS.txt file)
2+
3+
Permission is hereby granted, free of charge, to any person obtaining
4+
a copy of this software and associated documentation files (the
5+
"Software"), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish,
7+
distribute, sublicense, and/or sell copies of the Software, and to
8+
permit persons to whom the Software is furnished to do so, subject to
9+
the following conditions:
10+
11+
The above copyright notice and this permission notice shall be
12+
included in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
Metadata-Version: 2.1
2+
Name: pip
3+
Version: 23.0.1
4+
Summary: The PyPA recommended tool for installing Python packages.
5+
Home-page: https://pip.pypa.io/
6+
Author: The pip developers
7+
Author-email: distutils-sig@python.org
8+
License: MIT
9+
Project-URL: Documentation, https://pip.pypa.io
10+
Project-URL: Source, https://github.com/pypa/pip
11+
Project-URL: Changelog, https://pip.pypa.io/en/stable/news/
12+
Classifier: Development Status :: 5 - Production/Stable
13+
Classifier: Intended Audience :: Developers
14+
Classifier: License :: OSI Approved :: MIT License
15+
Classifier: Topic :: Software Development :: Build Tools
16+
Classifier: Programming Language :: Python
17+
Classifier: Programming Language :: Python :: 3
18+
Classifier: Programming Language :: Python :: 3 :: Only
19+
Classifier: Programming Language :: Python :: 3.7
20+
Classifier: Programming Language :: Python :: 3.8
21+
Classifier: Programming Language :: Python :: 3.9
22+
Classifier: Programming Language :: Python :: 3.10
23+
Classifier: Programming Language :: Python :: 3.11
24+
Classifier: Programming Language :: Python :: Implementation :: CPython
25+
Classifier: Programming Language :: Python :: Implementation :: PyPy
26+
Requires-Python: >=3.7
27+
License-File: LICENSE.txt
28+
29+
pip - The Python Package Installer
30+
==================================
31+
32+
.. image:: https://img.shields.io/pypi/v/pip.svg
33+
:target: https://pypi.org/project/pip/
34+
35+
.. image:: https://readthedocs.org/projects/pip/badge/?version=latest
36+
:target: https://pip.pypa.io/en/latest
37+
38+
pip is the `package installer`_ for Python. You can use pip to install packages from the `Python Package Index`_ and other indexes.
39+
40+
Please take a look at our documentation for how to install and use pip:
41+
42+
* `Installation`_
43+
* `Usage`_
44+
45+
We release updates regularly, with a new version every 3 months. Find more details in our documentation:
46+
47+
* `Release notes`_
48+
* `Release process`_
49+
50+
In pip 20.3, we've `made a big improvement to the heart of pip`_; `learn more`_. We want your input, so `sign up for our user experience research studies`_ to help us do it right.
51+
52+
**Note**: pip 21.0, in January 2021, removed Python 2 support, per pip's `Python 2 support policy`_. Please migrate to Python 3.
53+
54+
If you find bugs, need help, or want to talk to the developers, please use our mailing lists or chat rooms:
55+
56+
* `Issue tracking`_
57+
* `Discourse channel`_
58+
* `User IRC`_
59+
60+
If you want to get involved head over to GitHub to get the source code, look at our development documentation and feel free to jump on the developer mailing lists and chat rooms:
61+
62+
* `GitHub page`_
63+
* `Development documentation`_
64+
* `Development IRC`_
65+
66+
Code of Conduct
67+
---------------
68+
69+
Everyone interacting in the pip project's codebases, issue trackers, chat
70+
rooms, and mailing lists is expected to follow the `PSF Code of Conduct`_.
71+
72+
.. _package installer: https://packaging.python.org/guides/tool-recommendations/
73+
.. _Python Package Index: https://pypi.org
74+
.. _Installation: https://pip.pypa.io/en/stable/installation/
75+
.. _Usage: https://pip.pypa.io/en/stable/
76+
.. _Release notes: https://pip.pypa.io/en/stable/news.html
77+
.. _Release process: https://pip.pypa.io/en/latest/development/release-process/
78+
.. _GitHub page: https://github.com/pypa/pip
79+
.. _Development documentation: https://pip.pypa.io/en/latest/development
80+
.. _made a big improvement to the heart of pip: https://pyfound.blogspot.com/2020/11/pip-20-3-new-resolver.html
81+
.. _learn more: https://pip.pypa.io/en/latest/user_guide/#changes-to-the-pip-dependency-resolver-in-20-3-2020
82+
.. _sign up for our user experience research studies: https://pyfound.blogspot.com/2020/03/new-pip-resolver-to-roll-out-this-year.html
83+
.. _Python 2 support policy: https://pip.pypa.io/en/latest/development/release-process/#python-2-support
84+
.. _Issue tracking: https://github.com/pypa/pip/issues
85+
.. _Discourse channel: https://discuss.python.org/c/packaging
86+
.. _User IRC: https://kiwiirc.com/nextclient/#ircs://irc.libera.chat:+6697/pypa
87+
.. _Development IRC: https://kiwiirc.com/nextclient/#ircs://irc.libera.chat:+6697/pypa-dev
88+
.. _PSF Code of Conduct: https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md

0 commit comments

Comments
 (0)