Showing 63 of 63 total issues
File agent.py
has 528 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import sysfrom collections.abc import Collection, Iterable, Iteratorfrom itertools import chainfrom typing import Any, Generic, Literal, Optional, TypeVar, Union
File exploration.py
has 436 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
r"""Exploration is a fundamental concept in Reinforcement Learning. Without it, oftenthe learning algorithms converge to very suboptimal solutions, or don't even work. This submodule contains base classes and implementations for exploration strategies inthe context of MPC-based RL. These classes allow the agent to draw perturbations to
File bayesopt.py
has 430 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
r""".. _examples_bayesopt: Bayesian Optimization for MPC Data-driven Tuning================================================
File lstd_dpg.py
has 385 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import sysfrom collections.abc import Collection, Iteratorfrom typing import Callable, Generic, Literal, Optional, SupportsFloat, Union import casadi as cs
File control.py
has 345 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"""A collection of basic utility functions for control applications. In particular, itcontains functions for solving the LQR problems in continuous- and discrete-time,discretization methods such as Runge-Kutta 4, and functions to build Control BarrierFunctions.
File lstd_q_learning.py
has 326 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import sysfrom collections.abc import Collection, Iterablefrom typing import Callable, Generic, Literal, Optional, SupportsFloat, Union import casadi as cs
File learning_agent.py
has 304 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
from abc import ABC, abstractmethodfrom collections.abc import Collection, Iterablefrom typing import Any, Callable, Generic, Optional, TypeVar, Union import numpy as np
File callbacks.py
has 281 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"""As it will be clear from the inheritance diagram in :ref:`module_reference_agents`,all agents are derived from mixin classes that define callbacks and manage hooksattached to these callbacks. These system allows not only the user to customize thebehaviour of a derived agent every time a callback is triggered, but also to easilyimplement and manage all those events and quantities that need to be scheduled during
File parameters.py
has 281 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"""Given an MPC controller with several symbolic parameters (some meant to be learned,some other not), we need a way to specify to the agent of choice which of these areindeed learnable. This is done by the use of the two classes introduced in thissubmodule.
Function __init__
has 18 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(
File math.py
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"""A collection of functions for mathematical operations and utilities. In particular,these functions support the creation of monomial basis functions for approximating thevalue function, and the modifications of Hessian matrices to positive-definite ones.""" from itertools import combinations as _combinations
File q_learning_offpolicy.py
has 254 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
r""".. _examples_qlearning_offpolicy: Off-policy Q-learning=====================
Function __init__
has 14 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(
Function train_one_episode
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
def train_one_episode( self, env: Env[ObsType, ActType], episode: int, init_state: ObsType,
- Read upRead up
Function __init__
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def __init__(self, constraint_violation_penalty: float) -> None: """Creates a CSTR environment. Parameters ----------
Function __init__
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(
Function __init__
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
def __init__( self, agent: Agent[SymType], log_name: Optional[str] = None, level: int = logging.INFO,
- Read upRead up
Function __init__
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(
Function __init__
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(
Function _adam
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _adam(