MilesCranmer commited on
Commit
6fdc3b9
1 Parent(s): e7941a7

Add pre-commit hooks for formatting and nb stripping

Browse files
.pre-commit-config.yaml CHANGED
@@ -1,5 +1,5 @@
1
  repos:
2
- # General linting:
3
  - repo: https://github.com/pre-commit/pre-commit-hooks
4
  rev: v3.2.0
5
  hooks:
@@ -7,3 +7,14 @@ repos:
7
  - id: end-of-file-fixer
8
  - id: check-yaml
9
  - id: check-added-large-files
 
 
 
 
 
 
 
 
 
 
 
 
1
  repos:
2
+ # General linting
3
  - repo: https://github.com/pre-commit/pre-commit-hooks
4
  rev: v3.2.0
5
  hooks:
 
7
  - id: end-of-file-fixer
8
  - id: check-yaml
9
  - id: check-added-large-files
10
+ # General formatting
11
+ - repo: https://github.com/psf/black
12
+ rev: 23.3.0
13
+ hooks:
14
+ - id: black
15
+ - id: black-jupyter
16
+ # Stripping notebooks
17
+ - repo: https://github.com/kynan/nbstripout
18
+ rev: 0.6.1
19
+ hooks:
20
+ - id: nbstripout
benchmarks/print_best_model.py CHANGED
@@ -51,7 +51,6 @@ import glob
51
  path = TRIALS_FOLDER + "/*.pkl"
52
  files = 0
53
  for fname in glob.glob(path):
54
-
55
  trials_obj = pkl.load(open(fname, "rb"))
56
  n_trials = trials_obj["n"]
57
  trials_obj = trials_obj["trials"]
 
51
  path = TRIALS_FOLDER + "/*.pkl"
52
  files = 0
53
  for fname in glob.glob(path):
 
54
  trials_obj = pkl.load(open(fname, "rb"))
55
  n_trials = trials_obj["n"]
56
  trials_obj = trials_obj["trials"]
examples/pysr_demo.ipynb CHANGED
The diff for this file is too large to render. See raw diff