Skip to content

[ENH] sklearn style pretty printing#156

Merged
fkiraly merged 25 commits intomainfrom
prettyprint-noconfig
Apr 18, 2023
Merged

[ENH] sklearn style pretty printing#156
fkiraly merged 25 commits intomainfrom
prettyprint-noconfig

Conversation

@fkiraly
Copy link
Contributor

@fkiraly fkiraly commented Apr 18, 2023

Fixes #17.

This implements sklearn pretty printing directly in skbase with some minor tweaks.

Based on #150 by @RNKuhns, but removes the strong coupling to the new global config interface, as well as the global config interface that imo has nothing to do (or should have nothing to do) with that PR.

I think the global config interface still needs some work, and according to my comments in #150, it should be entirely uncoupled, or more precisely, coupled only via get_config.

(the alternative would be coupling it to every place where a config - local or global - is used, which is bad design)

@fkiraly fkiraly added the implementing framework Implementing core skbase framework label Apr 18, 2023
with suppress(AttributeError):
return base_object._sk_visual_block_()

if isinstance(base_object, str):

Check warning

Code scanning / CodeQL

Unreachable code

This statement is unreachable.
super().__init__(indent, width, depth, stream, compact=compact)
self._indent_at_name = indent_at_name
if self._indent_at_name:
self._indent_per_level = 1 # ignore indent param

Check warning

Code scanning / CodeQL

Overwriting attribute in super-class or sub-class

Assignment overwrites attribute _indent_per_level, which was previously defined in superclass [PrettyPrinter](1).
@codecov-commenter
Copy link

codecov-commenter commented Apr 18, 2023

Codecov Report

Merging #156 (0b8f62f) into main (18435de) will increase coverage by 0.24%.
The diff coverage is 71.35%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##             main     #156      +/-   ##
==========================================
+ Coverage   82.68%   82.92%   +0.24%     
==========================================
  Files          32       39       +7     
  Lines        2327     2799     +472     
==========================================
+ Hits         1924     2321     +397     
- Misses        403      478      +75     
Impacted Files Coverage Δ
skbase/validate/__init__.py 100.00% <ø> (ø)
skbase/base/_meta.py 18.30% <22.13%> (+3.03%) ⬆️
skbase/base/_base.py 80.06% <63.88%> (-2.16%) ⬇️
skbase/base/_pretty_printing/_object_html_repr.py 67.90% <67.90%> (ø)
skbase/base/_pretty_printing/_pprint.py 86.00% <86.00%> (ø)
skbase/base/__init__.py 100.00% <100.00%> (ø)
skbase/base/_pretty_printing/__init__.py 100.00% <100.00%> (ø)
skbase/utils/__init__.py 100.00% <100.00%> (ø)
skbase/utils/_check.py 100.00% <100.00%> (ø)
skbase/utils/_iter.py 100.00% <100.00%> (ø)
... and 7 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

implementing framework Implementing core skbase framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ENH] Separate Pretty Printing from sklearn dependency

3 participants