psrc / urbansim2

3 stars 0 forks source link

In conversion script pass YEAR via an argument #132

Closed hanase closed 5 years ago

hanase commented 6 years ago

In the cache2h5 conversion script make it possible to set the year as an argument, instead of hard-coded in the YEAR object. E.g. via an option '-y'. It can use 2014 as default.

In an estimation mode, the -y option could be given as a sequence, e.g. -y 2000,2009,2014 with these three values as default.

stefancoe commented 6 years ago

This should take care of it: https://github.com/psrc/urbansim2/commit/a0a31cb40281a1d3cc032307c51cb111b22915d9

hanase commented 6 years ago

@stefancoe - I'm not able to pass the year value. I get this error:

$ python cache_to_hdf5.py //modelsrv8/d$/opusgit/urbansim_data/data/psrc_parcel/base_year_2014_inputs/urbansim2_estimation_cache test.h5 ["2000", "2009", "2014"] --is-estimation usage: cache_to_hdf5.py [-h] [--is-estimation] [--no-compress] base_dir hdf_name year cache_to_hdf5.py: error: unrecognized arguments: 2009, 2014]

stefancoe commented 6 years ago

@hanase the code worked when I had the arguments in a list in Main(), but clearly its not working when passing them in the command prompt. I wonder if it would be easier to just have some variables like year and path at the top of the script instead of using argparse? It starts to get a little messy with the different years for the estimation data.

hanase commented 6 years ago

Sure. Make it simple for now - we can revisit later.