Skip to content

Conversation

@eL1fe
Copy link

@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.

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
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

1 participant