Pylint report from report.jinja2

Score

8.90 / 10 (previous score: 8.90 / 10)

Messages

Module aixcalibuha.data_types (aixcalibuha/data_types.py)

Line Col. Type Symbol ID Obj Message
19 0 refactor too-many-instance-attributes R0902 Goals
Too many instance attributes (9/7)
67 4 refactor too-many-branches R0912 Goals.__init__
Too many branches (17/12)
506 0 refactor too-many-instance-attributes R0902 CalibrationClass
Too many instance attributes (14/7)
547 4 refactor too-many-arguments R0913 CalibrationClass.__init__
Too many arguments (7/5)
709 0 convention trailing-whitespace C0303
Trailing whitespace

Module bin.guided_setup (bin/guided_setup.py)

Line Col. Type Symbol ID Obj Message
34 12 warning lost-exception W0150 _handle_tsd_input
break statement in finally block may swallow exception
72 12 refactor no-else-raise R1720 _handle_argv
Unnecessary "else" after "raise", remove the "else" and de-indent the code inside it
77 12 warning raise-missing-from W0707 _handle_argv
Consider explicitly re-raising using 'except (ValueError, KeyError) as exc' and 'raise ValueError(f'Given argument is not supported.\n{_handle_argv.__doc__}') from exc'
82 0 refactor too-many-locals R0914 _automatically_generate_mocate
Too many local variables (18/15)
82 0 refactor too-many-statements R0915 _automatically_generate_mocate
Too many statements (55/50)
153 9 warning unspecified-encoding W1514 _automatically_generate_mocate
Using open without explicitly specifying an encoding
157 9 warning unspecified-encoding W1514 _automatically_generate_mocate
Using open without explicitly specifying an encoding
159 9 warning unspecified-encoding W1514 _automatically_generate_mocate
Using open without explicitly specifying an encoding
172 9 warning unspecified-encoding W1514 _automatically_generate_mocate
Using open without explicitly specifying an encoding
182 9 warning unspecified-encoding W1514 _automatically_generate_mocate
Using open without explicitly specifying an encoding
184 9 warning unspecified-encoding W1514 _automatically_generate_mocate
Using open without explicitly specifying an encoding
186 9 warning unspecified-encoding W1514 _automatically_generate_mocate
Using open without explicitly specifying an encoding
196 9 warning unspecified-encoding W1514 _automatically_generate_mocate
Using open without explicitly specifying an encoding
199 9 warning unspecified-encoding W1514 _automatically_generate_mocate
Using open without explicitly specifying an encoding
201 9 warning unspecified-encoding W1514 _automatically_generate_mocate
Using open without explicitly specifying an encoding
210 9 warning unspecified-encoding W1514 _automatically_generate_mocate
Using open without explicitly specifying an encoding
226 0 refactor too-many-locals R0914 main
Too many local variables (43/15)
226 0 refactor too-many-branches R0912 main
Too many branches (19/12)
226 0 refactor too-many-statements R0915 main
Too many statements (108/50)
232 4 warning unreachable W0101 main
Unreachable code
255 12 refactor no-else-break R1723 main
Unnecessary "elif" after "break", remove the leading "el" from "elif"
295 9 warning fixme W0511
TODO: Check if this still works for new installs
314 0 convention line-too-long C0301
Line too long (102/100)
362 26 convention consider-using-f-string C0209 main
Formatting a regular string which could be a f-string
363 13 warning unspecified-encoding W1514 main
Using open without explicitly specifying an encoding
369 28 warning f-string-without-interpolation W1309 main
Using an f-string that does not have any interpolated variables
371 33 warning protected-access W0212 main
Access to a protected member _make_modelica_normpath of a client class
374 0 convention line-too-long C0301
Line too long (103/100)
404 0 convention line-too-long C0301
Line too long (104/100)
453 45 error no-member E1101 main
Instance of 'DymolaAPI' has no 'dymola_path' member
484 11 warning broad-exception-caught W0718 main
Catching too general exception Exception

