replicahq / doppelganger

A Python package of tools to support population synthesizers
Apache License 2.0
165 stars 32 forks source link

issue with cvxpy.Variable functions in example code #70

Open b-ganesh opened 4 years ago

b-ganesh commented 4 years ago

Hi there, I am running into an issue during the allocation step when I try to run your example code. I am currently using Python 3 and I am getting the following error. Any help on this issue would be much appreciated- thanks so much!

TypeError Traceback (most recent call last)

in ----> 1 allocator = HouseholdAllocator.from_cleaned_data(controls, households_data, persons_data) ~/anaconda3/lib/python3.7/site-packages/doppelganger/allocation.py in from_cleaned_data(marginals, households_data, persons_data) 77 households_data.data, persons_data.data) 78 allocated_households, allocated_persons = \ ---> 79 HouseholdAllocator._allocate_households(households, persons, marginals) 80 return HouseholdAllocator(allocated_households, allocated_persons) 81 ~/anaconda3/lib/python3.7/site-packages/doppelganger/allocation.py in _allocate_households(households, persons, tract_controls) 174 175 hh_weights = balance_multi_cvx( --> 176 hh_table, A, B, w_extend, gamma * mu_extend.T, meta_gamma 177 ) 178 ~/anaconda3/lib/python3.7/site-packages/doppelganger/listbalancer.py in balance_multi_cvx(hh_table, A, B, w, mu, meta_mu, verbose_solver) 121 122 n_tracts = w.shape[0] --> 123 x = cvx.Variable(n_tracts, n_samples) 124 125 # Relative weights of tracts ~/anaconda3/lib/python3.7/site-packages/cvxpy/expressions/variable.py in __init__(self, shape, name, var_id, **kwargs) 73 self._name = name 74 else: ---> 75 raise TypeError("Variable name %s must be a string." % name) 76 77 self._value = None TypeError: Variable name 917 must be a string.