Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor map tuples to dicts #20

Merged
merged 2 commits into from Mar 10, 2022
Merged

Conversation

JossWhittle
Copy link
Contributor

@JossWhittle JossWhittle commented Mar 9, 2022

Closes #14. Functions which currently return an ordered tuple of maps (lrmap, udmap, cmap, ...) now return keyed dictionaries { 'lrmap': lrmap, 'udmap': udmap, 'cmap': cmap, ... } so that order/usage is explicitly enforced.

List comprehensions over the tuples now use jax.tree_map and jax.tree_multimap to ensure key safety.

@GMW99, this will break the current implementation of the Metrics Callback class which iterates over a zip of the hardcoded map names and the maps tuple. This iteration can be replaced by iterating over maps.items() since it is now a dict already.

@JossWhittle JossWhittle self-assigned this Mar 9, 2022
@JossWhittle JossWhittle requested a review from GMW99 March 9, 2022 15:42
@JossWhittle JossWhittle added the enhancement New feature or request label Mar 9, 2022
@GMW99
Copy link
Member

GMW99 commented Mar 10, 2022

This makes sense as a sensible change. I'll make the required maps.items() change on #15 :-)

@GMW99 GMW99 merged commit 5184e49 into development Mar 10, 2022
@JossWhittle JossWhittle deleted the pr-refactor-map-tuples-to-dicts branch March 10, 2022 18:37
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.

None yet

2 participants