Skip to content

Commit

Permalink
Revert "Revert "BUG: properly check for missing clusters (#121)""
Browse files Browse the repository at this point in the history
This reverts commit f858787.
  • Loading branch information
chrisconlon committed Dec 7, 2022
1 parent f858787 commit 7bf45be
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pyblp/economies/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,8 +493,11 @@ def solve(
raise ValueError("W_type must be 'robust', 'unadjusted', or 'clustered'.")
if se_type not in {'robust', 'unadjusted', 'clustered'}:
raise ValueError("se_type must be 'robust', 'unadjusted', or 'clustered'.")
if 'clustered' in {W_type, se_type} and 'clustering_ids' not in self.products.dtype.names:
raise ValueError("W_type or se_type is 'clustered' but clustering_ids were not specified in product_data.")
if 'clustered' in {W_type, se_type}:
if 'clustering_ids' not in self.products.dtype.names or self.products.clustering_ids.size == 0:
raise ValueError(
"W_type or se_type is 'clustered' but clustering_ids were not specified in product_data."
)

# configure or validate bounds on shares and costs
shares_bounds = self._coerce_optional_bounds(shares_bounds, 'shares_bounds')
Expand Down

0 comments on commit 7bf45be

Please sign in to comment.