Skip to content

Commit 0c1930b

Browse files
committed
mostly black v20 formatting
1 parent fecb6d9 commit 0c1930b

10 files changed

Lines changed: 49 additions & 64 deletions

File tree

.github/workflows/QCSchema.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ jobs:
6464
make qcschema
6565
ls -l qcschema
6666
#cp -p qcschema/* ../qcsk/qcschema_json/
67-
cp -p qcschema/* ../qcsk/qcschema/
67+
cp -p qcschema/* ../qcsk/qcschema/data/vdev/
68+
mv ../qcsk/qcschema/data/vdev/QCSchema.schema ../qcsk/qcschema/dev/
6869
# Note: `qcschema_json` is a folder in the py2json branch containing plain JSON files of the schema,
6970
# rather than the python module of the current repo
7071

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ cpu_data:
4646
.PHONY: qcschema
4747
qcschema:
4848
mkdir -p qcschema
49-
python -c "exec(\"import pathlib, qcelemental\nfor md in qcelemental.models.qcschema_models():\n\tmfile = (pathlib.Path('qcschema') / md.__name__).with_suffix('.schema')\n\twith open(mfile, 'w') as fp:\n\t\tfp.write(md.schema_json(indent=4))\")"
49+
python -c "exec(\"import pathlib, qcelemental\nfor md in qcelemental.models.qcschema_models():\n\tmfile = (pathlib.Path('qcschema') / md.__name__).with_suffix('.schema')\n\twith open(mfile, 'w') as fp:\n\t\tfp.write(md.schema_json(indent=None))\")"
5050
python -c "exec(\"import json, pathlib, pydantic, qcelemental\nwith open((pathlib.Path('qcschema') / 'QCSchema').with_suffix('.schema'), 'w') as fp:\n\tjson.dump(pydantic.schema.schema(qcelemental.models.qcschema_models(), title='QCSchema'), fp, indent=4)\")"
5151

5252
.PHONY: clean

qcelemental/info/cpu_info.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414

1515

1616
class VendorEnum(str, Enum):
17-
"""Allowed processor vendors, used for validation.
18-
"""
17+
"""Allowed processor vendors, used for validation."""
1918

2019
amd = "amd"
2120
intel = "intel"
@@ -24,8 +23,7 @@ class VendorEnum(str, Enum):
2423

2524

2625
class InstructionSetEnum(int, Enum):
27-
"""Allowed instruction sets for CPUs in an ordinal enum.
28-
"""
26+
"""Allowed instruction sets for CPUs in an ordinal enum."""
2927

3028
none = 0
3129
sse = 1

qcelemental/models/align.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,9 @@ class AlignmentMill(ProtoModel):
2121
2222
"""
2323

24-
shift: Optional[Array[float]] = Field( # type: ignore
25-
None, description="Translation array (3,) for coordinates."
26-
)
27-
rotation: Optional[Array[float]] = Field( # type: ignore
28-
None, description="Rotation array (3, 3) for coordinates."
29-
)
30-
atommap: Optional[Array[int]] = Field( # type: ignore
31-
None, description="Atom exchange map (nat,) for coordinates."
32-
)
24+
shift: Optional[Array[float]] = Field(None, description="Translation array (3,) for coordinates.") # type: ignore
25+
rotation: Optional[Array[float]] = Field(None, description="Rotation array (3, 3) for coordinates.") # type: ignore
26+
atommap: Optional[Array[int]] = Field(None, description="Atom exchange map (nat,) for coordinates.") # type: ignore
3327
mirror: bool = Field(False, description="Do mirror invert coordinates?")
3428

3529
class Config:

qcelemental/models/common_models.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ class Config(ProtoModel.Config):
6363

6464

6565
class DriverEnum(str, Enum):
66-
"""Allowed computation driver values.
67-
"""
66+
"""Allowed computation driver values."""
6867

6968
energy = "energy"
7069
gradient = "gradient"

qcelemental/models/results.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ class WavefunctionProtocolEnum(str, Enum):
391391

392392
class ErrorCorrectionProtocol(ProtoModel):
393393
"""Configuration for how QCEngine handles error correction
394-
394+
395395
WARNING: These protocols are currently experimental and only supported by NWChem tasks
396396
"""
397397

@@ -452,7 +452,8 @@ class AtomicInput(ProtoModel):
452452
)
453453

454454
extras: Dict[str, Any] = Field(
455-
{}, description="Extra fields not part of the schema. Used for schema development and scratch space.",
455+
{},
456+
description="Extra fields not part of the schema. Used for schema development and scratch space.",
456457
)
457458

458459
provenance: Provenance = Field(

qcelemental/physical_constants/context.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,7 @@ def get(self, physical_constant: str, return_tuple: bool = False) -> Union[float
269269
# me 'electron mass' = 9.10938215E-31 # Electron rest mass (in kg)
270270

271271
def Quantity(self, data: str) -> "quantity._Quantity":
272-
"""Returns a Pint Quantity.
273-
"""
272+
"""Returns a Pint Quantity."""
274273

275274
return self.ureg.Quantity(data)
276275

qcelemental/physical_constants/ureg.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,7 @@ def build_units_registry(context):
129129
# Add contexts
130130

131131
def _find_nist_unit(unit):
132-
"""Converts pint datatypes to NIST datatypes
133-
"""
132+
"""Converts pint datatypes to NIST datatypes"""
134133
for value in unit.to_tuple()[1]:
135134
if value[1] < 1:
136135
continue

qcelemental/testing.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111

1212

1313
def _handle_return(passfail: bool, label: str, message: str, return_message: bool, quiet: bool = False):
14-
"""Function to print a '*label*...PASSED' line to log.
15-
"""
14+
"""Function to print a '*label*...PASSED' line to log."""
1615

1716
if not quiet:
1817
if passfail:
@@ -28,8 +27,7 @@ def _handle_return(passfail: bool, label: str, message: str, return_message: boo
2827

2928

3029
def tnm() -> str:
31-
"""Returns the name of the calling function, usually name of test case.
32-
"""
30+
"""Returns the name of the calling function, usually name of test case."""
3331

3432
return sys._getframe().f_back.f_code.co_name
3533

@@ -480,11 +478,7 @@ def compare_molrecs(
480478
return_message: bool = False,
481479
return_handler: Callable = None,
482480
) -> bool:
483-
"""Function to compare Molecule dictionaries. Prints
484-
# :py:func:`util.success` when elements of `computed` match elements of
485-
# `expected` to `tol` number of digits (for float arrays).
486-
487-
"""
481+
"""Function to compare Molecule dictionaries."""
488482
# Need to manipulate the dictionaries a bit, so hold values
489483
xptd = copy.deepcopy(expected)
490484
cptd = copy.deepcopy(computed)

qcelemental/util/gph_uno_bipartite.py

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ def _formDirected(g, match):
4545
Returns
4646
-------
4747
networkx.DiGraph
48-
Directed graph, with edges in `match` pointing from set-0
49-
(bipartite attribute==0) to set-1 (bipartite attrbiute==1), and
50-
the other edges in `g` but not in `match` pointing from set-1 to
51-
set-0.
48+
Directed graph, with edges in `match` pointing from set-0
49+
(bipartite attribute==0) to set-1 (bipartite attrbiute==1), and
50+
the other edges in `g` but not in `match` pointing from set-1 to
51+
set-0.
5252
5353
"""
5454
import networkx as nx
@@ -127,8 +127,8 @@ def _enumMaximumMatchingIter(g, match, all_matches, add_e=None):
127127
match :
128128
List of edges forming one maximum matching of `g`.
129129
all_matches :
130-
List, each is a list of edges forming a maximum matching of `g`.
131-
Newly found matchings will be appended into this list.
130+
List, each is a list of edges forming a maximum matching of `g`.
131+
Newly found matchings will be appended into this list.
132132
add_e : tuple, optional
133133
Edge used to form subproblems. If not `None`, will be added to each
134134
newly found matchings.
@@ -335,32 +335,32 @@ def _enumMaximumMatching2(g):
335335

336336
def _enumMaximumMatchingIter2(adj, matchadj, all_matches, n1, add_e=None, check_cycle=True):
337337
"""Recurively search maximum matchings.
338-
Similar to _enumMaximumMatching but implemented using adjacency matrix
339-
of graph for a slight speed boost.
340-
341-
Parameters
342-
----------
343-
# g :
344-
# Undirected bipartite graph. Nodes are separated by their
345-
# 'bipartite' attribute.
346-
# match :
347-
# List of edges forming one maximum matching of `g`.
348-
# all_matches :
349-
# List, each is a list of edges forming a maximum matching of `g`.
350-
# Newly found matchings will be appended into this list.
351-
add_e : tuple, optional
352-
Edge used to form subproblems. If not `None`, will be added to each
353-
newly found matchings.
354-
355-
Returns
356-
-------
357-
list
358-
Updated list of all maximum matchings.
359-
360-
Author
361-
------
362-
guangzhi XU (xugzhi1987@gmail.com; guangzhi.xu@outlook.com)
363-
Update time: 2017-05-21 20:09:06.
338+
Similar to _enumMaximumMatching but implemented using adjacency matrix
339+
of graph for a slight speed boost.
340+
341+
Parameters
342+
----------
343+
# g :
344+
# Undirected bipartite graph. Nodes are separated by their
345+
# 'bipartite' attribute.
346+
# match :
347+
# List of edges forming one maximum matching of `g`.
348+
# all_matches :
349+
# List, each is a list of edges forming a maximum matching of `g`.
350+
# Newly found matchings will be appended into this list.
351+
add_e : tuple, optional
352+
Edge used to form subproblems. If not `None`, will be added to each
353+
newly found matchings.
354+
355+
Returns
356+
-------
357+
list
358+
Updated list of all maximum matchings.
359+
360+
Author
361+
------
362+
guangzhi XU (xugzhi1987@gmail.com; guangzhi.xu@outlook.com)
363+
Update time: 2017-05-21 20:09:06.
364364
365365
"""
366366
import networkx as nx

0 commit comments

Comments
 (0)