Repository navigation
Conversation
Allow users to select a subset of text files before running the coder comparison statistics, so Cohen's Kappa can be calculated on a subcorpus instead of the entire corpus. All text files are used by default. - reports.py: new select_files dialog, selected_file_ids filter in calculate_agreement_for_code, file names shown in dialog and report - GUI/ui_report_comparisons.py: Select files button and files label - tests/test_report_coder_comparisons.py: unit tests for subcorpus filtering of the Kappa and agreement statistics Co-authored-by: qwertygc <qwertygc@users.noreply.github.com>
When a code is not applied by either coder within the selected files, the Kappa and percentage statistics cannot be computed. Previously the internal sentinel strings 'zerodiv'/'zero div' were displayed in the tree, which is frequent now that a subcorpus can be selected. Display 'n/a' instead and add a unit test for this case. Co-authored-by: qwertygc <qwertygc@users.noreply.github.com>
… pyuic6 The dialog previously had no .ui source file in src/GUI_UIs, so the generated .py file had been edited directly. Add the Qt Designer template matching the current dialog (including the Select files button and files label) and regenerate the .py file with pyuic6 so future .ui edits will not overwrite hand-made changes. Co-authored-by: qwertygc <qwertygc@users.noreply.github.com>
Replace the 'Select files' text button with a 32x32 icon button (mdi file-multiple, consistent with the other icon buttons in the dialog) and show the selection state in a label next to it: 'Files: All' when no subcorpus filter is active, otherwise 'Files: N' with the number of selected files. The text report header lists the selected file names for traceability. Co-authored-by: qwertygc <qwertygc@users.noreply.github.com>
…utton Co-authored-by: qwertygc <qwertygc@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tests/test_report_coder_comparisons.py) covering full corpus vs subcorpus calculation, Kappa change under filtering, perfect-agreement Kappa, and unknown file idsDetails
Coders may not have coded every interview, so calculating Kappa over the whole corpus can be misleading. This PR lets the user pick the relevant files (multi-select with checkboxes, using the existing
DialogSelectItemscomponent) before pressing Run. The filtering is applied incalculate_agreement_for_code(src/qualcoder/reports.py), leaving the statistics logic itself unchanged.Verification
python -m py_compileon the two modified modules and the new test filecharacters=20, kappa=0.2987; subcorpus of file 1 givescharacters=10, kappa=1.0, agree_coded_only=100.0; filtering ignores unknown file idsQT_QPA_PLATFORM=offscreen) with a minimal sqlite schema, same pattern astests/test_qualcoder.py