Changeset 3738
- Timestamp:
- 07/03/08 10:30:05 (7 weeks ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/urbansim/household_x_zone/household_size_times_population_per_acre.py
r460 r3738 35 35 from numpy import ma 36 36 class Tests(opus_unittest.OpusTestCase): 37 variable_name = "urbansim.household_x_zone. income_times_housing_cost"37 variable_name = "urbansim.household_x_zone.household_size_times_population_per_acre" 38 38 def test_my_inputs(self): 39 housing_cost = array([333.0, 500.55, 1000.26, 459])40 income = array([1, 20, 500])39 population_per_acre = array([100, 200, 400, 200]) 40 persons = array([1, 4, 2]) 41 41 42 42 values = VariableTestToolbox().compute_variable(self.variable_name, 43 43 {"zone":{ 44 " average_housing_cost":housing_cost},44 "population_per_acre":population_per_acre}, 45 45 "household":{ 46 " income":income}},46 "persons":persons}}, 47 47 dataset = "household_x_zone") 48 should_be = array([[ 333.0, 500.55, 1000.26, 459.0], [6660.0, 10011., 20005.2, 9180],49 [ 166500., 250275., 500130., 229500.]])48 should_be = array([[100, 200, 400, 200], [400, 800, 1600, 800], 49 [200, 400, 800, 400]]) 50 50 self.assertEqual(ma.allclose(values, should_be, rtol=1e-3), 51 51 True, msg = "Error in " + self.variable_name)
