Skip to content

Commit 73d9fb4

Browse files
committed
pycodestyle compliance
1 parent 5819f2f commit 73d9fb4

Some content is hidden

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

56 files changed

+291
-291
lines changed

.github/workflows/run_kendra.yaml

Lines changed: 0 additions & 15 deletions
This file was deleted.

chc/api/ApiParameter.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ class ApiParameter(InterfaceDictionaryRecord):
4949
"""
5050

5151
def __init__(
52-
self, cd: "InterfaceDictionary", ixval: IT.IndexedTableValue) -> None:
52+
self, cd: "InterfaceDictionary", ixval: IT.IndexedTableValue
53+
) -> None:
5354
InterfaceDictionaryRecord.__init__(self, cd, ixval)
5455

5556
@property
@@ -72,7 +73,8 @@ class APFormal(ApiParameter):
7273
"""
7374

7475
def __init__(
75-
self, cd: "InterfaceDictionary", ixval: IT.IndexedTableValue) -> None:
76+
self, cd: "InterfaceDictionary", ixval: IT.IndexedTableValue
77+
) -> None:
7678
ApiParameter.__init__(self, cd, ixval)
7779

7880
@property
@@ -92,7 +94,8 @@ class APGlobal(ApiParameter):
9294
"""Global variable used in a function; treated as a formal parameter."""
9395

9496
def __init__(
95-
self, cd: "InterfaceDictionary", ixval: IT.IndexedTableValue) -> None:
97+
self, cd: "InterfaceDictionary", ixval: IT.IndexedTableValue
98+
) -> None:
9699
ApiParameter.__init__(self, cd, ixval)
97100

98101
@property

chc/api/CFunctionApi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def library_calls(self) -> Dict[Tuple[str, str], int]:
208208
(header is not None)
209209
and (fname is not None)
210210
and (count is not None)):
211-
self._library_calls[(header, fname)] = int(count)
211+
self._library_calls[(header, fname)] = int(count)
212212
return self._library_calls
213213

214214
@property

chc/api/CFunctionContract.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@
4444
from chc.app.CFunction import CFunction
4545

4646

47-
48-
class CFunctionContract(object):
47+
class CFunctionContract:
4948

