Skip to content

Commit 864d113

Browse files
committed
🔄 synced local './' with remote 'configs/python/'
1 parent 4ea389c commit 864d113

File tree

3 files changed

+284
-44
lines changed

3 files changed

+284
-44
lines changed

.gitignore

Lines changed: 167 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,173 @@
1-
# Global ignore patters. They cause the files with the following names and
2-
# extensions to be ignored in general by Git.
3-
#
4-
# We ignore these files because they're usually binary and/or very large, which
5-
# greatly bloats the repository and its clone time. In this category are the
6-
# files .h5/.hdf5/.txt/.log and files named *log_file*. Some of these logs are
7-
# enormous.
8-
#
9-
# We also ignore files that can be easily reproduced one way or another by
10-
# compilers, like .pyc/.o/.so/.a/.lib.
11-
#
12-
# Lastly we ignore files and directories that signal their temporary character
13-
# with a name that contains "tmp".
14-
#
15-
# ****************************************************************************
16-
# ** DO NOT put ignore patterns here that are private to your clone of this **
17-
# ** repository. Those belong in your clone's .git/info/exclude file. **
18-
# ****************************************************************************
19-
#
20-
**/*.h5
21-
**/*.hdf5
22-
**/*.txt
23-
**/*log_file*
24-
**/*.log
25-
**/*.out
26-
**/*.pyc
27-
**/*.o
28-
**/*.so
29-
**/*.a
30-
**/*.lib
31-
**/*.dll
32-
**/*.exe
33-
**/*tmp*
34-
**/*.yaml
35-
**/*.npy
36-
**/slurm-*.out
37-
keras_complex.egg-info/
1+
_site
2+
.bundle
3+
vendor
4+
.vscode
5+
.DS_Store
6+
.idea
7+
.tmp
8+
9+
# Byte-compiled / optimized / DLL files
10+
__pycache__/
11+
*.py[cod]
12+
*$py.class
13+
14+
# C extensions
15+
*.so
16+
17+
# Distribution / packaging
18+
.Python
3819
build/
20+
develop-eggs/
21+
dist/
22+
downloads/
23+
eggs/
24+
.eggs/
25+
lib/
26+
lib64/
27+
parts/
28+
sdist/
29+
var/
30+
wheels/
31+
share/python-wheels/
32+
*.egg-info/
33+
.installed.cfg
34+
*.egg
35+
MANIFEST
36+
37+
# PyInstaller
38+
# Usually these files are written by a python script from a template
39+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
40+
*.manifest
41+
*.spec
42+
43+
# Installer logs
44+
pip-log.txt
45+
pip-delete-this-directory.txt
46+
47+
# Unit test / coverage reports
48+
htmlcov/
49+
.tox/
50+
.nox/
51+
.coverage
52+
.coverage.*
53+
.cache
54+
nosetests.xml
55+
coverage.xml
56+
*.cover
57+
*.py,cover
58+
.hypothesis/
59+
.pytest_cache/
60+
cover/
61+
62+
# Translations
63+
*.mo
64+
*.pot
65+
66+
# Django stuff:
67+
*.log
68+
local_settings.py
69+
db.sqlite3
70+
db.sqlite3-journal
71+
72+
# Flask stuff:
73+
instance/
74+
.webassets-cache
75+
76+
# Scrapy stuff:
77+
.scrapy
78+
79+
# Sphinx documentation
80+
docs/_build/
81+
82+
# PyBuilder
83+
.pybuilder/
84+
target/
85+
86+
# Jupyter Notebook
87+
.ipynb_checkpoints
88+
89+
# IPython
90+
profile_default/
91+
ipython_config.py
3992

40-
# Ignore virtual environment
41-
venv
93+
# pyenv
94+
# For a library or package, you might want to ignore these files since the code is
95+
# intended to run in multiple environments; otherwise, check them in:
96+
# .python-version
97+
98+
# pipenv
99+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
100+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
101+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
102+
# install all needed dependencies.
103+
#Pipfile.lock
104+
105+
# poetry
106+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
107+
# This is especially recommended for binary packages to ensure reproducibility, and is more
108+
# commonly ignored for libraries.
109+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
110+
#poetry.lock
111+
112+
# pdm
113+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
114+
#pdm.lock
115+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
116+
# in version control.
117+
# https://pdm.fming.dev/#use-with-ide
118+
.pdm.toml
119+
120+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
121+
__pypackages__/
122+
123+
# Celery stuff
124+
celerybeat-schedule
125+
celerybeat.pid
126+
127+
# SageMath parsed files
128+
*.sage.py
129+
130+
# Environments
131+
.env
42132
.venv
133+
env/
134+
venv/
135+
ENV/
136+
env.bak/
137+
venv.bak/
43138

