Skip to main content

atrfu

A-TRFu, an advanced trust-region funnel method for grey-box optimisation with Pyomo. A grey-box problem couples an equation-based Pyomo model with black boxes, such as simulations or legacy code, that can only be evaluated.

Documentation: https://atrfu.readthedocs.io

Install

pip install atrfu
conda install -c conda-forge ipopt     # the subproblem solver (not pip-installable)
atrfu check                            # confirms IPOPT and gjh are found

AMPL's gjh is downloaded automatically on first use, or in advance with atrfu install-gjh.

Example

from pyomo.environ import ConcreteModel, Constraint, ExternalFunction, Objective, Var
from atrfu import TrustRegionSolver

def distance(a, b):                    # a black box: only its values are used
    return a**2 + b**2

m = ConcreteModel()
m.x1 = Var(bounds=(-3, 3), initialize=0.5)
m.x2 = Var(bounds=(-3, 3), initialize=0.5)
m.y = Var(bounds=(0, 18))
m.bb = ExternalFunction(distance)
m.link = Constraint(expr=m.y == m.bb(m.x1, m.x2))
m.disc = Constraint(expr=m.y <= 1)
m.obj = Objective(expr=(m.x1 - 2)**2 + (m.x2 - 1)**2)

result = TrustRegionSolver(verbose=1).solve(m, {"distance": [m.bb]})
print(result["status"], result["final_obj"], m.x1.value, m.x2.value)

See the user guide and the tuning guide.

Citing

Please cite G. Hameed, Rigorous Trust-Region Algorithms for Surrogate-based Grey-box Optimisation, PhD thesis, University of Surrey, 2026, and the software release (CITATION.cff, Zenodo DOI per release).

License

MIT. Files derived from Pyomo keep their BSD-3-Clause notice.

Metadata

Release files for atrfu 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for atrfu 1.0.0
File Size Uploaded Provenance Actions
atrfu-1.0.0.tar.gz 40.7 kB With provenance Details for atrfu-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for atrfu 1.0.0
File Interpreter ABI Platform Actions
atrfu-1.0.0-py3-none-any.whl Python 3 none any Details for atrfu-1.0.0-py3-none-any.whl

Total release size: 79.8 kB

Release files / atrfu-1.0.0.tar.gz

Download URL atrfu-1.0.0.tar.gz
Size 40.7 kB
Tags Source
SHA-256 checksum
How to use checksums
46a3265cdfffd0a025f6b6182542a253ea9c161e4afe2a6b987389fcee06bc34
BLAKE2b-256 checksum
How to use checksums
6a4e0b047329c7795841b33d572bc52aee2c80c189ee64c48dd6feb3120433a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Release files / atrfu-1.0.0-py3-none-any.whl

Download URL atrfu-1.0.0-py3-none-any.whl
Size 39.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e93e93ca1821d923e100dac98e1b55ebdcf32822d71b6c40e238dd0160327853
BLAKE2b-256 checksum
How to use checksums
c5bf6ed73761e410e7f14b2507111692ffea10c83174d85be644f7d5f1f28bf4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Security for atrfu 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for atrfu-1.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page