Skip to content

[Feature] Add Colville test function (closes #12)#18

Merged
SimonBlanke merged 2 commits intoSimonBlanke:mainfrom
Jitenndra03:main
Mar 11, 2026
Merged

[Feature] Add Colville test function (closes #12)#18
SimonBlanke merged 2 commits intoSimonBlanke:mainfrom
Jitenndra03:main

Conversation

@Jitenndra03
Copy link
Contributor

@Jitenndra03 Jitenndra03 commented Mar 10, 2026

Description

Adds the Colville benchmark function to the algebraic test functions in Surfaces.
The Colville function is a 4-dimensional nonlinear optimization benchmark with a global minimum at (1, 1, 1, 1).

This implementation includes:

  • Scalar objective evaluation
  • Vectorized batch evaluation
  • Search space generation
  • Metadata (formula, bounds, reference)

Reference:
https://www.sfu.ca/~ssurjano/colville.html


Related Issues

Fixes #12


Type of Change

  • [BUG] - Bug fix (non-breaking change fixing an issue)
  • [ENH] - New feature (non-breaking change adding functionality)
  • [DOC] - Documentation only
  • [MNT] - Maintenance (refactoring, dependencies, CI)

How was this solved?

Implemented a new algebraic test function class ColvilleFunction that inherits from AlgebraicFunction.

Key steps:

  • Implemented the Colville function formula in _objective
  • Added vectorized evaluation using _batch_objective
  • Defined metadata such as bounds, formula, reference, and global optimum
  • Implemented _search_space using existing helper utilities
  • Fixed dimensionality to 4 variables

The implementation follows the structure and conventions used in other algebraic test functions in the repository.


Checklist

Required

  • PR title includes appropriate tag: [BUG], [ENH], [DOC] or [MNT]
  • Code passes make check (lint, format, isort)

Tests

  • Tests added/updated for changes
  • No tests needed (briefly explain why: Function follows existing algebraic function patterns and was verified through manual evaluation)

Documentation

  • Documentation added/updated (docstrings and metadata fields)
  • No documentation needed

Note: New features ([ENH]) typically require both tests and documentation.


Testing

The function was tested manually.

Example:

from surfaces.test_functions.algebraic import ColvilleFunction

f = ColvilleFunction()

print(f({"x0":1,"x1":1,"x2":1,"x3":1}))

Output:

0.0

This matches the known global minimum:

f(1,1,1,1) = 0

@Jitenndra03 Jitenndra03 changed the title [Feature] Add Colville test function (closes #12) [Feature] Add Colville test function (closes #18) Mar 10, 2026
Copy link
Owner

@SimonBlanke SimonBlanke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check the code quality

@Jitenndra03 Jitenndra03 changed the title [Feature] Add Colville test function (closes #18) [Feature] Add Colville test function (closes #12) Mar 10, 2026
@Jitenndra03
Copy link
Contributor Author

Hi @SimonBlanke,

Sorry, but I couldn't understand the requested changes. Could you please clarify what needs to be modified?

@SimonBlanke
Copy link
Owner

SimonBlanke commented Mar 11, 2026

Hi @SimonBlanke,

Sorry, but I couldn't understand the requested changes. Could you please clarify what needs to be modified?

It was about this code-quality check in the CI:
https://github.com/SimonBlanke/Surfaces/actions/runs/22917946441/job/66622118162?pr=18

But you took care of it. Well done.

Let's see how the rest of the tests go.

@Jitenndra03
Copy link
Contributor Author

Hi @SimonBlanke,

I ran the full integration test suite in a Python 3.11 environment
(using GitHub Codespaces) and all tests pass successfully.

Please let me know if any further changes are required.

@SimonBlanke
Copy link
Owner

Hi @SimonBlanke,

I ran the full integration test suite in a Python 3.11 environment (using GitHub Codespaces) and all tests pass successfully.

Please let me know if any further changes are required.

This was just a sporadic test fail.

Copy link
Owner

@SimonBlanke SimonBlanke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work. You understood the structure of the module and the test-functions architecture.

@SimonBlanke SimonBlanke merged commit c772354 into SimonBlanke:main Mar 11, 2026
41 of 42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ENH] add Colville function to test-functions

2 participants