Module bin.run_modelica_calibration (bin/run_modelica_calibration.py)

Line Col. Type Symbol ID Obj Message
34 12 refactor no-else-raise R1720 _handle_argv
Unnecessary "else" after "raise", remove the "else" and de-indent the code inside it
39 12 warning raise-missing-from W0707 _handle_argv
Consider explicitly re-raising using 'except (ValueError, KeyError) as exc' and 'raise ValueError(f'Given argument is not supported.\n{_handle_argv.__doc__}') from exc'
44 0 convention missing-function-docstring C0116 main
Missing function or method docstring
44 0 refactor too-many-locals R0914 main
Too many local variables (31/15)
44 0 refactor too-many-statements R0915 main
Too many statements (59/50)
46 4 warning unreachable W0101 main
Unreachable code
78 4 convention invalid-name C0103 main
Variable name "e" doesn't conform to snake_case naming style
80 8 warning raise-missing-from W0707 main
Consider explicitly re-raising using 'raise KeyError(f'Given config file does not contain {value_error}. You need to specify this value in order to run the calibration.') from e'
108 14 error no-member E1101 main
Module 'aixcalibuha.utils.configuration' has no 'get_simulation_api_from_config' member
112 8 warning redefined-builtin W0622 main
Redefining built-in 'map'
121 8 error no-member E1101 main
Module 'ebcpy.utils.conversion' has no 'convert_hdf_to_modelica_txt' member

Module examples.e1_A_energy_system_analysis (examples/e1_A_energy_system_analysis.py)

Line Col. Type Symbol ID Obj Message
1 0 convention missing-module-docstring C0114
Missing module docstring
1 0 convention invalid-name C0103
Module name "e1_A_energy_system_analysis" doesn't conform to snake_case naming style
45 0 convention line-too-long C0301
Line too long (107/100)
46 0 convention line-too-long C0301
Line too long (108/100)
101 10 convention consider-using-f-string C0209 main
Formatting a regular string which could be a f-string
116 10 convention consider-using-f-string C0209 main
Formatting a regular string which could be a f-string
121 4 warning unused-variable W0612 main
Unused variable 'fig'
124 25 warning anomalous-backslash-in-string W1401
Anomalous backslash in string: '\m'. String constant might be missing an r prefix.
127 25 warning anomalous-backslash-in-string W1401
Anomalous backslash in string: '\m'. String constant might be missing an r prefix.
130 25 warning anomalous-backslash-in-string W1401
Anomalous backslash in string: '\m'. String constant might be missing an r prefix.

Module examples.e1_B_energy_system_analysis (examples/e1_B_energy_system_analysis.py)

Line Col. Type Symbol ID Obj Message
1 0 convention missing-module-docstring C0114
Missing module docstring
1 0 convention invalid-name C0103
Module name "e1_B_energy_system_analysis" doesn't conform to snake_case naming style
28 0 convention line-too-long C0301
Line too long (108/100)
39 4 convention import-outside-toplevel C0415 main
Import outside toplevel (examples.setup_fmu)
66 10 convention consider-using-f-string C0209 main
Formatting a regular string which could be a f-string
69 4 warning unused-variable W0612 main
Unused variable 'fig'

Module examples.e2_A_optimization_problem_definition (examples/e2_A_optimization_problem_definition.py)

Line Col. Type Symbol ID Obj Message
1 0 convention missing-module-docstring C0114
Missing module docstring
1 0 convention invalid-name C0103
Module name "e2_A_optimization_problem_definition" doesn't conform to snake_case naming style
20 0 refactor too-many-locals R0914 main
Too many local variables (17/15)
126 11 warning broad-exception-caught W0718 main
Catching too general exception Exception
136 11 warning broad-exception-caught W0718 main
Catching too general exception Exception

Module examples.e2_B_optimization_problem_definition (examples/e2_B_optimization_problem_definition.py)

