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

Integrate colformat #294

Merged
merged 27 commits into from
Aug 25, 2017
Merged

Integrate colformat #294

merged 27 commits into from
Aug 25, 2017

Conversation

krlmlr
Copy link
Member

@krlmlr krlmlr commented Aug 16, 2017

Closes #144. Closes #89.

# ... with 4 more rows
x y
<dttm> <dttm>
1 2016-01-01 12:34:57 2016-01-01 12:34:57
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hadley: How important is it that POSIXlt aren't shown in a tibble?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's ok to show them, but they should be consistently aligned with POSIXct, and they need a different type_sum()

@@ -1,10 +1,7 @@
# A tibble: 3 x 9
a b c d
a b c d
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hadley: Does the alignment of the column titles look right to you?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the principle is to right align numbers and left align anything else. Currently logical is right aligned, but should probably be left aligned?

2 2.5 2 FALSE b b 2015-12-11 2015-12-09 10:51:36 <int [1]> <list [1]>
3 NA NA NA <NA> <NA> NA NA <int [1]> <list [1]>
a b c d e f g h i
<dbl> <int> <lgl> <chr> <fctr> <date> <dttm> <list> <list>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hadley: Left-align list columns?

10 4.9 3.1 1.5 0.1 setosa
# ... with 140 more rows
<dbl> <dbl> <dbl> <dbl> <fctr>
1 5.10 3.50 1.40 0.200 setosa
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hadley: Left-align factors?

1
2
3
with 5 more variables: Sepal.Length <dbl>, Sepal.Width <dbl>, Petal.Length <dbl>, Petal.Width <dbl>, Species <fctr>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to respect width

@@ -6,4 +6,3 @@
3 3
4 4
5 5
# ... with 9,995 more rows
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the number of missing rows not shown?

@@ -5,4 +5,4 @@
3 3
4 4
5 5
# ... with more rows
with at least 5 rows total
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What caused this change?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I bet this is an NA somewhere - that's the print behaviour for database tables where we don't know max

1 "\n" "\n"
2 "\"" "\""
1 \n \n
2 " "
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hadley: Do we need to "-quote strings with special characters?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably a good idea

@@ -1,5 +1,5 @@
# A tibble: 3 x 2
成交日期 合同录入日期
成交日期 合同录入日期
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Take care of wide characters in title.

@@ -1,3 +1,3 @@
# A tibble: 0 x 2
# ... with 2 variables:
# a <chr>, b <lgl>
a b
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't show body for zero-row tibbles

7 2016-01-01 12:35:03 <POSIXlt>
8 2016-01-01 12:35:04 <POSIXlt>
x y
<dttm> <ldttm>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hadley: Does "lddtm" work for POSIXlt?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I almost wonder if just "POSIXlt" would be best

1 5.1
2 4.9
3 4.7

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hadley: Do we need to care about very small output widths (here: 5 characters)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. I think we're safe to assume a width of >20

3 NA NA NA <NA>
1 1.00 1 * a
2 2.50 2 - b
3 NA NA ? ?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this NA be right aligned?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's right aligned on decimal. This is colformat issue.

@krlmlr
Copy link
Member Author

krlmlr commented Aug 18, 2017

@jimhester: Any idea why colformat is not installed on Travis even if it is in the Remotes section? https://travis-ci.org/tidyverse/tibble/jobs/266023788#L2763

@codecov
Copy link

codecov bot commented Aug 19, 2017

Codecov Report

Merging #294 into master will decrease coverage by 2.16%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #294      +/-   ##
==========================================
- Coverage   90.41%   88.24%   -2.17%     
==========================================
  Files          19       19              
  Lines         960      885      -75     
==========================================
- Hits          868      781      -87     
- Misses         92      104      +12
Impacted Files Coverage Δ
R/tbl-df.r 100% <ø> (ø) ⬆️
R/type-sum.r 77.77% <ø> (-22.23%) ⬇️
R/utils-format.r 94.21% <100%> (-5.31%) ⬇️
R/compat-purrr.R 14.08% <0%> (-1.41%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3014d05...94bdb8b. Read the comment docs.

@krlmlr
Copy link
Member Author

krlmlr commented Aug 19, 2017

@jimhester: I suspect the reason was an invalid GITHUB_PAT env var, but I haven't found a log entry that hints at this problem -- only after changing to tic: https://travis-ci.org/tidyverse/tibble/builds/266228593#L900.

@krlmlr krlmlr changed the title WIP: Integrate colformat Integrate colformat Aug 19, 2017
@krlmlr krlmlr requested a review from hadley August 19, 2017 11:43
@krlmlr
Copy link
Member Author

krlmlr commented Aug 19, 2017

@hadley: Could you please take a final look at the output before I move the corresponding tests to colformat (#297)?

@krlmlr krlmlr merged commit 49c4d6c into master Aug 25, 2017
@krlmlr krlmlr deleted the f-colformat branch August 25, 2017 21:00
krlmlr added a commit that referenced this pull request Aug 25, 2017
- Integrate colformat (#294).
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New vector classes designed for better printing? Greedy printing?
2 participants