bqth29 / simulated-bifurcation-algorithm

Python CPU/GPU implementation of the Simulated Bifurcation (SB) algorithm to solve quadratic optimization problems (QUBO, Ising, TSP, optimal asset allocations for a portfolio, etc.).
MIT License
103 stars 25 forks source link

[ENH] Replace `logging.warning` with `warnings.warn` #34

Closed seanlaw closed 10 months ago

seanlaw commented 11 months ago

As discussed in #30

It might be more useful to use warnings.warn instead of logging.warning as the former can be caught like an exception and the user can specify some other settings to try that might improve convergence and not require human intervention. Currently, with logging.warning, there's no easy way to programmatically know that the simulation did not converge (there's no way to introspect the agents or the state of the simulator that I am aware of).

Thank you for your consideration!