Line Col. Type Symbol ID Obj Message
1 0 convention missing-module-docstring C0114
Missing module docstring
1 0 convention invalid-name C0103
Module name "e2_B_optimization_problem_definition" doesn't conform to snake_case naming style
117 11 warning broad-exception-caught W0718 main
Catching too general exception Exception
127 11 warning broad-exception-caught W0718 main
Catching too general exception Exception

Module examples.e3_sensitivity_analysis_example (examples/e3_sensitivity_analysis_example.py)

Line Col. Type Symbol ID Obj Message
1 0 convention missing-module-docstring C0114
Missing module docstring
41 4 warning redefined-outer-name W0621 run_sensitivity_analysis
Redefining name 'setup_fmu' from outer scope (line 74)
41 4 warning redefined-outer-name W0621 run_sensitivity_analysis
Redefining name 'setup_calibration_classes' from outer scope (line 74)
41 4 convention import-outside-toplevel C0415 run_sensitivity_analysis
Import outside toplevel (examples.setup_fmu, examples.setup_calibration_classes)
74 4 warning unused-import W0611
Unused setup_fmu imported from examples
74 4 warning unused-import W0611
Unused setup_calibration_classes imported from examples

Module examples.e4_calibration_example (examples/e4_calibration_example.py)

Line Col. Type Symbol ID Obj Message
1 0 convention missing-module-docstring C0114
Missing module docstring
12 0 refactor too-many-arguments R0913 run_calibration
Too many arguments (7/5)
12 0 refactor too-many-locals R0914 run_calibration
Too many local variables (20/15)
51 4 convention import-outside-toplevel C0415 run_calibration
Import outside toplevel (examples.setup_fmu, examples.setup_calibration_classes)
101 0 convention line-too-long C0301
Line too long (108/100)

Module examples.e5_automated_process (examples/e5_automated_process.py)

Line Col. Type Symbol ID Obj Message
1 0 convention missing-module-docstring C0114
Missing module docstring

Module /builds/EBC/EBC_all/github_ci/AixCaliBuHA/pylintrc (pylintrc)

Line Col. Type Symbol ID Obj Message
1 0 error unrecognized-option E0015
Unrecognized option found: no-space-check
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'print-statement' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'parameter-unpacking' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'unpacking-in-except' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'old-raise-syntax' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'backtick' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'import-star-module-level' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'apply-builtin' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'basestring-builtin' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'buffer-builtin' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'cmp-builtin' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'coerce-builtin' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'execfile-builtin' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'file-builtin' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'long-builtin' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'raw_input-builtin' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'reduce-builtin' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'standarderror-builtin' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'unicode-builtin' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'xrange-builtin' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'coerce-method' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'delslice-method' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'getslice-method' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'setslice-method' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'no-absolute-import' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'old-division' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'dict-iter-method' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'dict-view-method' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'next-method-called' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'metaclass-assignment' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'indexing-exception' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'raising-string' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'reload-builtin' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'oct-method' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'hex-method' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'nonzero-method' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'cmp-method' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'input-builtin' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'round-builtin' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'intern-builtin' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'unichr-builtin' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'map-builtin-not-iterating' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'zip-builtin-not-iterating' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'range-builtin-not-iterating' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'filter-builtin-not-iterating' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'using-cmp-argument' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'div-method' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'idiv-method' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'rdiv-method' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'exception-message-attribute' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'invalid-str-codec' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'sys-max-int' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'bad-python3-import' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'deprecated-string-function' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'deprecated-str-translate-call' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'deprecated-itertools-function' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'deprecated-types-field' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'next-method-defined' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'dict-items-not-iterating' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'dict-keys-not-iterating' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 refactor useless-option-value R0022
Useless option value for '--disable', 'dict-values-not-iterating' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942.
1 0 warning unknown-option-value W0012
Unknown option value for '--disable', expected a valid pylint message and got 'long-suffix'
1 0 warning unknown-option-value W0012
Unknown option value for '--disable', expected a valid pylint message and got 'old-ne-operator'
1 0 warning unknown-option-value W0012
Unknown option value for '--disable', expected a valid pylint message and got 'old-octal-literal'
1 0 warning unknown-option-value W0012
Unknown option value for '--disable', expected a valid pylint message and got 'non-ascii-bytes-literal'
1 0 warning unknown-option-value W0012
Unknown option value for '--disable', expected a valid pylint message and got 'locally-enabled'
1 0 warning unknown-option-value W0012
Unknown option value for '--disable', expected a valid pylint message and got 'eq-without-hash'

