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

Allow all charts to be generated as a dict #2361

Merged

Conversation

RossHammer
Copy link
Contributor

Type of PR

  • BUG
  • FEAT
  • MAINT
  • DOC

Is your Pull Request linked to an existing Issue or Pull Request?

closes #2360

Give a brief description for the solution you have provided

I have added the as_dict parameter to all calls in visualizations that generate a chart.

PR Checklist

  • Added documentation for changes
  • Added feature to example notebooks or tutorial (if appropriate)
  • Added tests (if appropriate)
  • Updated CHANGELOG.md (if appropriate)
  • Made changes based off the latest version of Splink
  • Run the linter
  • Run the spellchecker (if appropriate)

Copy link
Member

@RobinL RobinL left a comment

Choose a reason for hiding this comment

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

Thanks for this - agree it makes sense to for the visualisations to have an as_dict arg where possible. But I think the should be consistently set to False by default (see comment).

@@ -75,9 +75,12 @@ class LinkerVisualisations:
def __init__(self, linker: Linker):
self._linker = linker

def match_weights_chart(self) -> ChartReturnType:
def match_weights_chart(self, as_dict: bool = True) -> ChartReturnType:
Copy link
Member

Choose a reason for hiding this comment

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

as_dict should be False by default.

i.e. all of the functions in linker.visualiastions should return an Altair chart by default, but if the user passes as_dict=True they can get back the dict representation without going through altair

I think this is also the reasons for the test failures

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is what I intended but must have made a typo, it is updated now when you want to look again

Copy link
Member

@RobinL RobinL left a comment

Choose a reason for hiding this comment

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

Thank you!

@RobinL RobinL merged commit 0f60d12 into moj-analytical-services:master Sep 5, 2024
25 checks passed
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.

[FEAT] Allow generation of all visualizations as a dict
2 participants