Closed TobyBoyne closed 3 months ago
This should fail the typechecking pipeline, due to an error spotted by pyright below. I believe this is because this PR has highlighted an issue with the Output
class, which does not define an Output.objective
attribute by default. However, all classes that subclass it do define an objective
.
Implements generic typing for Features.
Currently, the dynamic typing for
Features
,Inputs
, andOutputs
doesn't work well with pyright. There are many# type: ignore
s in the codebase, such as shown below, to address this. However, a solution that does work with pyright is generic typing. With this PR, you can remove these comments and the type checker is still happy. The API for interacting withFeatures
,Inputs
, andOutputs
remains unchanged,https://github.com/experimental-design/bofire/blob/0efb4685ce72c163a44e0f1fdc325ce191dda31d/bofire/data_models/strategies/predictives/botorch.py#L198