From cdcdad1c39ca580fcc2b1dcbb0784908345cf07c Mon Sep 17 00:00:00 2001 From: martinholmer Date: Sun, 1 Sep 2024 23:16:16 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@=201a99f?= =?UTF-8?q?4821c5cbbe5fd9791c8872d4bb5a9ab1958=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _modules/taxcalc/data.html | 15 ++++++++++----- recipes/recipe00.html | 8 ++++---- recipes/recipe04.html | 2 +- searchindex.js | 2 +- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/_modules/taxcalc/data.html b/_modules/taxcalc/data.html index b4b525530..092b5dd6c 100644 --- a/_modules/taxcalc/data.html +++ b/_modules/taxcalc/data.html @@ -513,7 +513,7 @@

Source code for taxcalc.data

                 # ... weights must be same size as data
                 if self.array_length > len(self.WT.index):
                     raise ValueError("Data has more records than weights.")
-                elif self.array_length < len(self.WT.index):
+                if self.array_length < len(self.WT.index):
                     # scale-up sub-sample weights by year-specific factor
                     sum_full_weights = self.WT.sum()
                     self.WT = self.WT.iloc[self.__index]
@@ -521,9 +521,11 @@ 

Source code for taxcalc.data

                     factor = sum_full_weights / sum_sub_weights
                     self.WT *= factor
                 # ... construct sample weights for current_year
-                wt_colname = 'WT{}'.format(self.current_year)
-                if wt_colname in self.WT.columns:
-                    self.s006 = self.WT[wt_colname] * 0.01
+                wt_colname = f'WT{self.current_year}'
+                assert wt_colname in self.WT.columns, (
+                    f'no weights for start year {self.current_year}'
+                )
+                self.s006 = self.WT[wt_colname] * 0.01
 
     @property
     def data_year(self):
@@ -559,7 +561,10 @@ 

Source code for taxcalc.data

             # ... apply variable extrapolation growth factors
             self._extrapolate(self.__current_year)
             # ... specify current-year sample weights
-            wt_colname = 'WT{}'.format(self.__current_year)
+            wt_colname = f'WT{self.__current_year}'
+            assert wt_colname in self.WT.columns, (
+                f'no weights for new year {self.current_year}'
+            )
             self.s006 = self.WT[wt_colname] * 0.01
diff --git a/recipes/recipe00.html b/recipes/recipe00.html index e7c0ac81b..79d46bbc2 100644 --- a/recipes/recipe00.html +++ b/recipes/recipe00.html @@ -699,7 +699,7 @@

Plotting
- Loading BokehJS ... + Loading BokehJS ...