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

Document dependencies in generated code #207

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dp_wizard/utils/code_generators/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def _make_extra_blocks(self):
def make_py(self):
code = (
Template(self.root_template)
.fill_expressions(DEPENDENCIES="'opendp[polars]' matplotlib pyyaml")
.fill_blocks(
IMPORTS_BLOCK=_make_imports(),
COLUMNS_BLOCK=self._make_columns(),
Expand Down
6 changes: 6 additions & 0 deletions dp_wizard/utils/code_generators/no-tests/_notebook.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# This is a demonstration of how OpenDP can be used to create
# a differentially private release. To learn more about what's
# going on here, see the documentation for OpenDP: https://docs.opendp.org/
#
# First install the required dependencies:

# +
# %pip install DEPENDENCIES
# -

# +
IMPORTS_BLOCK
Expand Down
3 changes: 3 additions & 0 deletions dp_wizard/utils/code_generators/no-tests/_script.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Install the following dependencies, if you haven't already:
# pip install DEPENDENCIES

from argparse import ArgumentParser

IMPORTS_BLOCK
Expand Down
Loading