Open BelhalK opened 8 years ago
Plus one on the feature request, roughly the way to achieve this feature with maximum code reuse of draw_state
is
engine_json
from the gpmcc_geneator
table in the bdb
.states
entry from the engine_json
which gives a list of the metadata for each "model"Zv
and Zrv
in place of the current X_L
and M_c
and X_D
metadata from lovecat (not sure about the exact details).@fsaad if you're not sure of the exact details of using those vars, I'm not sure who is. Can you clarify what you're unsure about? Is it something we should discuss?
Belhal, you said you might work on it before I did. Have you?
I did. The 'exact details' of @fsaad are wrt the combination of those vars to make this following function work:
DrawStateUtils.sort_state(X_L, X_D, M_c, T)
Ultimately, making it work will solve DrawStateUtils.gen_cell_colors
output.
The first strategy consist in building the new X_L, X_D and M_c with gpmcc metadat. For instance, we know that:
scheme = bu.query(first,'''select engine_json from gpmcc_generator where generator_id= 1;''')
X_D = schema['states'][0]['Zrv']
and that
X_L['column_partition']['assignments'] = schema['states'][0]['Zv']
I am looking at https://github.com/probcomp/gpmcc_metamodel/blob/master/gpmcc_metamodel/utils/convert.py script to kind of write the inverse conversion (gpmcc to lovcat)
The
draw_state
function I'm using from crosscat.utils does not work with gpmcc as it is because of :modelno
argument does not make sense anymoreWould be great to adapt it to gpmcc. @gregory-marton would be happy to help on that.