Module tests.test_data_types (tests/test_data_types.py)

Line Col. Type Symbol ID Obj Message
89 17 convention consider-using-f-string C0209 TestDataTypes.test_tuner_paras
Formatting a regular string which could be a f-string

Module tests.test_modelica_cal_sen (tests/test_modelica_cal_sen.py)

Line Col. Type Symbol ID Obj Message
1 0 refactor duplicate-code R0801
Similar lines in 2 files
==bin.guided_setup:[64:102]
==bin.run_modelica_calibration:[26:44]
    __supported_argv = ["--config"]
    # Path to the script is irrelevant
    resulting_setting = {}
    _rel_argv = argv[1:]
    for arg in _rel_argv:
        try:
            name, value = arg.split("=")
            if name not in __supported_argv:
                raise KeyError
            else:
                resulting_setting[name] = value
        except (ValueError, KeyError):
            raise ValueError(f"Given argument is not supported.\n{_handle_argv.__doc__}")

    return resulting_setting


def _automatically_generate_mocate(model_name, savepath, packages=None, **kwargs):
    """
    Function to generate a MOdelica CAlibration TEmplates (MoCaTe)
    package for the given model inside the simulation api.

    :param str model_name:
        Name of the model you want to calibrate.
        If the model is a standalone model without a "package.mo" file,
        you have to pass the path the model. Else the path is extracted
        from the packages-list (see below)
    :param os.path.normpath,str savepath:
        Path to store the generated package
    :param list packages:
        List with filepath to the "package.mo" file of each package required
        to simulate the given model_name.
    :keyword str mocate_version
        Version number of used Modelica Calibration Templates Library. Default is 0.0.4
    :keyword str msl_version
        Version number of used Modelica Calibration Templates Library. Default is 3.2.3
    :return:
    """
1 0 refactor duplicate-code R0801
Similar lines in 2 files
==examples.e2_A_optimization_problem_definition:[122:131]
==examples.e2_B_optimization_problem_definition:[113:122]
                                     index=new_index)
    try:
        goals.set_sim_target_data(sim_target_data)
    except Exception as err:
        print("I knew this error was going to happen. Do you understand "
              "why this happens based on the following message?")
        print(err)
    new_index = meas_target_data.index.values.copy()
    new_index[-10] += 0.05  # Change some value
1 0 refactor duplicate-code R0801
Similar lines in 2 files
==examples.e2_A_optimization_problem_definition:[92:110]
==examples.e2_B_optimization_problem_definition:[82:100]
    }
    # To match the measured data to simulated data,
    # the index has to match with the simulation output
    # Thus, convert it:
    meas_target_data.to_float_index()
    # Lastly, setup the goals object. Note that the statistical_measure
    # is parameter of the python version of this example. It's a metric to
    # compare two set's of time series data. Which one to choose is up to
    # your expert knowledge. If you have no clue, raise an issue or read
    # basic literature on calibration.
    goals = Goals(
        meas_target_data=meas_target_data,
        variable_names=variable_names,
        statistical_measure=statistical_measure,
        weightings=[0.7, 0.3]
    )
    # Let's check if our evaluation is possible by creating some
    # dummy `sim_target_data` with the same index:
1 0 refactor duplicate-code R0801
Similar lines in 2 files
==examples.e2_A_optimization_problem_definition:[213:222]
==examples.e2_B_optimization_problem_definition:[188:197]
    )
    return calibration_classes, validation_class


if __name__ == '__main__':
    main(
        examples_dir=pathlib.Path(__file__).parent,
        multiple_classes=True
    )
