-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Misc. fixes for plots and notebooks (#190)
* Add a title to the plots * code paragraphs for notebook... contaminates script * New methods to only render paragraphs for notebook * script and notebook get different outputs * str -> finish * use black for formatting * add black as package dep * column names from user could start with numbers * better confidence note in script
- Loading branch information
Showing
11 changed files
with
191 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,6 @@ | |
# | ||
# Finally, we run the queries and plot the results. | ||
|
||
# + | ||
QUERIES_BLOCK | ||
# - | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# CONFIDENCE_NOTE | ||
plot_histogram(HISTOGRAM_NAME, error=ACCURACY_NAME, cutoff=0, title=TITLE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
QUERY_NAME = context.query().group_by(BIN_NAME).agg(pl.len().dp.noise()) | ||
ACCURACY_NAME = QUERY_NAME.summarize(alpha=1 - confidence)["accuracy"].item() | ||
HISTOGRAM_NAME = QUERY_NAME.release().collect().sort(BIN_NAME) | ||
plot_histogram(HISTOGRAM_NAME, ACCURACY_NAME, 0) | ||
OUTPUT_BLOCK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
print(TITLE) | ||
print(CONFIDENCE_NOTE, ACCURACY_NAME) | ||
print(HISTOGRAM_NAME) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ dependencies = [ | |
"jupyter-client", | ||
"nbconvert", | ||
"ipykernel", | ||
"black", | ||
"pyyaml", | ||
] | ||
|
||
|
Oops, something went wrong.