-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a pre-commit configuration to conform to new pydata conventions.
This patch also reformats code using the `ruff` code formatter.
- Loading branch information
1 parent
9fba33e
commit 5b40a64
Showing
43 changed files
with
3,863 additions
and
2,496 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,3 +83,7 @@ doc/cdoc/build | |
ehthumbs.db | ||
Icon? | ||
Thumbs.db | ||
|
||
# Test generated files # | ||
######################## | ||
.python-version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v5.0.0 | ||
hooks: | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- id: fix-byte-order-marker | ||
- id: destroyed-symlinks | ||
- id: fix-encoding-pragma | ||
args: ["--remove"] | ||
- id: mixed-line-ending | ||
- id: name-tests-test | ||
args: ["--pytest-test-first"] | ||
- id: pretty-format-json | ||
args: ["--autofix", "--no-ensure-ascii"] | ||
exclude: ".ipynb" | ||
|
||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.7.3 | ||
hooks: | ||
- id: ruff-format | ||
types_or: [ python, pyi, jupyter ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,26 @@ | ||
import numpy as np | ||
|
||
|
||
class MyTreat(object): | ||
def __init__(self, reference=0): | ||
self.reference = reference | ||
|
||
def code_with_intercept(self, levels): | ||
return ContrastMatrix(np.eye(len(levels)), | ||
["[My.%s]" % (level,) for level in levels]) | ||
return ContrastMatrix( | ||
np.eye(len(levels)), ["[My.%s]" % (level,) for level in levels] | ||
) | ||
|
||
def code_without_intercept(self, levels): | ||
eye = np.eye(len(levels) - 1) | ||
contrasts = np.vstack((eye[:self.reference, :], | ||
np.zeros((1, len(levels) - 1)), | ||
eye[self.reference:, :])) | ||
suffixes = ["[MyT.%s]" % (level,) for level in | ||
levels[:self.reference] + levels[self.reference + 1:]] | ||
contrasts = np.vstack( | ||
( | ||
eye[: self.reference, :], | ||
np.zeros((1, len(levels) - 1)), | ||
eye[self.reference :, :], | ||
) | ||
) | ||
suffixes = [ | ||
"[MyT.%s]" % (level,) | ||
for level in levels[: self.reference] + levels[self.reference + 1 :] | ||
] | ||
return ContrastMatrix(contrasts, suffixes) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,4 +77,4 @@ | |
.facebox_overlayBG { | ||
background-color: #000; | ||
z-index: 99; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.