Skip to content

Fix is_not_offered_this_year for multi-course entries#268

Merged
dtemkin1 merged 4 commits intosipb:mainfrom
eL1fe:fix/is-not-offered-multiple-classes
Jan 20, 2026
Merged

Fix is_not_offered_this_year for multi-course entries#268
dtemkin1 merged 4 commits intosipb:mainfrom
eL1fe:fix/is-not-offered-multiple-classes

Conversation

@eL1fe
Copy link
Copy Markdown
Contributor

@eL1fe eL1fe commented Dec 29, 2025

Summary

Fixes #267

When a catalog entry contains multiple courses (e.g., HST.010 and HST.011 sharing the same content block), the is_not_offered_this_year check was applied to the entire shared HTML. If any "not offered" indicator was found, all courses in that entry were incorrectly skipped.

The Problem

The example from the issue (course 12.S492) demonstrates this: when one course in a multi-course entry has a "not offered" indicator, the current logic hides both courses from Hydrant — even though one of them might actually be offered.

The Fix

For multi-course entries (len(course_nums) > 1), we now skip the is_not_offered_this_year check entirely and include all courses. This is because we cannot reliably determine which specific course the indicator applies to.

For single-course entries, the behavior remains unchanged.

Changes

  • scrapers/catalog.py: Modified the condition in scrape_courses_from_page to only use is_not_offered_this_year as a skip criterion for single-course entries.

eL1fe and others added 2 commits December 29, 2025 17:10
When a catalog entry contains multiple courses (e.g., HST.010 and HST.011),
the 'not offered' indicator might only apply to one of them. Previously,
if any 'not offered' indicator was found in the shared HTML block, ALL
courses in that entry were skipped.

This fix ensures multi-course entries are always included, since we cannot
reliably determine which specific course the indicator applies to.

Fixes sipb#267
@dtemkin1
Copy link
Copy Markdown
Collaborator

I think we might be able to pass in the course numbers to is_not_offered_this_year and then just check if there are multiple numbers? Then do some different logic, let me try it out and see if it works

@dtemkin1 dtemkin1 requested review from dtemkin1 and psvenk January 20, 2026 18:23
@dtemkin1 dtemkin1 merged commit 235d2f8 into sipb:main Jan 20, 2026
7 checks passed
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.

is_not_offered_this_year not accurate for multiple class entries

2 participants