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

Update enumeration_units.py #10

Merged
merged 1 commit into from
Jun 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions pygris/enumeration_units.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,11 +570,13 @@ def places(state = None, cb = False, year = None, cache = False, subset_by = Non
print(f"Using the default year of {year}")

if state is None:
if year >= 2019 and cb:
if year < 2019:
raise ValueError("Retrieving Census-designated data for the entire US only available for years on or after 2019")
elif not cb:
raise ValueError("Retrieving Census-designated data for the entire US only available when cb is set to True")
else:
state = "us"
print("Retrieving Census-designated places for the entire United States")
else:
raise ValueError("A year must be specified for this year/dataset combination.")
else:
state = validate_state(state)

Expand Down