File fritz.py
has 466 lines of code (exceeds 250 allowed). Consider refactoring. Open
########################################################################################################################
__doc__ = \
"""
See GitHub documentation
Fritz
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
class Fritz:
"""
Fritz is a helper class for Victor for use with OpenMM.
It replaces Igor, the pyrosetta one.
Function restrain
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def restrain(self, system: mm.System, pdb: Union[mma.PDBFile, mma.Modeller],
k: float = 1_000.0,
atom_indices: Sequence[int] = (),
**args):
"""
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self,
Function create_simulation
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def create_simulation(self,
model: Union[mma.PDBFile, mma.Modeller, None] = None,
restraint_k: float = 1_000,
restraining_atom_indices: Sequence[int] = (),
mobile_radius: float = 8.0,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function correct_pdbinfo
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def correct_pdbinfo(mol: Chem.Mol, resn: str, resi: int, chain: str):
"""
In Igor, RDKit to Params fixes it.
In RDKit MolToPDBBlock https://github.com/rdkit/rdkit/blob/32655f5365e363ce13bd6b28e2e9e2544f8680bd/Code/GraphMol/FileParsers/PDBWriter.cpp#L66
it is hidden.
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function restrain
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def restrain(self, system: mm.System, pdb: Union[mma.PDBFile, mma.Modeller],
Function create_simulation
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_simulation(self,
Function shift_ligand
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def shift_ligand(self, simulation: mma.Simulation, amount: Union[mmu.Quantity, mm.Vec3, float]):
if isinstance(amount, float):
amount: mmu.Quantity = mm.Vec3(amount, 0, 0) * mmu.angstrom
elif isinstance(amount, mm.Vec3):
amount: mmu.Quantity = amount * mmu.angstrom
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"