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

Add default print to stdout for mwetable/mwearray #30

Merged
merged 2 commits into from
Mar 13, 2024

Conversation

svilupp
Copy link
Contributor

@svilupp svilupp commented May 4, 2023

Fixes #29

Changes:

  • add default io=stdout for mwetable and mwearray
  • add test case to check that the printing works when returnstring=false (=default)

FYI. I didn't add the default IO for the "reading" functionality mwetable(), because that seemed superfluous (it then passes everything to mwetable(t) anyway).

Tests pass. PR Should be ready for review.

@pdeffebach
Copy link
Owner

@svilupp I'm sorry for missing this helpful PR.

I think this is a great addition. I will give it more attention soon.

@pdeffebach
Copy link
Owner

Thanks! I added some methods for when there is no tabular input.

Proof things work for tables

julia> t = (a = [1, 2], b = [3, 4]);

julia> mwetable(t)
df = """
a,b
1,3
2,4
""" |> IOBuffer |> CSV.File
julia> io = IOBuffer();

julia> mwetable(io, t);

julia> println(String(take!(io)))
df = """
a,b
1,3
2,4
""" |> IOBuffer |> CSV.File

julia> cliptable(t);

julia> mwetable()
df = """
a,b
1,3
2,4
""" |> IOBuffer |> CSV.File
julia> io = IOBuffer();

julia> mwetable(io);

julia> println(String(take!(io)))
df = """
a,b
1,3
2,4
""" |> IOBuffer |> CSV.File

tests look good! We should merge.

@pdeffebach pdeffebach self-requested a review March 6, 2024 23:20
@pdeffebach
Copy link
Owner

@alecloudenback Good to merge?

We will do a release after this (don't make a release yet)

@alecloudenback
Copy link
Collaborator

I am not real familiar off hand with IO and the mwe usage in the tests. I think with a couple hours I could digest that but wouldn’t want to commit to that in the next 1.5 weeks. Don’t let me hold things up if you think it’s good.

@pdeffebach pdeffebach merged commit 795d3bc into pdeffebach:master Mar 13, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing print in mwetable(t) / Nothing happens
3 participants