Skip to content

feat: csv shifting - #149

Merged
g-pechorin merged 73 commits into
mainfrom
book_page
Oct 19, 2026
Merged

g-pechorin merged 73 commits into
mainfrom
book_page

Conversation

@g-pechorin

@g-pechorin g-pechorin commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor
✨ Feature

PR Description

Alters the date shifting to allow .csv to .csv shifting with an identical API to the current .xlsx to .xlsx approach. Streams the .csv rows to perform "fast enough" for the ONCO-OMOP dataset.

Related Issues or other material

Related #141
Closes #156

Screenshots, example outputs/behaviour etc.

✅ Added/updated tests?

  • This PR contains relevant tests / Or doesn't need to per the below explanation

[optional] What gif best describes this PR or how it makes you feel?

embarrassed

@g-pechorin
g-pechorin added this pull request to stack #150 October 1, 2026 15:43
Comment thread nuh_helper/date_shift/__init__.py Fixed
@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Coverage

Coverage Report
FileStmtsMissBranchBrPartCoverMissing
nuh_helper/book_page
   book.py78530492%20, 26->30, 45, 49, 54, 75->73, 80, 103->131
   csv_book.py48120197%58
   xlsx_book.py41120197%25
nuh_helper/date_shift
   __init__.py96532890%46->55, 64, 82–89, 150->148, 152->146, 271->285, 295->310, 297
   _excel.py942356870%27->26, 34, 93, 124–137, 174, 207->213, 220–231
   _parse.py30316191%31–33, 40
   ignore.py26012197%36->38
   mappings.py48018395%97->100, 102->105, 127->131
   row_machine.py102250397%179, 220->217, 239
   stream_shift.py59034199%189->208
nuh_helper/profile
   __init__.py188264298%181->184, 256–257
TOTAL914423563393% 

Tests Skipped Failures Errors Time
206 0 💤 0 ❌ 0 🔥 17.318s ⏱️

Comment thread nuh_helper/date_shift/__init__.py Fixed
Comment thread nuh_helper/date_shift/__init__.py Fixed
@g-pechorin
g-pechorin marked this pull request as ready for review October 13, 2026 13:20
Comment thread nuh_helper/book_page/__init__.py Resolved
Comment thread pyproject.toml Resolved
Comment thread tests/test_book_page.py Resolved
Comment thread nuh_helper/date_shift/stream_shift.py Resolved
Comment thread nuh_helper/date_shift/stream_shift.py Resolved
- shift_excel_inplace is 15 lines
  - ... ignoring logs/docs, and multi-line calls
- extracts the shifting logic itself
- the handling of page/row changes is now a FSM
- moved shared definitions into their own file
- merges the shift-delta loading and generation
- annotated with sheet_configs_t
- added pyyaml dependency
Comment thread nuh_helper/book_page/book.py Fixed
Comment thread nuh_helper/book_page/book.py Fixed
Comment thread nuh_helper/book_page/book.py Fixed
Comment thread nuh_helper/book_page/book.py Fixed
peterlavalle-nhs and others added 4 commits October 16, 2026 16:05
@g-pechorin
g-pechorin merged commit 6dd0034 into main Oct 19, 2026
9 checks passed
@g-pechorin
g-pechorin deleted the book_page branch October 19, 2026 15:23
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.9.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

date shift CSV to CSV as well as XLSX

4 participants