Skip to content

Commit 8801167

Browse files
cached .venv files suppression
1 parent ace2ee0 commit 8801167

466 files changed

Lines changed: 120618 additions & 269 deletions

File tree

Some content is hidden

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

.gitignore

Lines changed: 466 additions & 0 deletions
Large diffs are not rendered by default.

.venv/bin/get_gprof

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#!/home/clif_lastrophysicien/ELO2_LAPERLE_HT/.venv/bin/python3
2+
#
3+
# Author: Mike McKerns (mmckerns @caltech and @uqfoundation)
4+
# Copyright (c) 2008-2016 California Institute of Technology.
5+
# Copyright (c) 2016-2025 The Uncertainty Quantification Foundation.
6+
# License: 3-clause BSD. The full license text is available at:
7+
# - https://github.com/uqfoundation/dill/blob/master/LICENSE
8+
'''
9+
build profile graph for the given instance
10+
11+
running:
12+
$ get_gprof <args> <instance>
13+
14+
executes:
15+
gprof2dot -f pstats <args> <type>.prof | dot -Tpng -o <type>.call.png
16+
17+
where:
18+
<args> are arguments for gprof2dot, such as "-n 5 -e 5"
19+
<instance> is code to create the instance to profile
20+
<type> is the class of the instance (i.e. type(instance))
21+
22+
For example:
23+
$ get_gprof -n 5 -e 1 "import numpy; numpy.array([1,2])"
24+
25+
will create 'ndarray.call.png' with the profile graph for numpy.array([1,2]),
26+
where '-n 5' eliminates nodes below 5% threshold, similarly '-e 1' eliminates
27+
edges below 1% threshold
28+
'''
29+
30+
if __name__ == "__main__":
31+
import sys
32+
if len(sys.argv) < 2:
33+
print ("Please provide an object instance (e.g. 'import math; math.pi')")
34+
sys.exit()
35+
# grab args for gprof2dot
36+
args = sys.argv[1:-1]
37+
args = ' '.join(args)
38+
# last arg builds the object
39+
obj = sys.argv[-1]
40+
obj = obj.split(';')
41+
# multi-line prep for generating an instance
42+
for line in obj[:-1]:
43+
exec(line)
44+
# one-line generation of an instance
45+
try:
46+
obj = eval(obj[-1])
47+
except Exception:
48+
print ("Error processing object instance")
49+
sys.exit()
50+
51+
# get object 'name'
52+
objtype = type(obj)
53+
name = getattr(objtype, '__name__', getattr(objtype, '__class__', objtype))
54+
55+
# profile dumping an object
56+
import dill
57+
import os
58+
import cProfile
59+
#name = os.path.splitext(os.path.basename(__file__))[0]
60+
cProfile.run("dill.dumps(obj)", filename="%s.prof" % name)
61+
msg = "gprof2dot -f pstats %s %s.prof | dot -Tpng -o %s.call.png" % (args, name, name)
62+
try:
63+
res = os.system(msg)
64+
except Exception:
65+
print ("Please verify install of 'gprof2dot' to view profile graphs")
66+
if res:
67+
print ("Please verify install of 'gprof2dot' to view profile graphs")
68+
69+
# get stats
70+
f_prof = "%s.prof" % name
71+
import pstats
72+
stats = pstats.Stats(f_prof, stream=sys.stdout)
73+
stats.strip_dirs().sort_stats('cumtime')
74+
stats.print_stats(20) #XXX: save to file instead of print top 20?
75+
os.remove(f_prof)

