-
Notifications
You must be signed in to change notification settings - Fork 0
Description
In light of potential changes to future versions of the cost models, it might be helpful to consider moving to a Python-based package for precompiling and accessing the cost model workbooks which does not rely on the COM server (as cost_model_queries does).
For example "formulas" could be used https://formulas.readthedocs.io/en/stable/ , as it seems fairly easy to use and well-maintained.
Formula's uses the following syntax to calculate outputs from a model:
xl_model.calculate(
inputs={
"'[excel.xlsx]'!INPUT_A": 3, # To overwrite the default value.
"'[excel.xlsx]DATA'!B3": 1 # To impose a value to B3 cell.
},
outputs=[
"'[excel.xlsx]DATA'!C2", "'[excel.xlsx]DATA'!C4"
] # To define the outputs that you want to calculate.
)
So the replacement would require writing some bridging functions that identify where inputs need to be added for each sample of cost model inputs, recalculating and extracting the result and then repeating this for each sample.