-
Notifications
You must be signed in to change notification settings - Fork 12
Feature: Render answer sets as excel workbooks (xlsx files) #219
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
Conversation
…'s public API, moved Alpha there
…or AnswerSetToWorkbookMapper
… txt extension since apache poi bundles them without ext
Codecov Report
@@ Coverage Diff @@
## master #219 +/- ##
============================================
- Coverage 79% 78.99% -0.01%
- Complexity 2071 2091 +20
============================================
Files 145 147 +2
Lines 6582 6689 +107
Branches 1152 1162 +10
============================================
+ Hits 5200 5284 +84
- Misses 979 1001 +22
- Partials 403 404 +1
Continue to review full report at Codecov.
|
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.
The functionality provided by this PR will be of high value to many users. There are some minor comments left but overall looks very good.
src/main/java/at/ac/tuwien/kr/alpha/api/mapper/impl/AnswerSetToWorkbookMapper.java
Outdated
Show resolved
Hide resolved
src/main/java/at/ac/tuwien/kr/alpha/config/CommandLineParser.java
Outdated
Show resolved
Hide resolved
src/main/java/at/ac/tuwien/kr/alpha/config/CommandLineParser.java
Outdated
Show resolved
Hide resolved
src/main/java/at/ac/tuwien/kr/alpha/api/mapper/impl/AnswerSetToWorkbookMapper.java
Outdated
Show resolved
Hide resolved
src/test/java/at/ac/tuwien/kr/alpha/api/mapper/impl/AnswerSetToWorkbookMapperTest.java
Show resolved
Hide resolved
@AntoniusW I made the changes we discussed on Wednesday - Sheets now have a header line, with columns labelled "Attribute x", with 1 <= x <= N and N being the arity of the predicate in question. Furthermore, when the input is unsatisfiable and xlsx output is set, a workbook with one sheet and the content "Input is unsatisfiable - No answer sets!" is written. Also added a few more tests. PR is ready for merging from my end. |
src/main/java/at/ac/tuwien/kr/alpha/api/mapper/impl/AnswerSetToWorkbookMapper.java
Outdated
Show resolved
Hide resolved
The coverage can be further improved by testing the UNSAT case. |
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.
The coverage can be further improved by testing the UNSAT case.
Added a testcase for that. The real problem with coverage is that the changes in Main
are hard to test without writing lots of code..
In order to aid data exploration and visualization, this PR introduces a new feature, allowing answer sets to be written as xlsx files rather than just printed to stdout.
API Changes and Additions
at.ac.tuwien.kr.alpha.api
as top-level package for public API types (such asAlpha.java
)AnswerSetToObjectMapper<T>
defining a mapping function fromAnswerSet
to a type parameterT
AnswerSet
toWorkbook
, i.e. xlsx workbooks. Implementation is realized using Apache POI using the approach outlined hereCommandline-Interface
-wx <path>
: When set, answer sets will be written to xlsx files at the given path, e.g. the calljava -jar alpha.jar -i prog.asp -wx /some/dir/progAnswerSet
will result in the first answer set being written to/some/dir/progAnswerSet.1.xlsx
, the second answer set to/some/dir/progAnswerSet.2.xlsx
etc.XLSX Workbook structure