Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 9 additions & 3 deletions .ls-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,20 @@ ls:
.md: snake_case | regex:[0-9A-Z\-]+
.txt: snake_case | kebab-case
.yml: snake_case | kebab-case
.ipynb: snake_case
.csv: snake_case
.py: snake_case

ignore:
- .git
- .github
- .vscode
- venv
- .ruff_cache
- .pytest_cache
- __pycache__
- .ls-lint.yml
- .markdownlint.yml
- .venv
- **/site-packages/**
- 1_datasets
- data
- dist
- build
75 changes: 75 additions & 0 deletions .venv/bin/get_gprof
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#!/home/clif_lastrophysicien/ELO2_LAPERLE_HT/.venv/bin/python3
#
# Author: Mike McKerns (mmckerns @caltech and @uqfoundation)
# Copyright (c) 2008-2016 California Institute of Technology.
# Copyright (c) 2016-2025 The Uncertainty Quantification Foundation.
# License: 3-clause BSD. The full license text is available at:
# - https://github.com/uqfoundation/dill/blob/master/LICENSE
'''
build profile graph for the given instance

running:
$ get_gprof <args> <instance>

executes:
gprof2dot -f pstats <args> <type>.prof | dot -Tpng -o <type>.call.png

where:
<args> are arguments for gprof2dot, such as "-n 5 -e 5"
<instance> is code to create the instance to profile
<type> is the class of the instance (i.e. type(instance))

For example:
$ get_gprof -n 5 -e 1 "import numpy; numpy.array([1,2])"

will create 'ndarray.call.png' with the profile graph for numpy.array([1,2]),
where '-n 5' eliminates nodes below 5% threshold, similarly '-e 1' eliminates
edges below 1% threshold
'''

if __name__ == "__main__":
import sys
if len(sys.argv) < 2:
print ("Please provide an object instance (e.g. 'import math; math.pi')")
sys.exit()
# grab args for gprof2dot
args = sys.argv[1:-1]
args = ' '.join(args)
# last arg builds the object
obj = sys.argv[-1]
obj = obj.split(';')
# multi-line prep for generating an instance
for line in obj[:-1]:
exec(line)
# one-line generation of an instance
try:
obj = eval(obj[-1])
except Exception:
print ("Error processing object instance")
sys.exit()

# get object 'name'
objtype = type(obj)
name = getattr(objtype, '__name__', getattr(objtype, '__class__', objtype))

# profile dumping an object
import dill
import os
import cProfile
#name = os.path.splitext(os.path.basename(__file__))[0]
cProfile.run("dill.dumps(obj)", filename="%s.prof" % name)
msg = "gprof2dot -f pstats %s %s.prof | dot -Tpng -o %s.call.png" % (args, name, name)
try:
res = os.system(msg)
except Exception:
print ("Please verify install of 'gprof2dot' to view profile graphs")
if res:
print ("Please verify install of 'gprof2dot' to view profile graphs")

# get stats
f_prof = "%s.prof" % name
import pstats
stats = pstats.Stats(f_prof, stream=sys.stdout)
stats.strip_dirs().sort_stats('cumtime')
stats.print_stats(20) #XXX: save to file instead of print top 20?
os.remove(f_prof)
54 changes: 54 additions & 0 deletions .venv/bin/get_objgraph
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/home/clif_lastrophysicien/ELO2_LAPERLE_HT/.venv/bin/python3
#
# Author: Mike McKerns (mmckerns @caltech and @uqfoundation)
# Copyright (c) 2008-2016 California Institute of Technology.
# Copyright (c) 2016-2025 The Uncertainty Quantification Foundation.
# License: 3-clause BSD. The full license text is available at:
# - https://github.com/uqfoundation/dill/blob/master/LICENSE
"""
display the reference paths for objects in ``dill.types`` or a .pkl file

Notes:
the generated image is useful in showing the pointer references in
objects that are or can be pickled. Any object in ``dill.objects``
listed in ``dill.load_types(picklable=True, unpicklable=True)`` works.

Examples::

$ get_objgraph ArrayType
Image generated as ArrayType.png
"""

import dill as pickle
#pickle.debug.trace(True)
#import pickle

# get all objects for testing
from dill import load_types
load_types(pickleable=True,unpickleable=True)
from dill import objects

if __name__ == "__main__":
import sys
if len(sys.argv) != 2:
print ("Please provide exactly one file or type name (e.g. 'IntType')")
msg = "\n"
for objtype in list(objects.keys())[:40]:
msg += objtype + ', '
print (msg + "...")
else:
objtype = str(sys.argv[-1])
try:
obj = objects[objtype]
except KeyError:
obj = pickle.load(open(objtype,'rb'))
import os
objtype = os.path.splitext(objtype)[0]
try:
import objgraph
objgraph.show_refs(obj, filename=objtype+'.png')
except ImportError:
print ("Please install 'objgraph' to view object graphs")


# EOF
7 changes: 7 additions & 0 deletions .venv/bin/isort
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/home/clif_lastrophysicien/ELO2_LAPERLE_HT/.venv/bin/python3
import sys
from isort.main import main
if __name__ == '__main__':
if sys.argv[0].endswith('.exe'):
sys.argv[0] = sys.argv[0][:-4]
sys.exit(main())
7 changes: 7 additions & 0 deletions .venv/bin/isort-identify-imports
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/home/clif_lastrophysicien/ELO2_LAPERLE_HT/.venv/bin/python3
import sys
from isort.main import identify_imports_main
if __name__ == '__main__':
if sys.argv[0].endswith('.exe'):
sys.argv[0] = sys.argv[0][:-4]
sys.exit(identify_imports_main())
7 changes: 7 additions & 0 deletions .venv/bin/pylint
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/home/clif_lastrophysicien/ELO2_LAPERLE_HT/.venv/bin/python3
import sys
from pylint import run_pylint
if __name__ == '__main__':
if sys.argv[0].endswith('.exe'):
sys.argv[0] = sys.argv[0][:-4]
sys.exit(run_pylint())
7 changes: 7 additions & 0 deletions .venv/bin/pylint-config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/home/clif_lastrophysicien/ELO2_LAPERLE_HT/.venv/bin/python3
import sys
from pylint import _run_pylint_config
if __name__ == '__main__':
if sys.argv[0].endswith('.exe'):
sys.argv[0] = sys.argv[0][:-4]
sys.exit(_run_pylint_config())
7 changes: 7 additions & 0 deletions .venv/bin/pyreverse
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/home/clif_lastrophysicien/ELO2_LAPERLE_HT/.venv/bin/python3
import sys
from pylint import run_pyreverse
if __name__ == '__main__':
if sys.argv[0].endswith('.exe'):
sys.argv[0] = sys.argv[0][:-4]
sys.exit(run_pyreverse())
7 changes: 7 additions & 0 deletions .venv/bin/symilar
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/home/clif_lastrophysicien/ELO2_LAPERLE_HT/.venv/bin/python3
import sys
from pylint import run_symilar
if __name__ == '__main__':
if sys.argv[0].endswith('.exe'):
sys.argv[0] = sys.argv[0][:-4]
sys.exit(run_symilar())
22 changes: 22 additions & 0 deletions .venv/bin/undill
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/home/clif_lastrophysicien/ELO2_LAPERLE_HT/.venv/bin/python3
#
# Author: Mike McKerns (mmckerns @caltech and @uqfoundation)
# Copyright (c) 2008-2016 California Institute of Technology.
# Copyright (c) 2016-2025 The Uncertainty Quantification Foundation.
# License: 3-clause BSD. The full license text is available at:
# - https://github.com/uqfoundation/dill/blob/master/LICENSE
"""
unpickle the contents of a pickled object file

Examples::

$ undill hello.pkl
['hello', 'world']
"""

if __name__ == '__main__':
import sys
import dill
for file in sys.argv[1:]:
print (dill.load(open(file,'rb')))

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pip
122 changes: 122 additions & 0 deletions .venv/lib/python3.10/site-packages/astroid-4.0.2.dist-info/METADATA
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
Metadata-Version: 2.4
Name: astroid
Version: 4.0.2
Summary: An abstract syntax tree for Python with inference support.
License-Expression: LGPL-2.1-or-later
Project-URL: Bug tracker, https://github.com/pylint-dev/astroid/issues
Project-URL: Discord server, https://discord.gg/Egy6P8AMB5
Project-URL: Docs, https://pylint.readthedocs.io/projects/astroid/en/latest/
Project-URL: Source Code, https://github.com/pylint-dev/astroid
Keywords: abstract syntax tree,python,static code analysis
Classifier: Development Status :: 6 - Mature
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.10.0
Description-Content-Type: text/x-rst
License-File: LICENSE
License-File: CONTRIBUTORS.txt
Requires-Dist: typing-extensions>=4; python_version < "3.11"
Dynamic: license-file

Astroid
=======

.. image:: https://codecov.io/gh/pylint-dev/astroid/branch/main/graph/badge.svg?token=Buxy4WptLb
:target: https://codecov.io/gh/pylint-dev/astroid
:alt: Coverage badge from codecov

.. image:: https://readthedocs.org/projects/astroid/badge/?version=latest
:target: http://astroid.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/ambv/black

.. image:: https://results.pre-commit.ci/badge/github/pylint-dev/astroid/main.svg
:target: https://results.pre-commit.ci/latest/github/pylint-dev/astroid/main
:alt: pre-commit.ci status

.. |tidelift_logo| image:: https://raw.githubusercontent.com/pylint-dev/astroid/main/doc/media/Tidelift_Logos_RGB_Tidelift_Shorthand_On-White.png
:width: 200
:alt: Tidelift

.. list-table::
:widths: 10 100

* - |tidelift_logo|
- Professional support for astroid is available as part of the
`Tidelift Subscription`_. Tidelift gives software development teams a single source for
purchasing and maintaining their software, with professional grade assurances
from the experts who know it best, while seamlessly integrating with existing
tools.

.. _Tidelift Subscription: https://tidelift.com/subscription/pkg/pypi-astroid?utm_source=pypi-astroid&utm_medium=referral&utm_campaign=readme



What's this?
------------

The aim of this module is to provide a common base representation of
python source code. It is currently the library powering pylint's capabilities.

It provides a compatible representation which comes from the `_ast`
module. It rebuilds the tree generated by the builtin _ast module by
recursively walking down the AST and building an extended ast. The new
node classes have additional methods and attributes for different
usages. They include some support for static inference and local name
scopes. Furthermore, astroid can also build partial trees by inspecting living
objects.


Installation
------------

Extract the tarball, jump into the created directory and run::

pip install .


If you want to do an editable installation, you can run::

pip install -e .


If you have any questions, please mail the code-quality@python.org
mailing list for support. See
http://mail.python.org/mailman/listinfo/code-quality for subscription
information and archives.

Documentation
-------------
http://astroid.readthedocs.io/en/latest/


Python Versions
---------------

astroid 2.0 is currently available for Python 3 only. If you want Python 2
support, use an older version of astroid (though note that these versions
are no longer supported).

Test
----

Tests are in the 'test' subdirectory. To launch the whole tests suite, you can use
either `tox` or `pytest`::

tox
pytest
Loading
Loading