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

Fix string15 supertype #134

Merged
merged 3 commits into from
Nov 1, 2022
Merged

Conversation

geoffroyleconte
Copy link
Member

@geoffroyleconte geoffroyleconte commented Oct 28, 2022

When using solve_problems and saving my results to a CSV file with CSV.jl, I generate a String15 <: InlineString <: AbstractString column for the problem names. Since supertype(String15) = InlineString which is not in default_formatters, I made the changes in this PR so that the formatter of a String15 is "%15s".

If you do not like this change, I can also set manually SolverBenchmark.default_formatters[InlineString] = "%15s" everytime and close this PR.

@codecov
Copy link

codecov bot commented Oct 28, 2022

Codecov Report

Base: 75.16% // Head: 75.47% // Increases project coverage by +0.31% 🎉

Coverage data is based on head (02e154b) compared to base (42647f7).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #134      +/-   ##
==========================================
+ Coverage   75.16%   75.47%   +0.31%     
==========================================
  Files          12       12              
  Lines         310      314       +4     
==========================================
+ Hits          233      237       +4     
  Misses         77       77              
Impacted Files Coverage Δ
src/formats.jl 79.31% <100.00%> (+2.38%) ⬆️
src/latex_formats.jl 84.48% <100.00%> (+0.27%) ⬆️

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

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@dpo dpo left a comment

Choose a reason for hiding this comment

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

I can also set manually SolverBenchmark.default_formatters[InlineString] = "%15s"

I think that would be better so we don't overload this package with types defined elsewhere. I've never heard of String15 or of InlineString.

@geoffroyleconte
Copy link
Member Author

@dpo the way I implemented it, it is not overloaded with types defined elsewhere, and no additional modules are imported. I think saving DataFrames generated by solve_problems to CSV with CSV.jl is quite common (this is the first result when you type in google "save dataframe julia"), and I had to dig into the code to find the solution to my problem.

But if you still don't like it feel free to close this PR.

Copy link
Member

@dpo dpo left a comment

Choose a reason for hiding this comment

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

Ok, I see. Let's just remove the commented out code then.

src/formats.jl Outdated Show resolved Hide resolved
Co-authored-by: Dominique <dominique.orban@gmail.com>
@dpo dpo merged commit 3ce9896 into JuliaSmoothOptimizers:main Nov 1, 2022
@dpo
Copy link
Member

dpo commented Nov 1, 2022

Thank you.

@geoffroyleconte geoffroyleconte deleted the supertype branch November 1, 2022 14:55
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.

None yet

2 participants