Skip to content

Add tests for untested public Python API methods #2311

Open

Description

@ramakrishnap-nv

These public Python methods are not named in any test under python/*/tests. Found by checking each public method of the main API classes against the test sources. Getter methods (get_*, get*) are out of scope for this issue.

LP/MILP/QP modeling (cuopt/linear_programming/problem.py)

  • Variable.setObjectiveCoefficient, Variable.setLowerBound, Variable.setUpperBound, Variable.setVariableName: the camelCase setters.
  • LinearExpression.zipVarCoefficients
  • Problem.Obj

DataModel (cuopt/linear_programming/data_model/data_model.py)

  • clear_quadratic_constraints
  • set_variable_names, set_row_names, set_objective_name, set_problem_name: set, then check they are kept (for example through an MPS write and read back).

Solution (cuopt/linear_programming/solution/solution.py)

  • raise_if_lp_solution, raise_if_milp_solution: check each raises for the wrong problem type and does not for the right one.

Routing

  • re_routing.generate_capacity_constraints_for_vehicle_order_match
  • Assignment.display_routes

Docs

  • python/cuopt/cuopt/tests/routing/API_COVERAGE.md says display_routes() is covered by test_vehicle_properties and the Assignment getters by test_solver. display_routes is not named in any test, so the table is stale. Update it once the tests are in.

Out of scope here

The cuopt_sh command-line options --upload-solution, --cache, --delete, --only-validation, --warmstart-id, --queued, --running and --status also have no direct test. Track them separately if wanted.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions