Skip to content

Update apps for element filtering#577

Draft
ElliottKasoar wants to merge 7 commits into
ddmms:mainfrom
ElliottKasoar:add-app-filter
Draft

Update apps for element filtering#577
ElliottKasoar wants to merge 7 commits into
ddmms:mainfrom
ElliottKasoar:add-app-filter

Conversation

@ElliottKasoar
Copy link
Copy Markdown
Collaborator

Pre-review checklist for PR author

PR author must check the checkboxes below when creating the PR.

Summary

Continuation of #559.

This introduces the app changes needed to actually apply the element filter. This needs to be generalised and added to all apps. X23/DMC_ICE are a little out of date currently, and testing won't work until the analysis is updated and re-run.

@ElliottKasoar ElliottKasoar added the enhancement New feature or request label May 29, 2026
@joehart2001
Copy link
Copy Markdown
Collaborator

whats the curernt plan for this and #578 ?

@ElliottKasoar
Copy link
Copy Markdown
Collaborator Author

ElliottKasoar commented May 31, 2026

whats the curernt plan for this and #578?

If you ignore the changes to DMC_ICE/X23 apps (which were starting points for the full filtering), the main change each app needs is what's in app_si_defects.py, so actually very minimal. There should only really be two forms of set_elements, one where there's a single list, and one where there's a list of lists of elements.

So if you take a look at the NEB app changes + backend changes, and see what you think? I can work through the other app changes reasonably quickly.

#578 is where the bulk of the work is left, since we need to save the info.json that the apps read. I've basically written two forms of helper corresponding to the two forms of set_elements, but could use your help to go through the remaining analyses and adding these in.

It's not conceptually that difficult, but often not entirely trivial either. Most of the ones I've changed and pushed work, but a couple e.g. CPOSS209 aren't quite working yet, but the idea should be reasonably clear.

Comment thread ml_peg/app/base_app.py
"""Register callbacks with app."""
pass

def filter_table(self, filter_elements: list[str] | None) -> dict[str, dict]:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this funciton mutating self.table.data is dangerous for the hosted app with multiple users. i think we should build from deepcopy(self.original_table.data)?

def set_elements(self) -> None:
"""Get element sets for filtering."""
try:
self.elements = set(self.info["elements"][0])
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think "elements"[0] = "L" here not "Li"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants