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

Python prelude module #730

Merged
merged 2 commits into from
May 15, 2023
Merged

Python prelude module #730

merged 2 commits into from
May 15, 2023

Conversation

Shoeboxam
Copy link
Member

Closes #711

This PR addresses comments left in the issue.

The conventional library import would be:

import opendp.prelude as dp

I'm not placing these imports in the __init__.py because adding a new module...

  • gives more flexibility to preserve module structure but shorten names
    • I think we should keep module distinctions for transformations, measurements and combinators
    • The prelude makes these available under t, m, c respectively: dp.t.make_clamp(...)
  • doesn't pollute the opendp namespace
    • smartnoise and the higher-level api both want entries in the opendp namespace

The name of the new module is prelude because...

  • "prelude" is already a common name for when you want to shorten imports
  • It implies that imports under this path are aliases, not a separate copy of the code
    • For example, naming it core or base might give the wrong impression

Copy link
Member Author

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

Copy link
Member

@andrewvyrros andrewvyrros left a comment

Choose a reason for hiding this comment

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

I'm liking the dp prefix with the prelude!

@Shoeboxam Shoeboxam merged commit b8db775 into main May 15, 2023
@Shoeboxam Shoeboxam deleted the 711-python-prelude branch May 15, 2023 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

Add a prelude for OpenDP Python
2 participants