ConfigSpace
ConfigSpace copied to clipboard
Refactor: Remove Cython - Reduce tech debt
This PR attempts to first convert everything to Python, so a type checker can be run across everything as well as use linters properly. This also includes updating everything to pytest.
Note: This PR is unreviewable. The strategy has been to minimally change tests while refactoring to ensure tested behaviour still passes. Some notable exceptions are where functionality was removed or sampling strategy was changed and the expected values differ. Unfortunatly the formatter has rendered them also unreviewable.
Update: All SMAC unittests passed without code changes so it seems mostly backwards compatible.
Some notable changes:
- No more unbounded Normals
- No more quantized hyperparameters
- Sampling is 3x faster, Neighbors 3.5x faster and validation 2x faster (see scripts/benchmark_sampling.py)
- More code re-use between classes
- Pure Python, jumping to definition and docstrings should work in editors
- Defined data-structures to capture heirarchy in conditional spaces, moving the logic out of ConfigurationSpace.
- Better defined public API for ConfigurationSpace.
- Better support for custom hyperparameters, i.e. backed by Scipy Distributions (see BetaFloat/Int). Should require a lot less code to do so.
- Better defined public API for hyperparameters
- A whole load of deprecations with recommended alternatives
- Categoricals/Ordinals support arbitrary objects, e.g. no more need to specify
Category([True, False, "None"])(Now handled in follow up #359)
TODO:
- Seems deeply nested conditions with OR's were not solved #72
- We can add a flag
Configuration(space, vector, validate=False)to deal with #75 - Allow constants with arbitrary values #86 #95
- Closes #338
- Closes #336
- Closes #357
- Closes #356
- Closes #348
- Closes #344
- Closes #343
- Closes #342
- Closes #334
- Closes #330
- Closes #326
- Closes #166
- Closes #302
- Closes #288
- Closes #237
- Closes #270
- Closes #346
- Closes #290
- Closes #291
- Closes #293
- Closes #284
- Closes #264
- Closes #261
- Closes #262
- Closes #236
- Closes #262
- Closes #239
- Closes #206
- Closes #200
- Closes #133
- Closes #104