Repository navigation
Keep a data-sharing results section from posing as the data statement - #207
Merged
Merged
Conversation
A meta-science paper's results section on how other studies share data was
copied as the paper's own data_availability in the default shadow mode, and
the paper's real statement ("The codebook, data, and analysis code are
available in this OSF repository: ...") was not recognised in any mode.
A long open-data section under a heading other than an availability heading
that never declares where the data are now yields to a declaration elsewhere
in the paper, and a declaration whose subject lists several items is
recognised.
Fixes #204
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #207 +/- ##
=======================================
Coverage 90.55% 90.55%
=======================================
Files 309 309
Lines 57282 57289 +7
Branches 10374 10376 +2
=======================================
+ Hits 51873 51880 +7
Misses 3450 3450
Partials 1959 1959 🚀 New features to boost your workflow:
|
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.
Requested by Jakub · project thread
Before: on a meta-science paper (#204, a study of data and code sharing in computational communication science),
data_availabilityheld the paper's results section on how other studies share data ("As shown in Figure 6, the large majority of publications did not share any data …"). The paper's own statement, "The codebook, data, and analysis code are available in this OSF repository: https://osf.io/teubg/overview.", was not recognised in any mode, so active mode returned nothing at all.After: both the default shadow mode and active mode return the paper's own OSF sentence.
Two causes. In the default (shadow) mode, any section typed as open data was copied whole. Headings like "Data sharing", "Open science practices" or "Reproducibility" are open-data aliases, and in a meta-science paper they head results. Separately, the declaration grammar only accepted subjects like "the data" or "data and code", so a listed subject ("The codebook, data, and analysis code are …") never counted as a declaration.
How:
integrity_statements._legacy_section_is_topical: an open-data section is now treated like the existing "long, possibly mistyped" copies when all three hold: its heading is not a data/code/materials availability heading, it is longer than a compact statement (over 1200 characters or more than 3 paragraphs), and no row declares where the data are. A lexical declaration elsewhere in the paper then wins. With none, the section's opening paragraphs are still kept, as before. Onlydata_availabilityis affected.statement_scan._DATA_SUBJECTaccepts a list of up to four items around the data/code/materials noun (codebooks, scripts, software and syntax included), and the legacy anchors add "code is/are available".tests/extract/test_integrity_statements.pycover three headings × two modes, listed subjects, and a long section under "Data availability" that is still copied. 11 of the 13 new tests fail without the fix.Checks:
ruff check,ruff format --check, andpytest -m "not slow"pass (14,226 passed). One timing test,test_rate_limiter.py::test_serial_waiters_are_pacing, failed once under full-suite load and passes on its own; this change does not touch it.The paper itself could not be fetched from this environment, so the reproduction rebuilds its structure from the text in the issue. A run on the real PDF would confirm it.