pedrojrv/nucml

View on GitHub

Showing 5 of 41 total issues

Function load_exfor has a Cognitive Complexity of 26 (exceeds 8 allowed). Consider refactoring.
Confirmed

def load_exfor(log=False, basic=-1, mode="neutrons", filters=False, max_en=2.0E7):
"""Load the EXFOR dataset in its varius forms.
 
This function helps load ML-ready EXFOR datasets for different particle induce reactions or all of them.
 
 
Severity: Minor
Found in nucml/datasets/exfor.py - About 3 hrs to fix

Function ml_results_plotly has a Cognitive Complexity of 20 (exceeds 8 allowed). Consider refactoring.
Confirmed

def ml_results_plotly(results_dict, order_dict={}, save=False, render_browser=False, show=False):
"""Plot the machine learning predictions from the dictionary generated by the.
 
Args:
results_dict (dict): Generated dictionary from the .
Severity: Minor
Found in nucml/exfor/plot.py - About 2 hrs to fix

Function plot_exfor_w_references has a Cognitive Complexity of 18 (exceeds 8 allowed). Consider refactoring.
Confirmed

def plot_exfor_w_references(df, Z, A, MT, nat_iso="I", new_data=empty_df, endf=empty_df, error=False, get_endf=True,
reverse_log=False, legend_size=21, save=False, interpolate=False, legend=False, alpha=0.7,
one_hot=False, log_plot=False, path='', ref=False, new_data_label="Additional Data",
dpi=300, figure_size=(14, 10)):
"""Plot Cross Section for a particular Isotope with or without references.
Severity: Minor
Found in nucml/exfor/data_utilities.py - About 1 hr to fix

Function _parse_and_format_numerical_columns has a Cognitive Complexity of 16 (exceeds 8 allowed). Consider refactoring.
Confirmed

def _parse_and_format_numerical_columns(df):
# Defining Numerical Columns to Fix and casting them as strings
cols = ["Energy", "dEnergy", "Data", "dData", "Cos/LO", "dCos/LO", "ELV/HL", "dELV/HL"]
df[cols] = df[cols].astype(str)
df[cols] = df[cols].replace(to_replace=" ", value=np.nan)
Severity: Minor
Found in nucml/exfor/csv_creator.py - About 1 hr to fix

Function generate_bench_ml_xs has a Cognitive Complexity of 12 (exceeds 8 allowed). Consider refactoring.
Confirmed

def generate_bench_ml_xs(df, models_df, bench_name, to_scale, raw_saving_dir, template_dir=template_path,
comp_threshold=0.10):
"""Generate cross section files using ML-generated values."""
to_scale_copy = to_scale.copy()
results_df = models_df.copy()
Severity: Minor
Found in nucml/ace/ml_utilities.py - About 55 mins to fix
Severity
Category
Status
Source
Language