5049
def __init__(
5150
self,
@@ -58,7 +57,6 @@ def __init__(
5857
self._preconditions: Optional[Dict[int, "XPredicate"]] = None
5958
self._sideeffects: Optional[Dict[int, "XPredicate"]] = None
6059
self._postrequests: Dict[int, "XPredicate"] = {}
61-
# self._initialize(self.xnode)
6260

6361
@property
6462
def cfilecontracts(self) -> "CFileContracts":

chc/api/FieldAssignment.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
if TYPE_CHECKING:
3535
from chc.app.CFunction import CFunction
3636

37+
3738
class FieldAssignment:
3839

3940
def __init__(self, cfun: "CFunction", xnode: ET.Element) -> None:

chc/api/GlobalAssumption.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
from chc.api.CFunctionApi import CFunctionApi
3535
from chc.api.XPredicate import XPredicate
3636
from chc.app.CFunction import CFunction
37-
37+
3838

3939
class GlobalAssumption:
4040
"""

chc/api/InterfaceDictionary.py

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
import chc.api.XPredicate as XP
5656

5757

58-
5958
if TYPE_CHECKING:
6059
from chc.app.CFile import CFile
6160
from chc.app.CFileDeclarations import CFileDeclarations
@@ -328,7 +327,7 @@ def f(index: int, tags: List[str], args: List[int]) -> XPredicate:
328327
args = [self.index_s_term(p.term)]
329328

330329
elif p.is_non_negative:
331-
p = cast(XP.XNonNegative, p)
330+
p = cast(XP.XNonNegative, p)
332331
args = [self.index_s_term(p.term)]
333332

334333
elif p.is_initialized:
@@ -383,7 +382,11 @@ def parse_mathml_api_parameter(
383382
self, name: str, pars: Dict[str, int], gvars: List[str] = []
384383
) -> int:
385384
if (name not in pars) and (name not in gvars):
386-
raise Exception("Error in reading user data: " + name + " in file " + self.cfile.name)
385+
raise Exception(
386+
"Error in reading user data: "
387+
+ name
388+
+ " in file "
389+
+ self.cfile.name)
387390
if name in pars:
388391
tags = ["pf"]
389392
args = [pars[name]]
@@ -440,7 +443,8 @@ def parse_mathml_term(
440443
if tnode_text is None:
441444
raise Exception("Expected element to have text")
442445
args = [
443-
self.parse_mathml_api_parameter(tnode_text, pars, gvars=gvars),
446+
self.parse_mathml_api_parameter(
447+
tnode_text, pars, gvars=gvars),
444448
self.parse_mathml_offset(None),
445449
]
446450

@@ -497,9 +501,11 @@ def parse_mathml_term(
497501
tags = ["ax", "minusa"]
498502

499503
else:
500-
raise Exception('Parse mathml s-term apply not found for "' + op + '"')
504+
raise Exception(
505+
'Parse mathml s-term apply not found for "' + op + '"')
501506
else:
502-
raise Exception('Parse mathml s-term not found for "' + tnode.tag + '"')
507+
raise Exception(
508+
'Parse mathml s-term not found for "' + tnode.tag + '"')
503509

504510
return self.mk_s_term(tags, args)
505511

@@ -625,22 +631,26 @@ def bound(t: str) -> int:
625631

626632
# ------------------------ Read/write xml services -----------------------
627633

628-
def read_xml_xpredicate(self, node: ET.Element, tag: str = "ipr") -> XPredicate:
634+
def read_xml_xpredicate(
635+
self, node: ET.Element, tag: str = "ipr") -> XPredicate:
629636
xml_value = node.get(tag)
630637
if xml_value is None:
631638
raise Exception('No value for tag "' + tag + '"')
632639
return self.get_xpredicate(int(xml_value))
633640

634-
def read_xml_postcondition(self, node: ET.Element, tag: str = "ixpre") -> XPredicate:
641+
def read_xml_postcondition(
642+
self, node: ET.Element, tag: str = "ixpre") -> XPredicate:
635643
xml_value = node.get(tag)
636644
if xml_value is None:
637645
raise Exception('No value for tag "' + tag + '"')
638646
return self.get_xpredicate(int(xml_value))
639647

640-
def write_xml_postcondition(self, node: ET.Element, pc: XPredicate, tag: str = "ixpre") -> None:
648+
def write_xml_postcondition(
649+
self, node: ET.Element, pc: XPredicate, tag: str = "ixpre") -> None:
641650
return node.set(tag, str(self.index_xpredicate(pc)))
642651

643-
def read_xml_postrequest(self, node: ET.Element, tag: str = "iipr") -> PostRequest:
652+
def read_xml_postrequest(
653+
self, node: ET.Element, tag: str = "iipr") -> PostRequest:
644654
xml_value = node.get(tag)
645655
if xml_value is None:
646656
raise Exception('No value for tag "' + tag + '"')
@@ -678,7 +688,7 @@ def objectmap_to_string(self, name: str) -> str:
678688
return "\n".join(lines)
679689
else:
680690
raise UF.CHCError(
681-
"Name: " + name + " does not correspond to a table")
691+
"Name: " + name + " does not correspond to a table")
682692

683693
def write_xml(self, node: ET.Element) -> None:
684694
def f(n: ET.Element, r: Any) -> None:

chc/api/PostConditionRequest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
from chc.api.PostRequest import PostRequest
3636
from chc.api.XPredicate import XPredicate
3737
from chc.app.CVarInfo import CVarInfo
38-
38+
3939

4040
class PostConditionRequest:
4141

chc/api/PostRequest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ class PostRequest(InterfaceDictionaryRecord):
4848
"""
4949

5050
def __init__(
51-
self, ifd: "InterfaceDictionary", ixval: IT.IndexedTableValue) -> None:
51+
self, ifd: "InterfaceDictionary", ixval: IT.IndexedTableValue
52+
) -> None:
5253
InterfaceDictionaryRecord.__init__(self, ifd, ixval)
5354

5455
@property

chc/api/SOffset.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ class SOffset(InterfaceDictionaryRecord):
4646
"""Base class for s_term offset."""
4747

4848
def __init__(
49-
self, ifd: "InterfaceDictionary", ixval: IT.IndexedTableValue) -> None:
49+
self, ifd: "InterfaceDictionary", ixval: IT.IndexedTableValue
50+
) -> None:
5051
InterfaceDictionaryRecord.__init__(self, ifd, ixval)
5152

5253
@property
@@ -73,7 +74,8 @@ class STArgNoOffset(SOffset):
7374
"""No Offset."""
7475

7576
def __init__(
76-
self, ifd: "InterfaceDictionary", ixval: IT.IndexedTableValue) -> None:
77+
self, ifd: "InterfaceDictionary", ixval: IT.IndexedTableValue
78+
) -> None:
7779
SOffset.__init__(self, ifd, ixval)
7880

7981
@property
@@ -96,7 +98,8 @@ class STArgFieldOffset(SOffset):
9698
"""
9799

98100
def __init__(
99-
self, ifd: "InterfaceDictionary", ixval: IT.IndexedTableValue) -> None:
101+
self, ifd: "InterfaceDictionary", ixval: IT.IndexedTableValue
102+
) -> None:
100103
SOffset.__init__(self, ifd, ixval)
101104

102105
@property
@@ -132,7 +135,8 @@ class STArgIndexOffset(SOffset):
132135
"""
133136

134137
def __init__(
135-
self, cd: "InterfaceDictionary", ixval: IT.IndexedTableValue) -> None:
138+
self, cd: "InterfaceDictionary", ixval: IT.IndexedTableValue
139+
) -> None:
136140
SOffset.__init__(self, cd, ixval)
137141

138142
@property

0 commit comments

Comments
 (0)