Skip to content

Commit c000329

Browse files
committed
First init
1 parent 3c645df commit c000329

46 files changed

Lines changed: 10997 additions & 4 deletions

Some content is hidden

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

‎.github/workflows/pylint.yml‎

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Pylint
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
timeout-minutes: 20
9+
strategy:
10+
matrix:
11+
python-version: ["3.10", "3.11", "3.12"]
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Cache pip
16+
uses: actions/cache@v4
17+
with:
18+
path: ~/.cache/pip
19+
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/requirements.txt') }}
20+
restore-keys: |
21+
${{ runner.os }}-pip-${{ matrix.python-version }}-
22+
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v3
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
28+
- name: Install dependencies
29+
run: |
30+
python -m pip install --upgrade pip
31+
pip install -r requirements.txt
32+
pip install pylint rich
33+
34+
- name: Analysing the code with pylint (limit to project files)
35+
run: |
36+
# Only lint package code and examples/tests to reduce runtime
37+
FILES=$(git ls-files | grep -E '^(src/|examples/|tests/).+\.py$' || true)
38+
if [ -z "$FILES" ]; then
39+
echo "No files to lint."
40+
exit 0
41+
fi
42+
43+
# Run pylint and propagate exit code
44+
pylint $FILES --fail-under=8.0

‎.gitignore‎

