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
Read xlsx #94
Read xlsx #94
Conversation
@jcrivenaes should we change the requirements as suggested here, or are there reasons to keep the previous requirements ? |
We should not enforce versions that are not yet in komodo stable. Pandas 1.1 is on its way in now, but xlrd might take another month or so. |
) | ||
|
||
print(dgn.loc[0]["SENSCASE"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a debugging statement?
"Design matrix filename should be on Excel or csv format" | ||
" and end with .xlsx or .csv" | ||
"Design matrix should be on Excel or csv format" | ||
" and filename should end with .xlsx or .csv" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"should -> must" is perhaps more to the point (.XLSX would even fail here, but we can live with that.)
@@ -53,15 +53,17 @@ def summarize_design(filename, sheetname="DesignSheet01"): | |||
|
|||
# Read design matrix and find realisation numbers for each sensitivity | |||
if filename.endswith(".xlsx"): | |||
dgn = pd.read_excel(filename, sheetname) | |||
dgn = pd.read_excel(filename, sheetname, engine="openpyxl") | |||
dgn.dropna(axis=0, how="all", inplace=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this due to things like "coloured cells"? If so, maybe nice to add a comment about that (to explain why the line of code is there, otherwise it could disappear in later refactorings)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have added this
Test pass on combinations of xlrd 1.2.0/2.0.1, and pandas versions 0.25 up to 1.2.0. Except Pandas 1.1.1, but this particular version is not in use. |
Changes pd.read_excel to use engine openpyxl since newer versions of xlrd does not support '.xlsx' files. Closes issue #88 . Requirements are updated to use pandas>1.1 and xlrd>2.0, but shold also work with previous requirements if we don't want to change these yet.