diatomic/hamiltonian.py
File hamiltonian.py
has 793 lines of code (exceeds 250 allowed). Consider refactoring. Wontfix
Wontfix
import os
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
Function solve
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
def solve(self, ops, ypar=None, energy_range_index=None, energy_range_value=None):
"""A general function which solves the coupled system of Shcrodinger equations
Args:
energy_range_index (tuple, optional): Specifies a subset of
- 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 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, objs, pair_states, label, model='pointwise', rotc=0.0,
Function extract_terms_in_range
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def extract_terms_in_range(self, uenergy=None, lenergy=None, usymm=None,
Function plot_radial_functions
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def plot_radial_functions(self, ops, show=False, fname=None, subplots=None,
Function plot_levels_hist
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def plot_levels_hist(self, data=None, show=False, fname=None,
Function _five_diagonal_matrix
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _five_diagonal_matrix(self, a, b, c, k1=0, k2=1, k3=2):
Function _arange_levels
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _arange_levels(self, jrotn, par, iso, evalues, evecs, shift_enr=[0.0]):
Function plot_eigenfunctions
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def plot_eigenfunctions(self, nlevels, show=False, fname=None,
Function plot_hamiltonian_colormesh
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def plot_hamiltonian_colormesh(self, rows=None, cols=None, show=False,
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, objs, eig_decomp='lapack', lapack_driver='evr',
Function __init__
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def __init__(self, objs, eig_decomp='lapack', lapack_driver='evr',
arpack_options=('LM', 6, None), is_weighted=False):
"""Construct the Hamiltonian object.
- 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"