Use view extension for exploring the databases (not ready to merge)#1223
Use view extension for exploring the databases (not ready to merge)#1223jmancewicz wants to merge 2 commits into
Conversation
|
@gheinrich can you have a look at this? I'm moving on the the other data extensions, and wanted to get your feedback before I finish them. |
gheinrich
left a comment
There was a problem hiding this comment.
I still need to keep looking into this but this looks good!
| raise NotImplementedError | ||
|
|
||
| @staticmethod | ||
| def can_explore(): |
There was a problem hiding this comment.
why don't you have get_data() return None by default and check the return value on caller side? This way, sub-classes only have to override get_data()
There was a problem hiding this comment.
I didn't because get_data is expensive to compute and the data would be thrown away in that context.
There was a problem hiding this comment.
Also, when all the view extensions are converted, then the can_explore might just go away.
| # view options | ||
| if kwargs['colormap'] == 'dataset': | ||
| if not COLOR_PALETTE_ATTRIBUTE in dataset.extension_userdata or \ | ||
| if COLOR_PALETTE_ATTRIBUTE not in dataset.extension_userdata or \ |
| <script> | ||
| $('#view_extension_id_{{ index }}').on("change", function(){ | ||
| var view_extension_id= $(this).val(); | ||
| var href = "{{url_for('digits.dataset.generic.views.explore')}}" + |
There was a problem hiding this comment.
can't you use the same syntax as in line 82 above?
a97e670 to
fcd256a
Compare
This is a move to use the view extensions to explore the databases.
As it is, it breaks the original image classification exploration.
data extensions need two methods,
can_explore, which is used to enable the "explore the db" button, andget_datawhich retrieves data from the databases, and returns it in the same format that inference would.Included in this PR is the imageSegmentation data view extension changes.