Database.ras(
target_rows,
target_cols,
scenario: str = 'baseline',
inplace: bool = True,
calc_all: bool = True,
notes=None,
tol: float = 1e-08,
max_iter: int = 1000,
)#

Balance the Z block of one IOT scenario with the RAS method.

Parameters:
  • target_rows – Desired row sums for the Z matrix.

  • target_cols – Desired column sums for the Z matrix.

  • scenario – Scenario whose Z block should be balanced.

  • inplace – When True, mutate the current database. When False, return a balanced copy.

  • calc_all – When True, recompute the standard dependent matrices after replacing Z.

  • notes – Optional user notes appended to metadata history.

  • tol – Absolute convergence tolerance passed to mario.ras().

  • max_iter – Maximum number of RAS iterations.

Returns:

Balanced database when inplace=False, otherwise None.

Return type:

Database | None