-
Notifications
You must be signed in to change notification settings - Fork 23
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
Change pandas ExcelWriter engine from XlsxWriter to openpyxl #329
Conversation
-Eliminates need for `XlsxWriter` package.
Yeah that's mildly annoying. What do you think about doing something like this in writer.sheets[sheet_name].column_dimensions[col_letter].width = 1.1*width
So what's the plan if we want to fully switch to |
I'm fine with more spacing. Please update with whatever you desire.
I would merge #329 first and then update (merge from |
#325 has been merged. Please simplify this PR. There are also conflicts between this PR and the current Finally, we need to find out what are the oldest versions of |
For The handoff from For Other things to consider:
I have a mild preference that we bump the |
-Some exception handling that was no longer necessary was removed. -A comment noting pandas versions that would not recognize openpyxl was corrected.
Merge conflicts with Tasks remaining:
|
I don't understand this. If it works with 2.4.1, why would we bump it up to 2.4.7? It should still work with Anaconda 4.4.0, right? |
All Anaconda versions before the current one (2020.02) have a However, Moreover, currently, A good way to proceed might therefore be to set the minimum |
The aforementioned changes have been made (4742848). All unit tests pass in
|
Running the Excel UI with the current minimum packages on Python 2.7 fails with the following message:
It looks like
This is also likely due to an incorrect use of As an aside, we currently don't have a unit test for excel file writing, which needs to get fixed. Finally, I want to point something out. The fact that the minimum So, in summary, I would like to have the following before accepting this PR:
|
Should be done in (a41a816), unless there's something more complicated that I missed.
How exactly do you wanna do that? |
I can think of two things:
|
425bb07 adds a version of Test 2. It's based on All unit tests pass in I don't understand your previous comment well enough to know if it covers the issues stated therein (e.g. all unit tests still pass in |
Yeah everything is working now. The issue in the comment you mention was fixed by increasing the minimum pandas version number. The fact that the issue wasn't caught by unit testing is what made me suggest the writing unit test. I will merge now. |
Changing
pandas
ExcelWriter
engine fromXlsxWriter
toopenpyxl
eliminates the need for theXlsxWriter
package. Since we're already consideringopenpyxl
for the read engine, this would reduce the number of external packages upon which FlowCal depends.Closes #326.
Comparison of Excel files generated by
>python -m FlowCal.excel_ui -i ./examples/experiment.xlsx
in Python 3.8, Anaconda 2020.02:The column widths appear narrower despite being calculated the same way, but overall they appear similar.
FlowCal.excel_ui.write_workbook()
also works correctly in Python 2.7, Anaconda v4.3.0.NOTE: If this pull request is adopted, #325 can be slightly simplified since
openpyxl
will already have to be imported.