boilercore_docs.nbs
#
Documentation utilities.
Module Contents#
Classes#
Paths. |
Functions#
Initialize the environment which will be inherited for notebook execution. |
|
Initialize a documentation notebook. |
|
Copy dependencies to the destination directory. |
|
Set display options. |
|
Don’t raise any warnings. Optionally capture output for pesky warnings. |
|
Display a dataframe with MathJax-rendered math. |
|
Manually apply the MyST parser to convert \(-\) into MathJax’s HTML code. |
|
Style a dataframe. |
|
Display formatted DataFrames. |
|
Get formatter for the dataframe. |
|
Format individual cells. |
|
Get the formatter depending on the type of the instance. |
|
Truncate long dataframes, showing only the head and tail. |
Data#
Plot font scale. |
|
The desired precision. |
|
The desired float specification for formatted output. |
|
Hide unsuppressed output. Can’t use semicolon due to black autoformatter. |
|
The number of rows to display in a dataframe. |
API#
- boilercore_docs.nbs.FONT_SCALE#
1.3
Plot font scale.
- boilercore_docs.nbs.PRECISION#
4
The desired precision.
- boilercore_docs.nbs.FLOAT_SPEC#
None
The desired float specification for formatted output.
- boilercore_docs.nbs.HIDE#
‘display(…)’
Hide unsuppressed output. Can’t use semicolon due to black autoformatter.
- boilercore_docs.nbs.DISPLAY_ROWS#
20
The number of rows to display in a dataframe.
- boilercore_docs.nbs.init_nb_env()#
Initialize the environment which will be inherited for notebook execution.
- class boilercore_docs.nbs.Paths#
Paths.
- root: pathlib.Path#
None
- docs: pathlib.Path#
None
- deps: pathlib.Path#
None
- boilercore_docs.nbs.init(
- font_scale: float = FONT_SCALE,
Initialize a documentation notebook.
- boilercore_docs.nbs.copy_deps(
- src,
- dst,
Copy dependencies to the destination directory.
- boilercore_docs.nbs.set_display_options(
- font_scale,
Set display options.
- boilercore_docs.nbs.nowarn(
- capture: bool = False,
Don’t raise any warnings. Optionally capture output for pesky warnings.
- boilercore_docs.nbs.display_dataframe_with_math(
- df,
- raw=False,
Display a dataframe with MathJax-rendered math.
- boilercore_docs.nbs.convert_tex_to_html(
- html,
- raw=False,
Manually apply the MyST parser to convert \(-\) into MathJax’s HTML code.
- boilercore_docs.nbs.style_df(
- df: boilercore_docs.types.DfOrS,
- head: bool = False,
Style a dataframe.
- boilercore_docs.nbs.display_dfs(
- *dfs: boilercore_docs.types.DfOrS,
- head: bool = False,
Display formatted DataFrames.
When a mapping of column names to callables is given to the Pandas styler, the callable will be used internally by Pandas to produce formatted strings. This differs from elementwise formatting, in which Pandas expects the callable to actually process the value and return the formatted string.
- boilercore_docs.nbs.get_df_formatter(
- df: pandas.DataFrame,
- truncated: bool,
Get formatter for the dataframe.
- boilercore_docs.nbs.get_formatter(
- instance: Any,
Get the formatter depending on the type of the instance.
- boilercore_docs.nbs.truncate(
- df: boilercore_docs.types.DfOrS,
- head: bool = False,
Truncate long dataframes, showing only the head and tail.