1 0 refactor duplicate-code R0801
Similar lines in 2 files
==examples.e2_A_optimization_problem_definition:[197:207]
==examples.e2_B_optimization_problem_definition:[173:183]
    print([c.name for c in calibration_classes])
    calibration_classes_merged = merge_calibration_classes(calibration_classes)
    print([c.name for c in calibration_classes_merged])
    # Don't worry, the relevant_time_interval object keeps track
    # of which time intervals are relevant for the objective calculation
    print("Relevant time interval for class",
          calibration_classes_merged[0].name,
          calibration_classes_merged[0].relevant_intervals)
    # Let's also create an object to later validate our calibration:
    validation_class = CalibrationClass(
1 0 refactor duplicate-code R0801
Similar lines in 2 files
==examples.e2_A_optimization_problem_definition:[132:158]
==examples.e2_B_optimization_problem_definition:[113:120]
                                     index=new_index)
    try:
        goals.set_sim_target_data(sim_target_data)
    except Exception as err:
        print("I knew this error was going to happen. Do you understand "
              "why this happens based on the following message?")
        print(err)
1 0 refactor duplicate-code R0801
Similar lines in 2 files
==examples.e2_A_optimization_problem_definition:[122:129]
==examples.e2_B_optimization_problem_definition:[123:149]
                                     index=new_index)
    try:
        goals.set_sim_target_data(sim_target_data)
    except Exception as err:
        print("I knew this error was going to happen. Do you understand "
              "why this happens based on the following message?")
        print(err)
    # ## Calibration Classes
    # We now are going to wrap everything up into a single object called
    # `CalibrationClass`.
    # Each class has a `name`, a `start_time`, `stop_time` and
    # `goals`, `tuner_paras` (tuner parameters) and `inputs`.
    # The latter three can be set for all
    # classes if a distinction is not required.
    # ### Why do we use a `CalibrationClass`?
    # Because this class contains all information necessary
    # to perform both sensitivity analysis and calibration automatically.
    # ### Can there be multiple classes?
    # Yes! Because we expect different tuner parameters
    # to influence the outputs based on the state of the system,
    # e.g. 'On' and 'Off' more or less. To reduce the complexity of the
    # optimization problem, separating tuner parameters into time intervals
    # can be handy. For example heat losses to the ambient may be most
    # sensitive if the device is just turned off, while efficiency is more
    # sensitive during runtime.
    # Let's also define some different tuner parameters for the last stationary class.
1 0 refactor duplicate-code R0801
Similar lines in 2 files
==examples.e2_A_optimization_problem_definition:[111:120]
==examples.e2_B_optimization_problem_definition:[101:111]
                                     index=meas_target_data.index)

    print("Goals data before setting simulation data:\n", goals.get_goals_data())
    goals.set_sim_target_data(sim_target_data)
    print("Goals data after setting simulation data:\n", goals.get_goals_data())
    print(statistical_measure, "of goals: ", goals.eval_difference())
    print("Verbose information on calculation", goals.eval_difference(verbose=True))
    # Lastly we advice to play around with the index of the sim_target_data to
    # understand the error messages of this framework a little bit better.
    # Example:
1 0 refactor duplicate-code R0801
Similar lines in 2 files
==examples.e2_A_optimization_problem_definition:[70:84]
==examples.e2_B_optimization_problem_definition:[57:73]
    )
    print(tuner_paras)
    print("Names of parameters", tuner_paras.get_names())
    print("Initial values", tuner_paras.get_initial_values())
    # Scaling (will be done internally)
    print("Scaled initial values:\n", tuner_paras.scale(tuner_paras.get_initial_values()))

    # ## Goals
    # The evaluation of your goals (or mathematically speaking 'objective function')
    # depends on the difference of measured to simulated data.
    # Thus, you need to specify both measured and simulated data.
    #
    # Start by loading the measured data generated in 1_A_energy_system_analysis.py:
    data_dir = pathlib.Path(examples_dir).joinpath("data")
