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

Truncated names should be longer (as a lot of empty space is present too) #373

Closed
GegznaV opened this issue Mar 3, 2023 · 3 comments
Closed
Assignees
Labels
enhancement New feature or request

Comments

@GegznaV
Copy link

GegznaV commented Mar 3, 2023

It seems that skimpy truncates variable names to 20 symbols. This seems to be unreasonable as there is a lot of empty space which is not used (indicated with yellow squares). This empty space can be removed to have more space for longer names

image

image

  1. How can we control the maximum length of variable names?
  2. Can this empty space be removed to longer names?
  3. Can an ellipsis (single symbol "…") be used to pay attention to that variable name was truncated?
  4. There should be a way to identify ambiguous variables after the names are truncated (see the second figure, red squares).
@GegznaV
Copy link
Author

GegznaV commented Mar 3, 2023

I see that this 20-character limit is hardcoded here:

str_limit: int = 20 # For longer strings, limit chars shown.

Can it be converted into a parameter/argument? Or can different lengths be used for different data types? Or can this vary depending on the available column width in order not to leave any empty space?

@aeturrell
Copy link
Owner

This could do with something that adjusts more naturally to the number of characters in the column. As a general rule, I try to avoid lots of parameter options in favour of good average settings as this makes the code more maintainable and more concise.

Will take a look at it and see if we can change the behaviour to better suit cases where the needed column space is less.

@aeturrell aeturrell self-assigned this Mar 5, 2023
@aeturrell aeturrell added the enhancement New feature or request label Mar 5, 2023
@aeturrell
Copy link
Owner

This can be closed as fixed in 98dbf76.

I've made a few changes:

  • long column names now wrap
  • instead of the strings of column names being truncated, as they were before, now the width of the columns is truncated

This means (in reference to your points):

  1. You will have to do this yourself in your dataframe, but with the new column name wrapping, it should now be unambiguous as to which column you're dealing with when columns have similar characters for the first 20 characters
  2. the empty space is removed
  3. instead of ellipsis, we have a wrapped column
  4. see 1.

Hopefully this helps improve the package for you and other users!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants