NYCPlanning / db-factfinder

data ETL for population fact finder (decennial + acs)
https://nycplanning.github.io/db-factfinder/factfinder/
MIT License
2 stars 3 forks source link

Overwriting of df in calculate_c_e_m_p_z -- an error? #51

Closed mgraber closed 3 years ago

mgraber commented 3 years ago

In calculate_c_e_m_p_z, if:

v.pff_variable in self.special_variables
and geotype in self.aggregated_geography
and v.pff_variable not in self.base_variables

Then df first gets populated by calling self.calculate_special_e_m(v.pff_variable, geotype) in line 373. It then gets overwritten by calling self.calculate_e_m(v.pff_variable, geotype) in line 378.

In the case where

not (
v.pff_variable in self.special_variables
and geotype in self.aggregated_geography)
and v.pff_variable not in self.base_variables

self.calculate_e_m(v.pff_variable, geotype) gets called twice. Once in line 368 and again in line 378.

Should line 378 get deleted?

See: https://github.com/NYCPlanning/db-factfinder/blob/618c81f06c2cea90226a4157eff5a8b221b5ab87/factfinder/main.py#L366-L395

SPTKL commented 3 years ago

yes, we should remove line 378