1 0 refactor duplicate-code R0801
Similar lines in 2 files
==examples.e2_A_optimization_problem_definition:[10:58]
==examples.e2_B_optimization_problem_definition:[10:53]
import pathlib
# Imports from ebcpy
from ebcpy import TimeSeriesData
# Imports from aixcalibuha
from aixcalibuha import TunerParas, Goals, \
    CalibrationClass
from aixcalibuha.data_types import merge_calibration_classes


def main(
        examples_dir,
        statistical_measure="NRMSE",
        multiple_classes=True
):
    """
    Arguments of this example:

    :param [pathlib.Path, str] examples_dir:
        Path to the examples folder of AixCaliBuHA
    :param str statistical_measure:
        Measure to calculate the scalar of the objective,
        One of the supported methods in
        ebcpy.utils.statistics_analyzer.StatisticsAnalyzer
        e.g. RMSE, MAE, NRMSE
    :param bool multiple_classes:
        If False, all CalibrationClasses will have the
        same name
    """

    # ## Tuner Parameters
    # Tuner parameters are the optimization variables we will be
    # changing to match the simulated onto the measured output.
    #
    # As described in the first example (e1_A_energy_system_analysis),
    # we've changed four parameters in the model. To show the usefulness
    # of sensitivity analysis prior to calibration, we will add a fifth without
    # any influence, the heating curve declination of the heat pump.
    # To define tuner parameters, you have to specify
    # - the name of the parameter
    # - an initial guess
    # - boundaries as a (min, max) tuple.
    # Note that the initial guess is not always used by optimization routines.
    # We've chosen to make it a requirement to prevent blindly accepting
    # calibration results. If the result is very far away from your initial guess
    # and you though you understand the model, maybe the parameter is just not
    # sensitive or influenced by another parameter.
    # How to load the data is up to you. To make the structure clear,
    # we use a 3 element tuple in this example:

Metrics

Count per types

Name Count
error 4
refactor 87
warning 42
convention 29

Count per messages

Name Count
unrecognized-option 1
useless-option-value 60
unknown-option-value 6
trailing-whitespace 1
too-many-instance-attributes 2
too-many-branches 2
too-many-arguments 2
line-too-long 7
fixme 1
lost-exception 1
no-else-raise 2
raise-missing-from 3
too-many-locals 5
unspecified-encoding 12
too-many-statements 3
unreachable 2
no-else-break 1
broad-exception-caught 5
consider-using-f-string 5
f-string-without-interpolation 1
protected-access 1
no-member 3
missing-function-docstring 1
redefined-builtin 1
invalid-name 5
anomalous-backslash-in-string 3
missing-module-docstring 7
unused-variable 2
import-outside-toplevel 3
redefined-outer-name 2
unused-import 2
duplicate-code 10

Count per modules

Name Count
/builds/EBC/EBC_all/github_ci/AixCaliBuHA/pylintrc 67
aixcalibuha.data_types 5
bin.guided_setup 31
bin.run_modelica_calibration 11
examples.e1_A_energy_system_analysis 10
examples.e1_B_energy_system_analysis 6
examples.e2_A_optimization_problem_definition 5
examples.e2_B_optimization_problem_definition 4
examples.e3_sensitivity_analysis_example 6
examples.e4_calibration_example 5
examples.e5_automated_process 1
tests.test_data_types 1
tests.test_modelica_cal_sen 10

Count per path

Name Count
pylintrc 67
aixcalibuha/data_types.py 5
bin/guided_setup.py 31
bin/run_modelica_calibration.py 11
examples/e1_A_energy_system_analysis.py 10
examples/e1_B_energy_system_analysis.py 6
examples/e2_A_optimization_problem_definition.py 5
examples/e2_B_optimization_problem_definition.py 4
examples/e3_sensitivity_analysis_example.py 6
examples/e4_calibration_example.py 5
examples/e5_automated_process.py 1
tests/test_data_types.py 1
tests/test_modelica_cal_sen.py 10