.venv/bin/get_objgraph

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/home/clif_lastrophysicien/ELO2_LAPERLE_HT/.venv/bin/python3
2+
#
3+
# Author: Mike McKerns (mmckerns @caltech and @uqfoundation)
4+
# Copyright (c) 2008-2016 California Institute of Technology.
5+
# Copyright (c) 2016-2025 The Uncertainty Quantification Foundation.
6+
# License: 3-clause BSD. The full license text is available at:
7+
# - https://github.com/uqfoundation/dill/blob/master/LICENSE
8+
"""
9+
display the reference paths for objects in ``dill.types`` or a .pkl file
10+
11+
Notes:
12+
the generated image is useful in showing the pointer references in
13+
objects that are or can be pickled. Any object in ``dill.objects``
14+
listed in ``dill.load_types(picklable=True, unpicklable=True)`` works.
15+
16+
Examples::
17+
18+
$ get_objgraph ArrayType
19+
Image generated as ArrayType.png
20+
"""
21+
22+
import dill as pickle
23+
#pickle.debug.trace(True)
24+
#import pickle
25+
26+
# get all objects for testing
27+
from dill import load_types
28+
load_types(pickleable=True,unpickleable=True)
29+
from dill import objects
30+
31+
if __name__ == "__main__":
32+
import sys
33+
if len(sys.argv) != 2:
34+
print ("Please provide exactly one file or type name (e.g. 'IntType')")
35+
msg = "\n"
36+
for objtype in list(objects.keys())[:40]:
37+
msg += objtype + ', '
38+
print (msg + "...")
39+
else:
40+
objtype = str(sys.argv[-1])
41+
try:
42+
obj = objects[objtype]
43+
except KeyError:
44+
obj = pickle.load(open(objtype,'rb'))
45+
import os
46+
objtype = os.path.splitext(objtype)[0]
47+
try:
48+
import objgraph
49+
objgraph.show_refs(obj, filename=objtype+'.png')
50+
except ImportError:
51+
print ("Please install 'objgraph' to view object graphs")
52+
53+
54+
# EOF

.venv/bin/isort

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/home/clif_lastrophysicien/ELO2_LAPERLE_HT/.venv/bin/python3
2+
import sys
3+
from isort.main import main
4+
if __name__ == '__main__':
5+
if sys.argv[0].endswith('.exe'):
6+
sys.argv[0] = sys.argv[0][:-4]
7+
sys.exit(main())

.venv/bin/isort-identify-imports

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/home/clif_lastrophysicien/ELO2_LAPERLE_HT/.venv/bin/python3
2+
import sys
3+
from isort.main import identify_imports_main
4+
if __name__ == '__main__':
5+
if sys.argv[0].endswith('.exe'):
6+
sys.argv[0] = sys.argv[0][:-4]
7+
sys.exit(identify_imports_main())

.venv/bin/pylint

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/home/clif_lastrophysicien/ELO2_LAPERLE_HT/.venv/bin/python3
2+
import sys
3+
from pylint import run_pylint
4+
if __name__ == '__main__':
5+
if sys.argv[0].endswith('.exe'):
6+
sys.argv[0] = sys.argv[0][:-4]
7+
sys.exit(run_pylint())

.venv/bin/pylint-config

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/home/clif_lastrophysicien/ELO2_LAPERLE_HT/.venv/bin/python3
2+
import sys
3+
from pylint import _run_pylint_config
4+
if __name__ == '__main__':
5+
if sys.argv[0].endswith('.exe'):
6+
sys.argv[0] = sys.argv[0][:-4]
7+
sys.exit(_run_pylint_config())

.venv/bin/pyreverse

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/home/clif_lastrophysicien/ELO2_LAPERLE_HT/.venv/bin/python3
2+
import sys
3+
from pylint import run_pyreverse
4+
if __name__ == '__main__':
5+
if sys.argv[0].endswith('.exe'):
6+
sys.argv[0] = sys.argv[0][:-4]
7+
sys.exit(run_pyreverse())

.venv/bin/symilar

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/home/clif_lastrophysicien/ELO2_LAPERLE_HT/.venv/bin/python3
2+
import sys
3+
from pylint import run_symilar
4+
if __name__ == '__main__':
5+
if sys.argv[0].endswith('.exe'):
6+
sys.argv[0] = sys.argv[0][:-4]
7+
sys.exit(run_symilar())

.venv/bin/undill

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/home/clif_lastrophysicien/ELO2_LAPERLE_HT/.venv/bin/python3
2+
#
3+
# Author: Mike McKerns (mmckerns @caltech and @uqfoundation)
4+
# Copyright (c) 2008-2016 California Institute of Technology.
5+
# Copyright (c) 2016-2025 The Uncertainty Quantification Foundation.
6+
# License: 3-clause BSD. The full license text is available at:
7+
# - https://github.com/uqfoundation/dill/blob/master/LICENSE
8+
"""
9+
unpickle the contents of a pickled object file
10+
11+
Examples::
12+
13+
$ undill hello.pkl
14+
['hello', 'world']
15+
"""
16+
17+
if __name__ == '__main__':
18+
import sys
19+
import dill
20+
for file in sys.argv[1:]:
21+
print (dill.load(open(file,'rb')))
22+

0 commit comments

Comments
 (0)