Skip to content
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

Clean up get_chapters code and expand tests #97

Merged
merged 1 commit into from
Jan 24, 2024
Merged

Conversation

isaac091
Copy link
Collaborator

@isaac091 isaac091 commented Jan 23, 2024

@Enkidu93 For the first section, I thought my original error messages didn't make a ton of sense, so I rewrote and combined them. I also updated the BOOK_RANGE and CHAPTER_SELECTION regexes to allow subtraction so that I could take out the subtraction check right before.

I also decided to just take out the ability to add "chapter 0" because I don't think anyone's using it and it's inconsistent since adding the whole book doesn't include chapter 0, like we talked about.

I kept whole books being represented as an empty list because it's much more convenient that way for silnlp. Otherwise, we'd have to pass a versification variable through all the different functions just to be able to check chapter counts.

Other than that, I fixed the stuff for backwards ranges and added your test cases. Let me know if you have more thoughts or if I missed something!


This change is Reviewable

Copy link
Contributor

@ddaspit ddaspit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Paratext does have the concept of chapter 0. It includes everything before the first chapter marker. Scripture Forge doesn't have the same concept. Chapter 1 includes all of the introductory material. I guess we should be consistent with Scripture Forge, so it should be okay to remove support for chapter 0.

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @Enkidu93)

Copy link
Collaborator

@Enkidu93 Enkidu93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent! Thank you, Isaac, for the quick turnaround. I'll make sure the C# matches now after your additional changes and add matching tests.

Reviewed all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @isaac091)

@Enkidu93 Enkidu93 merged commit 5226d2f into main Jan 24, 2024
14 checks passed
@isaac091 isaac091 deleted the get_chapters_update2 branch January 24, 2024 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants