Skip to content

Conversation

esoteric-ephemera
Copy link
Contributor

@esoteric-ephemera esoteric-ephemera commented Aug 14, 2025

Can be merged once emmet-core #1267 is merged/released.

  • Migrates sole maggma import to emmet.core, removes maggma from dependencies.
  • Adds ConversionElectrodeRester to query the conversion_electrodes endpoint

@esoteric-ephemera esoteric-ephemera changed the title Remove maggma dependence Remove maggma dependence, add conversion electrode rester Aug 27, 2025
@esoteric-ephemera
Copy link
Contributor Author

esoteric-ephemera commented Aug 27, 2025

@tschaume there seem to be some issues with the conversion_electrodes endpoint, perhaps that's why a client search feature wasn't added for it before? Have basically flagged these in the class itself under _exclude_search_fields

  • material_ids is listed as a valid search term in the docs, but there are neither material_id or material_ids fields in the schema
  • formula, chemsys, and elements do not return any matches despite manually checking values from OpenData
  • stability_charge and stability_discharge are also not working
  • Similarly, passing exclude_elements will return the entire collection

Copy link
Member

@tschaume tschaume left a comment

Choose a reason for hiding this comment

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

Looks good!

The issues you found are likely due to the the query operators defined here. The multi-material query isn't needed, for instance. It could be that it was a simple copy-paste oversight when the endpoint was added in emmet PR 814.

@kbuma maybe you could take a closer look at the operator definitions for the conversion electrodes endpoints as part of your cleanup in emmet PR 1282? Thanks!

@@ -66,7 +66,7 @@ def client_search_testing(
f"Parameter '{param}' with type '{param_type}' was not "
"properly identified in the generic search method test."
)

print(q)
Copy link
Member

Choose a reason for hiding this comment

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

remove

@kbuma
Copy link
Collaborator

kbuma commented Sep 9, 2025

@kbuma maybe you could take a closer look at the operator definitions for the conversion electrodes endpoints as part of your cleanup in emmet PR 1282? Thanks!

@tschaume do you want me remove the ElectrodeMultiMaterialIDQuery() from the list of query operators for conversion_electrodes and insertion_electrodes endpoints? Or just the conversion one?

@tschaume
Copy link
Member

tschaume commented Sep 9, 2025

@kbuma Yes, the multi-ID query can be removed for both endpoints. We should also double-check the other query parameters @esoteric-ephemera mentioned in his comment.

@kbuma
Copy link
Collaborator

kbuma commented Sep 19, 2025

@tschaume there seem to be some issues with the conversion_electrodes endpoint, perhaps that's why a client search feature wasn't added for it before? Have basically flagged these in the class itself under _exclude_search_fields

  • material_ids is listed as a valid search term in the docs, but there are neither material_id or material_ids fields in the schema
  • formula, chemsys, and elements do not return any matches despite manually checking values from OpenData
  • stability_charge and stability_discharge are also not working
  • Similarly, passing exclude_elements will return the entire collection

@tschaume here's my findings on this - please advise how you'd like to proceed:

  • material_ids we already took care of and have removed from both electrode endpoint so @esoteric-ephemera can remove that from _exclude_search_fields
  • formula, chemsys and elements resolve to checking against fields in the entries_composition_summary object in insertion_electrodes This field does not exist in conversion_electrodes I can remove the query operators for those from the router for conversion_electrodes on the server-side if you like; any other changes would require discussion on how to implement
  • stability_charge and stability_discharge resolve to those fields in insertion_electrodes. They do not exist in conversion_electrodes I can remove the InsertionVoltageStepQuery from the router for conversion_electrodes on the server-side if you like; not sure if this makes sense to implement

@tschaume
Copy link
Member

@kbuma Thanks for tracking this down! I'm getting the impression that the query operators were added in anticipation of the according fields being available in the endpoints but that never materialized. @esoteric-ephemera @tsmathis Do you think that adding these fields makes sense and is expected for the conversion/insertion_electrodes endpoints?

@esoteric-ephemera
Copy link
Contributor Author

esoteric-ephemera commented Sep 19, 2025

Those fields don't make as much sense for a conversion electrode - the electrode changes chemistry under dis-/charge so that makes any single formula ambiguous

Also worth noting that there's a get_summary_dict() method on the electrode_object in both the insertion and conversion electrodes collections, but most of the summary fields in conversion electrodes are already promoted to top-levels

@tschaume
Copy link
Member

Thanks @esoteric-ephemera!

@kbuma Let's remove the query operators without according fields in the conversion_electrodes router. It seems that we can also get rid of get_summary_dict() in both.

@kbuma
Copy link
Collaborator

kbuma commented Sep 19, 2025

@tschaume I'll put together a PR for removing those and unused query operators for electrodes.

@esoteric-ephemera in develop branch they don't have a get_summary_dict() defined - it is referenced in a docstring but does not exist in electrode.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants