Skip to content

Commit

Permalink
Spelling (#44)
Browse files Browse the repository at this point in the history
* spelling: abstract

Signed-off-by: Josh Soref <[email protected]>

* spelling: and

Signed-off-by: Josh Soref <[email protected]>

* spelling: beginning

Signed-off-by: Josh Soref <[email protected]>

* spelling: collapsed

Signed-off-by: Josh Soref <[email protected]>

* spelling: comfortably

Signed-off-by: Josh Soref <[email protected]>

* spelling: completely

Signed-off-by: Josh Soref <[email protected]>

* spelling: continuous

Signed-off-by: Josh Soref <[email protected]>

* spelling: currently

Signed-off-by: Josh Soref <[email protected]>

* spelling: easily

Signed-off-by: Josh Soref <[email protected]>

* spelling: fibonacci

Signed-off-by: Josh Soref <[email protected]>

* spelling: implementing

Signed-off-by: Josh Soref <[email protected]>

* spelling: javascript

Signed-off-by: Josh Soref <[email protected]>

* spelling: maintained

Signed-off-by: Josh Soref <[email protected]>

* spelling: ndarray

Signed-off-by: Josh Soref <[email protected]>

* spelling: necessary

Signed-off-by: Josh Soref <[email protected]>

* spelling: number

Signed-off-by: Josh Soref <[email protected]>

* spelling: occurred

Signed-off-by: Josh Soref <[email protected]>

* spelling: privileges

Signed-off-by: Josh Soref <[email protected]>

* spelling: rendering in

Signed-off-by: Josh Soref <[email protected]>

* spelling: subtrees

Signed-off-by: Josh Soref <[email protected]>

* spelling: template

Signed-off-by: Josh Soref <[email protected]>

* spelling: visibility

Signed-off-by: Josh Soref <[email protected]>

* spelling: visible

Signed-off-by: Josh Soref <[email protected]>

* spelling: visualization

Signed-off-by: Josh Soref <[email protected]>

---------

Signed-off-by: Josh Soref <[email protected]>
  • Loading branch information
jsoref authored Nov 20, 2024
1 parent e2c3a99 commit ccbc211
Show file tree
Hide file tree
Showing 20 changed files with 70 additions and 70 deletions.
2 changes: 1 addition & 1 deletion docs/ext/nb_output_cell_to_iframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"""Wraps MyST-nb output cells in HTML templates.
This can be used to sandbox the environment of output cell renderings, which is
useful for Treescope renderings since they make heavy use of Javascript and CSS,
useful for Treescope renderings since they make heavy use of JavaScript and CSS,
and can also improve responsiveness of the main page.
This transformation replaces output cells with ``<template>`` elements tagged
Expand Down
10 changes: 5 additions & 5 deletions tests/renderer_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ def test_failsafe_for_throw_in_repr(self):
lowering.render_to_text_as_root(rendering),
textwrap.dedent(f"""\
[
{object.__repr__(target[0])}, # Error occured while formatting this object.
{object.__repr__(target[0])}, # Error occurred while formatting this object.
]"""),
)

Expand Down Expand Up @@ -898,7 +898,7 @@ def autovisualizer_for_test(node, path):
if isinstance(node, str):
return treescope.VisualizationFromTreescopePart(
rendering_parts.RenderableAndLineAnnotations(
rendering_parts.text("(visualiation for foo goes here)"),
rendering_parts.text("(visualization for foo goes here)"),
rendering_parts.text(" # annotation for vis for foo"),
),
)
Expand All @@ -920,7 +920,7 @@ def inner_autovisualizer(node, path):
if node == 6:
return treescope.VisualizationFromTreescopePart(
rendering_parts.RenderableAndLineAnnotations(
rendering_parts.text("(child visualiation of 6 goes here)"),
rendering_parts.text("(child visualization of 6 goes here)"),
rendering_parts.text(" # annotation for vis for 6"),
),
)
Expand All @@ -942,7 +942,7 @@ def inner_autovisualizer(node, path):
[
1,
2,
(visualiation for foo goes here), # annotation for vis for foo
(visualization for foo goes here), # annotation for vis for foo
3,
<Visualization of int:
<rich HTML visualization>
Expand All @@ -953,7 +953,7 @@ def inner_autovisualizer(node, path):
#╰┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄╯
,
[
(child visualiation of 6 goes here), # annotation for vis for 6
(child visualization of 6 goes here), # annotation for vis for 6
7,
],
]"""),
Expand Down
44 changes: 22 additions & 22 deletions tests/representation_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class RepresentationPartsTest(parameterized.TestCase):
expected_text_roundtrip_collapsed='',
expected_text_roundtrip_expanded='',
expected_html='',
expected_html_at_begining='',
expected_html_at_beginning='',
),
dict(
testcase_name='single_line_text',
Expand All @@ -156,7 +156,7 @@ class RepresentationPartsTest(parameterized.TestCase):
expected_text_roundtrip_collapsed='some text with characters < > &',
expected_text_roundtrip_expanded='some text with characters < > &',
expected_html='some text with characters &lt; &gt; &amp;',
expected_html_at_begining='some text with characters &lt; &gt; &amp;',
expected_html_at_beginning='some text with characters &lt; &gt; &amp;',
),
dict(
testcase_name='siblings',
Expand Down Expand Up @@ -191,7 +191,7 @@ class RepresentationPartsTest(parameterized.TestCase):
'[mock A, e:y r:y][mock B, e:y r:y][mock C, e:y r:y]'
),
expected_html='[mock A, b:n][mock B, b:n][mock C, b:n]',
expected_html_at_begining='[mock A, b:y][mock B, b:n][mock C, b:n]',
expected_html_at_beginning='[mock A, b:y][mock B, b:n][mock C, b:n]',
),
dict(
testcase_name='tagged_group',
Expand All @@ -208,7 +208,7 @@ class RepresentationPartsTest(parameterized.TestCase):
expected_text_roundtrip_collapsed='[mock A, e:n r:y]',
expected_text_roundtrip_expanded='[mock A, e:y r:y]',
expected_html='[mock A, b:n]',
expected_html_at_begining='[mock A, b:y]',
expected_html_at_beginning='[mock A, b:y]',
),
dict(
testcase_name='span_group_1',
Expand All @@ -228,7 +228,7 @@ class RepresentationPartsTest(parameterized.TestCase):
expected_html=(
'<span class="test_span_css_class">[mock A, b:n]</span>'
),
expected_html_at_begining=(
expected_html_at_beginning=(
'<span class="test_span_css_class">[mock A, b:y]</span>'
),
),
Expand All @@ -251,7 +251,7 @@ class RepresentationPartsTest(parameterized.TestCase):
expected_html=(
'<span class="test_span_css_class">[mock A, b:n]</span>'
),
expected_html_at_begining=(
expected_html_at_beginning=(
'<span class="test_span_css_class">[mock A, b:y]</span>'
),
),
Expand All @@ -270,7 +270,7 @@ class RepresentationPartsTest(parameterized.TestCase):
expected_text_roundtrip_collapsed='[mock A, e:n r:y]',
expected_text_roundtrip_expanded='',
expected_html='<span class="when_collapsed">[mock A, b:n]</span>',
expected_html_at_begining=(
expected_html_at_beginning=(
'<span class="when_collapsed">[mock A, b:y]</span>'
),
),
Expand All @@ -289,7 +289,7 @@ class RepresentationPartsTest(parameterized.TestCase):
expected_text_roundtrip_collapsed='',
expected_text_roundtrip_expanded='[mock B, e:y r:y]',
expected_html='<span class="when_expanded">[mock B, b:n]</span>',
expected_html_at_begining=(
expected_html_at_beginning=(
'<span class="when_expanded">[mock B, b:y]</span>'
),
),
Expand All @@ -316,7 +316,7 @@ class RepresentationPartsTest(parameterized.TestCase):
'<span class="when_collapsed">[mock B, b:n]</span><span'
' class="when_expanded">[mock A, b:n]</span>'
),
expected_html_at_begining=(
expected_html_at_beginning=(
'<span class="when_collapsed">[mock B, b:y]</span><span'
' class="when_expanded">[mock A, b:y]</span>'
),
Expand All @@ -336,7 +336,7 @@ class RepresentationPartsTest(parameterized.TestCase):
expected_text_roundtrip_collapsed='[mock A, e:n r:y]',
expected_text_roundtrip_expanded='[mock A, e:y r:y]',
expected_html='<span class="when_roundtrip">[mock A, b:n]</span>',
expected_html_at_begining=(
expected_html_at_beginning=(
'<span class="when_roundtrip">[mock A, b:y]</span>'
),
),
Expand All @@ -355,7 +355,7 @@ class RepresentationPartsTest(parameterized.TestCase):
expected_text_roundtrip_collapsed='',
expected_text_roundtrip_expanded='',
expected_html='<span class="when_not_roundtrip">[mock B, b:n]</span>',
expected_html_at_begining=(
expected_html_at_beginning=(
'<span class="when_not_roundtrip">[mock B, b:y]</span>'
),
),
Expand All @@ -382,7 +382,7 @@ class RepresentationPartsTest(parameterized.TestCase):
'<span class="when_roundtrip">[mock A, b:n]</span><span'
' class="when_not_roundtrip">[mock B, b:n]</span>'
),
expected_html_at_begining=(
expected_html_at_beginning=(
'<span class="when_roundtrip">[mock A, b:y]</span><span'
' class="when_not_roundtrip">[mock B, b:y]</span>'
),
Expand All @@ -405,7 +405,7 @@ class RepresentationPartsTest(parameterized.TestCase):
'<span class="when_collapsed_and_not_roundtrip">[mock A,'
' b:n]</span>'
),
expected_html_at_begining=(
expected_html_at_beginning=(
'<span class="when_collapsed_and_not_roundtrip">[mock A,'
' b:y]</span>'
),
Expand All @@ -427,7 +427,7 @@ class RepresentationPartsTest(parameterized.TestCase):
expected_html=(
'<span class="when_expanded_or_roundtrip">[mock B, b:n]</span>'
),
expected_html_at_begining=(
expected_html_at_beginning=(
'<span class="when_expanded_or_roundtrip">[mock B, b:y]</span>'
),
),
Expand Down Expand Up @@ -455,7 +455,7 @@ class RepresentationPartsTest(parameterized.TestCase):
' b:n]</span><span class="when_expanded_or_roundtrip">[mock B,'
' b:n]</span>'
),
expected_html_at_begining=(
expected_html_at_beginning=(
'<span class="when_collapsed_and_not_roundtrip">[mock A,'
' b:y]</span><span class="when_expanded_or_roundtrip">[mock B,'
' b:y]</span>'
Expand Down Expand Up @@ -507,7 +507,7 @@ class RepresentationPartsTest(parameterized.TestCase):
' class="separate_lines_child">[mock B, b:y]</span><span'
' class="separate_lines_child">[mock C, b:y]</span></span>'
),
expected_html_at_begining=(
expected_html_at_beginning=(
'<span class="separate_lines_children"><span'
' class="separate_lines_child">[mock A, b:y]</span><span'
' class="separate_lines_child">[mock B, b:y]</span><span'
Expand Down Expand Up @@ -560,7 +560,7 @@ class RepresentationPartsTest(parameterized.TestCase):
' class="indented_child">[mock B, b:y]</span><span'
' class="indented_child">[mock C, b:y]</span></span>'
),
expected_html_at_begining=(
expected_html_at_beginning=(
'<span class="indented_children"><span'
' class="indented_child">[mock A, b:y]</span><span'
' class="indented_child">[mock B, b:y]</span><span'
Expand Down Expand Up @@ -602,7 +602,7 @@ class RepresentationPartsTest(parameterized.TestCase):
' class="box_with_outline" style="--foo: &quot;1&quot;;">[mock A,'
' b:y]</span></span>'
),
expected_html_at_begining=(
expected_html_at_beginning=(
'<span class="outerbox_for_outline"><span'
' class="box_with_outline" style="--foo: &quot;1&quot;;">[mock A,'
' b:y]</span></span>'
Expand Down Expand Up @@ -630,7 +630,7 @@ class RepresentationPartsTest(parameterized.TestCase):
'<span class="has_hover_tooltip"'
' data-tooltip="test_tooltip">[mock A, b:n]</span>'
),
expected_html_at_begining=(
expected_html_at_beginning=(
'<span class="has_hover_tooltip"'
' data-tooltip="test_tooltip">[mock A, b:y]</span>'
),
Expand All @@ -657,7 +657,7 @@ class RepresentationPartsTest(parameterized.TestCase):
'<span tabindex="-1" class="scoped_unselectable">[mock A,'
' b:n]</span>'
),
expected_html_at_begining=(
expected_html_at_beginning=(
'<span tabindex="-1" class="scoped_unselectable">[mock A,'
' b:y]</span>'
),
Expand All @@ -677,7 +677,7 @@ def test_parts(
expected_text_roundtrip_collapsed: str,
expected_text_roundtrip_expanded: str,
expected_html: str,
expected_html_at_begining: str,
expected_html_at_beginning: str,
indent: int = 0,
):
with self.subTest('collapsed_width'):
Expand Down Expand Up @@ -756,7 +756,7 @@ def test_parts(
with self.subTest('html_at_beginning'):
stream = io.StringIO()
part.render_to_html(stream, at_beginning_of_line=True, render_context={})
self.assertEqual(stream.getvalue(), expected_html_at_begining)
self.assertEqual(stream.getvalue(), expected_html_at_beginning)

def test_multiline_text_part(self):
part = basic_parts.Text('some text\nsecond line\nthird line')
Expand Down
4 changes: 2 additions & 2 deletions treescope/_internal/api/array_autovisualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class ArrayAutovisualizer:
in the global type registry.
Attributes:
maximum_size: Maximum numer of elements of an array to show. Arrays larger
maximum_size: Maximum number of elements of an array to show. Arrays larger
than this will be truncated along one or more axes.
cutoff_size_per_axis: Maximum number of elements of each individual axis to
show without truncation. Any axis longer than this will be truncated, with
Expand All @@ -63,7 +63,7 @@ class ArrayAutovisualizer:
edge_items: How many values to keep along each axis for truncated arrays.
prefers_column: Names that should always be assigned to columns.
prefers_row: Names that should always be assigned to rows.
around_zero: Whether to center continous data around zero.
around_zero: Whether to center continuous data around zero.
force_continuous: Whether to always render integer arrays as continuous.
include_repr_line_threshold: A threshold such that, if the `repr` of the
array has fewer than that many lines, we will include that repr in the
Expand Down
8 changes: 4 additions & 4 deletions treescope/_internal/api/arrayviz.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

"""Single-purpose ndarray visualizer for Python in vanilla Javascript.
"""Single-purpose ndarray visualizer for Python in vanilla JavaScript.
Designed to quickly visualize the contents of arbitrarily-high-dimensional
NDArrays, to allow them to be visualized by default instead of requiring lots
Expand Down Expand Up @@ -223,7 +223,7 @@ def render_array(
something like ``palettable.matplotlib.Inferno_20.colors``.
truncate: Whether or not to truncate the array to a smaller size before
rendering.
maximum_size: Maximum numer of elements of an array to show. Arrays larger
maximum_size: Maximum number of elements of an array to show. Arrays larger
than this will be truncated along one or more axes. Ignored unless
``truncate`` is True.
cutoff_size_per_axis: Maximum number of elements of each individual axis
Expand Down Expand Up @@ -689,7 +689,7 @@ def _render_pretruncated(
cmap_data=colormap_data,
info="".join(info_parts),
formatting_instructions=formatting_instructions,
dynamic_continous_cmap=dynamic_colormap,
dynamic_continuous_cmap=dynamic_colormap,
raw_min_abs=raw_min_abs,
raw_max_abs=raw_max_abs,
pixels_per_cell=pixels_per_cell,
Expand Down Expand Up @@ -968,7 +968,7 @@ def render_sharding_info(
cmap_data=[],
info=render_info_message,
formatting_instructions=formatting_instructions,
dynamic_continous_cmap=False,
dynamic_continuous_cmap=False,
raw_min_abs=0.0,
raw_max_abs=0.0,
)
Expand Down
2 changes: 1 addition & 1 deletion treescope/_internal/api/autovisualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class IPythonVisualization:
Attributes:
display_object: An object to render, e.g. a figure.
replace: Whether to replace the subtree commpletely with this display
replace: Whether to replace the subtree completely with this display
object. If False, the display object will be rendered below the object.
"""

Expand Down
10 changes: 5 additions & 5 deletions treescope/_internal/arrayviz_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def render_array_data_to_html(
cmap_data: list[tuple[int, int, int]],
info: str = "",
formatting_instructions: list[dict[str, Any]] | None = None,
dynamic_continous_cmap: bool = False,
dynamic_continuous_cmap: bool = False,
raw_min_abs: float | None = None,
raw_max_abs: float | None = None,
pixels_per_cell: int | float = 7,
Expand All @@ -165,7 +165,7 @@ def render_array_data_to_html(
or click. These will be interpreted by `formatValueAndIndices` on the
JavaScript side. Can assume each axis is named "a0", "a1", etc. when
running in JavaScript.
dynamic_continous_cmap: Whether to dynamically adjust the colormap during
dynamic_continuous_cmap: Whether to dynamically adjust the colormap during
rendering.
raw_min_abs: Minimum absolute value of the array, for dynamic remapping.
raw_max_abs: Maximum absolute value of the array, for dynamic remapping.
Expand Down Expand Up @@ -232,7 +232,7 @@ def axis_spec_arg(i):
"type": cmap_type,
"min": vmin,
"max": vmax,
"dynamic": dynamic_continous_cmap,
"dynamic": dynamic_continuous_cmap,
"rawMinAbs": raw_min_abs,
"rawMaxAbs": raw_max_abs,
"cmapData": cmap_data,
Expand Down Expand Up @@ -275,7 +275,7 @@ def infer_rows_and_columns(
The unassigned axes are sorted by size and then assigned to rows and columns
to try to balance the total number of elements along the row and column axes.
This curently uses a greedy algorithm with an adjustment to try to keep
This currently uses a greedy algorithm with an adjustment to try to keep
columns longer than rows, except when there are exactly two axes and both are
positional, in which case it lays out axis 0 as the rows and axis 1 as the
columns.
Expand Down Expand Up @@ -466,7 +466,7 @@ def infer_balanced_truncation(
Returns:
A tuple of edge sizes. Each element corresponds to an axis in `shape`,
and is either `None` (for no truncation) or an integer (corresponding to
the number of elements to keep at the beginning and and at the end).
the number of elements to keep at the beginning and at the end).
"""
shape_arr = np.array(list(shape))
remaining_elements_to_divide = maximum_size
Expand Down
4 changes: 2 additions & 2 deletions treescope/_internal/handlers/custom_type_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def handle_via_treescope_repr_method(
Args:
node: The node to render.
path: An optional path to this node from the root.
subtree_renderer: The renderer for sutrees of this node.
subtree_renderer: The renderer for subtrees of this node.
method_name: Optional override for the name of the method to call. This is
primarily intended for compatibility with treescope's original
implementation as part of Penzai, which used __penzai_repr__.
Expand Down Expand Up @@ -90,7 +90,7 @@ def handle_via_global_registry(
Args:
node: The node to render.
path: An optional path to this node from the root.
subtree_renderer: The renderer for sutrees of this node.
subtree_renderer: The renderer for subtrees of this node.
Returns:
A rendering of this node, if it was found in the global registry.
Expand Down
4 changes: 2 additions & 2 deletions treescope/_internal/handlers/shared_value_postprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class DynamicSharedCheck(rendering_parts.RenderableTreePart):
if_shared: Child to render only if the node is shared.
node_id: Node ID of the node we are rendering. Used for the warning and also
looked up in `seen_more_than_once`.
seen_more_than_once: Reference to an externally-maintaned set of node IDs
seen_more_than_once: Reference to an externally-maintained set of node IDs
we've seen more than once. Usually, this will be the same set from the
active `_shared_object_ids_seen` context.
"""
Expand Down Expand Up @@ -196,7 +196,7 @@ class WithDynamicSharedPip(basic_parts.DeferringToChild):
child: Child to render.
node_id: Node ID of the node we are rendering. Used for the warning and also
looked up in `seen_more_than_once`.
seen_more_than_once: Reference to an externally-maintaned set of node IDs
seen_more_than_once: Reference to an externally-maintained set of node IDs
we've seen more than once. Usually, this will be the same set from the
active `_shared_object_ids_seen` context.
"""
Expand Down
Loading

0 comments on commit ccbc211

Please sign in to comment.