Skip to content

Don't use else when if raises an exception #26

@lshandross

Description

@lshandross

Re loader.py:

python convention: we don't use else when if raises and exception. instead we let control flow to the next line. this makes for more readable code. this case is a bit atypical b/c the else is simply a return

    if as_of < datetime.date.fromisoformat("2025-09-17"):
      raise NotImplementedError("Functionality for loading NSSP data with specified as_of date is not implemented.")
    else:
      return self.load_nssp_from_cdc(
        disease=disease,
        as_of=as_of,
        drop_pandemic_seasons=drop_pandemic_seasons
      )

Originally posted by @matthewcornell in #25 (review)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions