udst / urbansim_defaults Goto Github PK
View Code? Open in Web Editor NEWSome starter models and functionality to use with UrbanSim
Home Page: https://udst.github.io/urbansim_defaults/
License: BSD 3-Clause "New" or "Revised" License
Some starter models and functionality to use with UrbanSim
Home Page: https://udst.github.io/urbansim_defaults/
License: BSD 3-Clause "New" or "Revised" License
this check here could maybe work better: https://github.com/synthicity/urbansim_defaults/blob/ec68a0b2fff79c66f00bc63c8232e55c580cce41/urbansim_defaults/utils.py#L78-L81
at line 78, it seems like it would print out which data frame has NA's. but i don't think it actually does. (see the output below). i ran into this while having a config file with NA's as parameters (as output by Estimation.ipynb)
it looks like this (at least in a notebook, not sure about python):
AssertionError Traceback (most recent call last)
in ()
27 #"pusher", # push results to the web client
28 #"clear_cache" # clear the cache each year
---> 29 ], years=range(in_year, out_year))
30 print "Finished", time.ctime()
d:\urbansim_windows\urbansim\urbansim\sim\simulation.pyc in run(models, years, data_out, out_interval)
1524 model = get_model(model_name)
1525 t2 = time.time()
-> 1526 model()
1527 print("Time to execute model '{}': {:.2f}s".format(
1528 model_name, time.time()-t2))
d:\urbansim_windows\urbansim\urbansim\sim\simulation.pyc in call(self)
679 kwargs = _collect_variables(names=self._argspec.args,
680 expressions=self._argspec.defaults)
--> 681 return self._func(**kwargs)
682
683 def _tables_used(self):
d:\urbansim_windows\urbansim_defaults\urbansim_defaults\models.pyc in hlcm_simulate(households, buildings, aggregations, settings)
46 "building_id","residential_units",
47 "vacant_residential_units",
---> 48 settings.get("enable_supply_correction", None))
49
50
d:\urbansim_windows\urbansim_defaults\urbansim_defaults\utils.pyc in lcm_simulate(cfg, choosers, buildings, join_tbls, out_fname, supply_fname, vacant_fname, enable_supply_correction)
337 additional_columns +=[enable_supply_correction["price_col"]]
338 locations_df = to_frame(buildings, join_tbls, cfg,
--> 339 additional_columns=additional_columns)
340
341 available_units = buildings[supply_fname]
d:\urbansim_windows\urbansim_defaults\urbansim_defaults\utils.pyc in to_frame(tbl, join_tbls, cfg, additional_columns)
193 else:
194 df = tables[0].to_frame(columns)
--> 195 check_nas(df)
196 return df
197
d:\urbansim_windows\urbansim_defaults\urbansim_defaults\utils.pyc in check_nas(df)
79 (df_cnt-s_cnt, df_cnt, col)
80
---> 81 assertnot fail, "NAs were found in dataframe, please fix"
82
83
I believe the value count results will be sorted based on frequency (descending) so I don't see how this would align with the buildings. Seems like you will need to reindex the count results before the subtract?
@orca.column('buildings', 'vacant_residential_units')
def vacant_residential_units(buildings, households):
return buildings.residential_units.sub(
households.building_id.value_counts(), fill_value=0)
@orca.column('buildings', 'vacant_job_spaces')
def vacant_job_spaces(buildings, jobs):
return buildings.job_spaces.sub(
jobs.building_id.value_counts(), fill_value=0)
Pass in params in utils.py rather than storing and accessing data using the simulation framework
/urbansim_defaults/urbansim_defaults/utils.py:222: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
model_type = yaml.load(open(cfg))["model_type"]
Might be changed to yaml.load(open(cfg), Loader=yaml.FullLoader)["model_type"]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.