Add basic element filter#559
Conversation
There was a problem hiding this comment.
maybe best to call this file filters.py
There was a problem hiding this comment.
Yes good point, filter is a keyword, so a bit dangerous
| warnings.warn("Unable to read elements lists.", stacklevel=2) | ||
|
|
||
| @staticmethod | ||
| def filter_data( |
There was a problem hiding this comment.
we probably need to generalise this in some way. im unsure we can fully generalise it, but at least different helper functions for different types of data
There was a problem hiding this comment.
Yes definitely! For now, I think we'll have two main general types: one where we only have one list e.g. Li diffusion, and one where we have a list of lists as the elements, and then the filter for now should basically be the same for all apps: if there's an overlap in the superset, set all metrics to None, which should be entirely general, but as we expand this, they'll differentiate based on data
| from ml_peg.app import APP_ROOT | ||
| from ml_peg.app.base_app import BaseApp | ||
| from ml_peg.app.utils.build_callbacks import ( | ||
| filter_table, |
There was a problem hiding this comment.
i think this is in base_app.py not build callbacks?
There was a problem hiding this comment.
Ah yes the DMC_ICE/X23 examples are less up to date, sorry
| ) | ||
|
|
||
| states = [] | ||
| for entry in app_entries: |
There was a problem hiding this comment.
here we use unsorted app entries but we use sorted above. i think this will assign the incorrect weights as we dont assingn to a specific key
There was a problem hiding this comment.
Ah yes I think this should be sorted too, god catch
This reverts commit d3c994a.
f68f79d to
ba17009
Compare
Pre-review checklist for PR author
PR author must check the checkboxes below when creating the PR.
Summary
This is a (somewhat) simplified version of #512, in that each test will only filter based on the superset of elements it contains, and so we will not partially update scores.
However, this still requires most of the mechanics of the full filter:
infoandelementsattributes to app, which can store information required for element filteringstoresproperty to all apps, to make computed/raw/weights/thresholds globally accessiblefilter_tablefunction to apps, which at base just returns the same data, but is the mechanism for applying the filterNoneandNaNand allowNoneas valid score option.How this works more generally is:
info.jsonor similarinfo.json, and afilter_tablefunction that uses this information, and a list of elements to be filtered, to modify the rows of the tablesThis is all that benchmark contributors should need to worry about. From a backend perspective, the main change is that while previously, only one table would be updated at a time, and these tables would always be on the current page, now all tables will update simultaneously, and most of these will not be rendered.
This means that we cannot rely in table.data, so must use globally accessible stored values for tables. We then also need to make sure updates to summaries are robust to multiple triggers, rather than one at a time. The current form is relatively inefficient, as it will trigger many, many times, but I think this is an ok starting point.
There are a few things left to do:
info.jsondatainfo.jsonto a set of elementsfilter_tableto all apps to apply the filter to a tableLinked issue
Resolves #255
Testing