44-
# IDE
45-
.vscode
46-
.idea
139+
# Spyder project settings
140+
.spyderproject
141+
.spyproject
142+
143+
# Rope project settings
144+
.ropeproject
145+
146+
# mkdocs documentation
147+
/site
148+
149+
# mypy
150+
.mypy_cache/
151+
.dmypy.json
152+
dmypy.json
153+
154+
# Pyre type checker
155+
.pyre/
156+
157+
# pytype static type analyzer
158+
.pytype/
159+
160+
# Cython debug symbols
161+
cython_debug/
47162

48-
dist/*
163+
# PyCharm
164+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
165+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
166+
# and can be added to the global gitignore or merged into this file. For a more nuclear
167+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
168+
#.idea/
49169

50-
__pycache__/*
170+
utils/tidy_conf/data/.tmp/
171+
# pixi environments
172+
.pixi
173+
*.egg-info

.pre-commit-config.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.6.0
4+
hooks:
5+
- id: check-yaml # Check YAML files for syntax errors
6+
- id: debug-statements # Check for debugger imports and py37+ breakpoint()
7+
- id: end-of-file-fixer # Ensure files end in a newline
8+
- id: trailing-whitespace # Trailing whitespace checker
9+
- id: check-added-large-files # Check for large files added to git
10+
- id: check-merge-conflict # Check for files that contain merge conflict strings
11+
- repo: https://github.com/pre-commit/pygrep-hooks
12+
rev: v1.10.0 # Use the ref you want to point at
13+
hooks:
14+
- id: python-use-type-annotations # Check for missing type annotations
15+
- id: python-check-blanket-noqa # Check for # noqa: all
16+
- id: python-no-log-warn # Check for log.warn
17+
- repo: https://github.com/pycqa/isort
18+
rev: 5.13.2
19+
hooks:
20+
- id: isort
21+
args:
22+
- -l 120
23+
- --force-single-line-imports
24+
- --profile black
25+
- repo: https://github.com/asottile/pyupgrade # Upgrade Python syntax
26+
rev: v3.15.2
27+
hooks:
28+
- id: pyupgrade
29+
args:
30+
- --py310-plus
31+
- repo: https://github.com/psf/black # Format Python code
32+
rev: 24.4.2
33+
hooks:
34+
- id: black
35+
args:
36+
- --line-length=120
37+
- repo: https://github.com/astral-sh/ruff-pre-commit
38+
rev: v0.4.4
39+
hooks:
40+
- id: ruff
41+
args:
42+
- --line-length=120
43+
- --fix
44+
- --exit-non-zero-on-fix
45+
- --preview
46+
- repo: https://github.com/jshwi/docsig # Check docstrings against function sig
47+
rev: v0.53.2
48+
hooks:
49+
- id: docsig
50+
args:
51+
- --ignore-no-params # Allow docstrings without parameters
52+
- --check-dunders # Check dunder methods
53+
- --check-overridden # Check overridden methods
54+
- --check-protected # Check protected methods
55+
- --check-class # Check class docstrings
56+
- --disable=E113 # Disable empty docstrings

ruff.toml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
line-length = 120
2+
target-version = "py310"
3+
preview = true
4+
5+
[lint]
6+
select = [
7+
"A", # flake8 builtins
8+
"B", # flake8-bugbear
9+
"D", # pydocstyle
10+
"E", # pycodestyle error
11+
"W", # pycodestyle warning
12+
"F", # flake8 error
13+
"UP", # Pyupgrade
14+
"SIM", # flake8-simplify
15+
"N", # pep8 naming
16+
"YTT", # flake8-2020
17+
"S", # bandit
18+
"COM", # Commas
19+
"C4", # Comprehensions
20+
"DTZ", # Datetimes
21+
"ISC", # Implicit string concatenation
22+
"ICN", # Import conventions
23+
"LOG", # Logging
24+
"PIE", # Misc lints
25+
"PT", # Pytest
26+
"Q", # Quotes
27+
"RSE", # Raises
28+
"TID", # Tidy imports
29+
"PTH", # Use Pathlib
30+
"PGH", # Pygrep hooks
31+
"R", # Refactor
32+
"FLY", # Fstrings
33+
"PERF", # Perfomance linting
34+
"FURB", # Modernising code
35+
"RUF", # Ruff specific
36+
"NPY", # Numpys
37+
# "PL", # Pylint
38+
# "TD", # Todos
39+
# "FBT", # Boolean traps
40+
# "CPY", # Copyright
41+
]
42+
ignore = [
43+
"E203",
44+
"D100",
45+
"D101",
46+
"D102",
47+
"D103",
48+
"D104",
49+
"D105",
50+
"D401",
51+
"S101",
52+
"B028",
53+
"B018",
54+
"PT018",
55+
"RET504",
56+
57+
]
58+
59+
60+
[lint.pydocstyle]
61+
convention = "numpy"

0 commit comments

Comments
 (0)