Skip to content

Commit

Permalink
Readd pyright and fix small errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasdiez authored and Matthias Koeppe committed Mar 21, 2022
1 parent 55a711e commit aa4a951
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 23 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Set up node to install pyright
uses: actions/setup-node@v1
with:
node-version: '12'

- name: Install pyright
run: npm install -g pyright

- name: Prepare
run: |
# Reuse built SAGE_LOCAL contained in the Docker image
Expand All @@ -27,6 +35,9 @@ jobs:
apt-get install -y git
./sage -python -m pip install coverage
- name: Static code check with pyright
run: pyright

- name: Build
run: make build
env:
Expand Down
14 changes: 11 additions & 3 deletions pyrightconfig.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
{
"include": [
"src/sage/manifolds"
"src/sage"
],
"executionEnvironments": [
{
"root": "src"
}
],
"pythonVersion": "3.7",
"exclude": ["venv"],
"venvPath": "./venv/",
"venv": "./",

"reportMissingImports": "warning",
"reportGeneralTypeIssues": "warning",
"reportUnboundVariable": "warning",
"reportDuplicateImport": "error"
"reportDuplicateImport": "error",
"reportOptionalMemberAccess": "warning",
"reportOptionalCall": "warning",
"reportOptionalSubscript": "warning",
"reportOptionalIterable": "warning",
"reportUndefinedVariable": "warning",
"reportOptionalOperand": "warning",
}
74 changes: 56 additions & 18 deletions src/sage/graphs/generators/smallgraphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,62 @@ def HarborthGraph():
'pZkfJPuo[lfZHys^mFcDs}`pG{UNNgoHC}DIgrI[qjMhTyDQrQlVydrBYmWkn',
loops=False, multiedges=False)

g.set_pos({ 0: ( 51.5, 400.0), 1: ( 90.6, 308.0), 2: ( 90.6, 492.0),
3: (129.8, 216.0), 4: (129.8, 584.0), 5: (150.7, 387.9),
6: (150.7, 412.1), 7: (169.0, 124.0), 8: (169.0, 676.0),
9: (189.9, 295.9), 10: (189.9, 504.1), 11: (229.1, 203.9),
12: (229.1, 596.1), 13: (250.0, 400.0), 14: (251.4, 180.6),
15: (251.4, 619.4), 16: (256.1, 300.2), 17: (256.1, 499.8),
18: (259.3, 080.9), 19: (259.3, 719.1), 20: (333.8, 237.2),
21: (333.8, 562.8), 22: (341.7, 137.5), 23: (341.7, 662.5),
24: (350.0, 037.9), 25: (350.0, 336.0), 26: (350.0, 464.0),
27: (350.0, 762.1), 28: (358.3, 137.5), 29: (358.3, 662.5),
30: (366.2, 237.2), 31: (366.2, 562.8), 32: (440.7, 080.9),
33: (440.7, 719.1), 34: (443.9, 300.2), 35: (443.9, 499.8),
36: (448.6, 180.6), 37: (448.6, 619.4), 38: (450.0, 400.0),
39: (470.9, 203.9), 40: (470.9, 596.1), 41: (510.1, 295.9),
42: (510.1, 504.1), 43: (531.0, 124.0), 44: (531.0, 676.0),
45: (549.3, 387.9), 46: (549.3, 412.1), 47: (570.2, 216.0),
48: (570.2, 584.0), 49: (609.4, 308.0), 50: (609.4, 492.0),
51: (648.5, 400.0)})
g.set_pos(
{
0: (51.5, 400.0),
1: (90.6, 308.0),
2: (90.6, 492.0),
3: (129.8, 216.0),
4: (129.8, 584.0),
5: (150.7, 387.9),
6: (150.7, 412.1),
7: (169.0, 124.0),
8: (169.0, 676.0),
9: (189.9, 295.9),
10: (189.9, 504.1),
11: (229.1, 203.9),
12: (229.1, 596.1),
13: (250.0, 400.0),
14: (251.4, 180.6),
15: (251.4, 619.4),
16: (256.1, 300.2),
17: (256.1, 499.8),
18: (259.3, 80.9),
19: (259.3, 719.1),
20: (333.8, 237.2),
21: (333.8, 562.8),
22: (341.7, 137.5),
23: (341.7, 662.5),
24: (350.0, 37.9),
25: (350.0, 336.0),
26: (350.0, 464.0),
27: (350.0, 762.1),
28: (358.3, 137.5),
29: (358.3, 662.5),
30: (366.2, 237.2),
31: (366.2, 562.8),
32: (440.7, 80.9),
33: (440.7, 719.1),
34: (443.9, 300.2),
35: (443.9, 499.8),
36: (448.6, 180.6),
37: (448.6, 619.4),
38: (450.0, 400.0),
39: (470.9, 203.9),
40: (470.9, 596.1),
41: (510.1, 295.9),
42: (510.1, 504.1),
43: (531.0, 124.0),
44: (531.0, 676.0),
45: (549.3, 387.9),
46: (549.3, 412.1),
47: (570.2, 216.0),
48: (570.2, 584.0),
49: (609.4, 308.0),
50: (609.4, 492.0),
51: (648.5, 400.0),
}
)
g.name("Harborth Graph")
return g

Expand Down
1 change: 0 additions & 1 deletion src/sage/misc/latex.py
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,6 @@ def blackboard_bold(self, t=None):
if t is None:
return _Latex_prefs._option["blackboard_bold"]
from .latex_macros import sage_configurable_latex_macros
global sage_configurable_latex_macros
old = _Latex_prefs._option["blackboard_bold"]
_Latex_prefs._option["blackboard_bold"] = bool(t)
if bool(old) != bool(t):
Expand Down
1 change: 0 additions & 1 deletion src/sage/modules/free_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@
import sage.rings.abc
import sage.rings.integer_ring
import sage.rings.rational_field
import sage.rings.abc
import sage.rings.infinity
import sage.rings.integer
from sage.categories.principal_ideal_domains import PrincipalIdealDomains
Expand Down

0 comments on commit aa4a951

Please sign in to comment.