Lines changed: 51 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
1+
# Project-specific patterns
2+
**/*.pt
3+
**/checkpoints
4+
**/wget-log
5+
**/_build/
6+
**/*.ckpt
7+
**/outputs
8+
**/*.tar.gz
9+
**/playground
10+
**/wandb
11+
archive/
12+
output/
13+
outputs
14+
prediction/
15+
ckpts/
16+
dataset/*
17+
tensorflow/my_graph/*
18+
119
# Byte-compiled / optimized / DLL files
220
__pycache__/
21+
*.py[cod]
322
*.py[codz]
423
*$py.class
524

@@ -46,6 +65,7 @@ htmlcov/
4665
nosetests.xml
4766
coverage.xml
4867
*.cover
68+
*,cover
4969
*.py.cover
5070
.hypothesis/
5171
.pytest_cache/
@@ -77,6 +97,7 @@ target/
7797

7898
# Jupyter Notebook
7999
.ipynb_checkpoints
100+
Untitled.ipynb
80101

81102
# IPython
82103
profile_default/
@@ -85,7 +106,7 @@ ipython_config.py
85106
# pyenv
86107
# For a library or package, you might want to ignore these files since the code is
87108
# intended to run in multiple environments; otherwise, check them in:
88-
# .python-version
109+
.python-version
89110

90111
# pipenv
91112
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
@@ -173,7 +194,7 @@ cython_debug/
173194
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
174195
# and can be added to the global gitignore or merged into this file. For a more nuclear
175196
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
176-
#.idea/
197+
.idea/
177198

178199
# Abstra
179200
# Abstra is an AI-powered process automation framework.
@@ -182,10 +203,11 @@ cython_debug/
182203
.abstra/
183204

184205
# Visual Studio Code
185-
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
206+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186207
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187-
# and can be added to the global gitignore or merged into this file. However, if you prefer,
208+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
188209
# you could uncomment the following to ignore the entire vscode folder
210+
.vscode
189211
# .vscode/
190212

191213
# Ruff stuff:
@@ -205,3 +227,28 @@ cython_debug/
205227
marimo/_static/
206228
marimo/_lsp/
207229
__marimo__/
230+
231+
# Logs
232+
logs
233+
log
234+
wandb/
235+
236+
# Temporary files
237+
tmp/
238+
*.swp
239+
240+
# Mac
241+
.DS_Store
242+
243+
# Lock files
244+
*.lock
245+
246+
# Data files
247+
*.parquet
248+
249+
# History
250+
.history
251+
252+
# Outputs
253+
outputs/*
254+
archive/*

‎.pylintrc‎

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
[MASTER]
2+
# Pylint configuration to reduce strictness for this repository CI run.
3+
# This file is intentionally permissive to allow progressive refactoring.
4+
5+
[MESSAGES CONTROL]
6+
# Disable specific checks that currently cause the lint job to fail across many files.
7+
# These disables are intended as a temporary measure; please plan to gradually re-enable
8+
# and fix code issues listed by pylint.
9+
disable=
10+
C0302, # too-many-lines
11+
W0109, # duplicate-key
12+
R0914, # too-many-locals
13+
W0602, # global-variable-not-assigned
14+
W0718, # broad-exception-caught
15+
R1705, # no-else-return
16+
W0612, # unused-variable
17+
R0912, # too-many-branches
18+
W1309, # f-string-without-interpolation
19+
R0913, # too-many-arguments
20+
R0917, # too-many-positional-arguments
21+
W0621, # redefined-outer-name
22+
R1722, # consider-using-sys-exit
23+
W0611, # unused-import
24+
W0603, # global-statement
25+
W0702, # bare-except
26+
R1702, # too-many-nested-blocks
27+
C0103, # invalid-name
28+
C0305, # trailing-newlines
29+
R0801, # duplicate-code
30+
duplicate-code,
31+
too-many-arguments,
32+
too-many-branches,
33+
too-many-nested-blocks,
34+
too-many-lines,
35+
bare-except,
36+
broad-exception-caught,
37+
no-else-return
38+
39+
[FORMAT]
40+
max-line-length=100
41+
42+
[REPORTS]
43+
# Disable the full report to reduce CI output noise
44+
reports=no
45+
46+
[TYPECHECK]
47+
# Allow missing members to reduce false positives against dynamic clients
48+
ignore-missing-imports=yes

‎Makefile‎

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Makefile for ExpertBench/omb
2+
3+
# Variables
4+
PYTHON := python
5+
PIP := pip
6+
PYTEST := pytest
7+
BLACK := black
8+
ISORT := isort
9+
FLAKE8 := flake8
10+
MYPY := mypy
11+
PYLINT := pylint
12+
SRC_DIR := src
13+
TEST_DIR := tests
14+
15+
.PHONY: help install test lint format clean check format-check
16+
17+
# Default target
18+
help:
19+
@echo "Available commands:"
20+
@echo " make install - Install development dependencies"
21+
@echo " make test - Run tests using pytest"
22+
@echo " make lint - Run static analysis (flake8, mypy, pylint)"
23+
@echo " make format - Format code using black and isort"
24+
@echo " make format-check - Check code formatting without modifying files"
25+
@echo " make clean - Remove build artifacts and cache directories"
26+
@echo " make check - Run all checks (format-check, lint, test)"
27+
28+
install:
29+
$(PIP) install -e ".[dev]"
30+
31+
test:
32+
@if [ -d "$(TEST_DIR)" ]; then \
33+
$(PYTEST); \
34+
else \
35+
echo "Warning: '$(TEST_DIR)' directory not found. Skipping tests."; \
36+
fi
37+
38+
lint:
39+
@echo "Running flake8..."
40+
-$(FLAKE8) $(SRC_DIR)
41+
@echo "Running mypy..."
42+
-$(MYPY) $(SRC_DIR)
43+
@echo "Running pylint..."
44+
-$(PYLINT) $(SRC_DIR)
45+
46+
format:
47+
@echo "Formatting with isort..."
48+
$(ISORT) $(SRC_DIR)
49+
@echo "Formatting with black..."
50+
$(BLACK) $(SRC_DIR)
51+
52+
format-check:
53+
@echo "Checking import sort order..."
54+
$(ISORT) --check-only --diff $(SRC_DIR)
55+
@echo "Checking code formatting..."
56+
$(BLACK) --check --diff $(SRC_DIR)
57+
58+
clean:
59+
rm -rf __pycache__
60+
rm -rf $(SRC_DIR)/__pycache__
61+
rm -rf $(SRC_DIR)/*/__pycache__
62+
rm -rf $(TEST_DIR)/__pycache__
63+
rm -rf .pytest_cache
64+
rm -rf .mypy_cache
65+
rm -rf .ruff_cache
66+
rm -rf build
67+
rm -rf dist
68+
rm -rf *.egg-info
69+
find . -type f -name "*.pyc" -delete
70+
find . -type d -name "__pycache__" -delete
71+
72+
check: format-check lint test

0 commit comments

Comments
 (0)