if things are expensive, they should look expensive
rmnldwg opened this issue · comments
Right now, the package makes heavy use of Python's @property
decorator. For example, loading data is as "easy" as writing
model.patient_data = some_pandas_table
This looks like I am only storing the table inside the model object. But actually, it is computing the diagnose matrix which is rather expensive. So, making this a function instead of a property would give it the look and feel of something potentially resource-intensive:
model.load_patient_data(some_pandas_table)
A lot has happened with the new 1.0 API. In particular, setting new parameters does not immediately trigger a recomputation of expensive stuff like the transition matrix.
Thus, in keeping with this issue, it would make sense to replace model.transition_matrx
with model.transition_matrix()
to hint at the user that this might be expensive (although it often is not due to caching).