line_num

(function from pyomo.contrib.sensitivity_toolbox.sens)

pyomo.contrib.sensitivity_toolbox.sens.line_num(file_name, target)[source]

This function returns the line number that contains ‘target’ in the file_name. This function identifies constraints that have variables in theta_names.

Parameters:
  • file_name (string) – file includes the variable order (i.e. col file)

  • target (string) – variable name to check

Returns:

count – line number of target in the file

Return type:

int

Raises:

Exception – When file does not include target