🚀 [feat] vehicle type model - #486

Merged
jpn-- merged 44 commits into
ActivitySim:developfrom
mxndrwgrdnr:vehicle
Jun 6, 2022
Merged

🚀 [feat] vehicle type model#486
jpn-- merged 44 commits into
ActivitySim:developfrom
mxndrwgrdnr:vehicle

Conversation

@mxndrwgrdnr

@mxndrwgrdnrmxndrwgrdnr commented Sep 21, 2021

Copy link
Copy Markdown
Contributor

User Story

As a planner, I would like to understand the effects of vehicle type choice on travel behavior in order to support more detailed emissions analysis and more refined travel costs.

Requirements

Per https://github.com/ActivitySim/activitysim/wiki/Phase-6b-Scope-of-Work#task-2-vehicle-type-model

After applying this submodel, household vehicles should have the following properties:

  • vehicle type (e.g. auto, light-truck, etc)
  • capacity (# of people it can carry)
  • power train (ICE, hybrid, phev, etc)
  • range
  • age

In addition, each auto tour should be assigned the most likely household vehicles based on:

  • household
  • tour-characteristics
  • household vehicle attributes

*Note: For this task, vehicle allocation to auto tours should not consider the availability of each individual vehicles. *

The implementation should have the following usability features:

  • ability to read an input vehicle table, as opposed to create one during a model run, an initialize_vehicles submodel will be added that can read a vehicle table from CSV file, annotate it with custom expressions, ensure table keys are consistent with household IDs, and add it to the pipeline.
  • detailed technical documentation of all vehicle type and allocation models or methods.
  • updated users guide
  • tests covering the new methods
  • examples covering new methods

Approach

Model Estimation

  • estimate vehicle type model based on 5,000 household Bay Area TNC survey data
  • run the submodel with the existing example model
  • reasonably verify goodness-of-fit across key dimensions such as:
    • socio-demographics and
    • geography

Implementation

  • integrate method into the ActivitySim run stream.
  • develop method for allocating household-generated VMT to household vehicles
  • sensitivity tests

Issues

Fixes#438

@mxndrwgrdnr
mxndrwgrdnr marked this pull request as draft September 21, 2021 05:24
@bstabler

Copy link
Copy Markdown
Contributor

#438

@coveralls

coveralls commented Sep 21, 2021

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.5%) to 53.603% when pulling d556239 on mxndrwgrdnr:vehicle into 91930b5 on ActivitySim:develop.

@bstabler

Copy link
Copy Markdown
Contributor

@mxndrwgrdnr - can you adjust this PR to merge to develop? Thanks.

@mxndrwgrdnr
mxndrwgrdnr changed the base branch from master to developNovember 9, 2021 00:05
@mxndrwgrdnr
mxndrwgrdnr marked this pull request as ready for review November 12, 2021 22:52
@e-loe-lo added the Feature New feature or request label Dec 7, 2021
@e-loe-lo changed the title vehicle type model🚀 [feat] vehicle type modelDec 7, 2021
@e-loe-lo linked an issue Dec 7, 2021 that may be closed by this pull request

@e-loe-lo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally I found the code easy to read and it flowed well. There is a general lack of documentation including:

  • docstrings appropriately formatted for autodoc-ing
  • typehints
  • origin of model coefficients, what estimation are they from, etc
  • general documentation about capabilities
  • intra-activity sim links to documentation about general activitysim "things" (i.e. various formats, etc)

There is also a lack of tests for the specific unit of the vehicle type choice.

I also found it odd when running the MTC test example locally, that it didn't pick up the config? I suspect I'm doing something wrong but if I'm doing it wrong others might too (maybe?)

Comment threadactivitysim/abm/models/vehicle_type_choice.py
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/tables/vehicles.py
Comment threadactivitysim/abm/tables/vehicles.py
Comment threadactivitysim/abm/tables/vehicles.py
Comment threadactivitysim/examples/example_mtc/configs/free_parking.csv Outdated
Comment threadactivitysim/examples/example_mtc/configs/settings.yaml Outdated
@e-lo

e-lo commented Dec 8, 2021

Copy link
Copy Markdown
Collaborator

BTW I'll probably have more questions once I get the MTC example working on my local machine - i.e. is it annotating tours etc.

@jpn--
jpn-- requested a review from i-am-sijiaMay 5, 2022 13:53
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Car_8,.9541,0.0096,0.0355,0.0007,0.0000
Car_9,.9548,0.0037,0.0409,0.0004,0.0001
Car_10,0.9530,0.0015,0.0451,0.0003,0.0001
Car_11,0.9676,0.0096,0.0225,0.0003,0.0000

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems as though some amount of "smoothing" would make sense here between the years. Many of the numbers for the lower-probability options go back and forth between 0 and >0 several times.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, these probabilities are "lumpy". This is due to the fact that they came directly from the National Household Travel Survey data. A comment about the "lumpy-ness" was added to the models.rst vehicle type choice documentation encouraging the user to change the probabilities to their region and smooth them as they see fit. Additional links in the documentation point to the presented results and sensitivity studies.

So, I suggest we leave the probabilities as is in the context of this pull request for the purpose of simplicity and transparency.

config.config_file_path(vehicle_type_data_file), comment='#')
fleet_year = model_settings.get('FLEET_YEAR')

vehicle_type_data['age'] = (1 + fleet_year - vehicle_type_data['vehicle_year']).astype(str)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to make sense that we would be able to imply a variation in fuel type based on vehicle age. However, in this case age isn't necessarily relative. A 10 year old car in a 2030 scenario should be equal to a 2 year old car in 2022.

I'm trying to figure out how this is accommodated within the probabilities but can't seem to find anywhere that this is done?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this wasn't done very consistently... I changed the probabilities file to include this same calculation -- the probabilities file now includes body_type and vehicle_year columns just like the vehicle_type_data.csv file and age is explicitly calculated based on the user input fleet_year.

Comment threadactivitysim/abm/models/vehicle_allocation.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_allocation.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py
Comment threadactivitysim/abm/models/vehicle_type_choice.py
logger = logging.getLogger(__name__)


def get_combinatorial_vehicle_alternatives(alts_cats_dict, model_settings):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest adding a unit test for this function.

@dhensledhensleMay 24, 2022

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done. See the abm/test/test_misc/test_vehicle_type_alternatives.py script. Also cleaned up the function to remove model settings and make it better for a stand-alone unit test.

Comment threadactivitysim/abm/models/vehicle_type_choice.py
choosers=choosers,
alternatives=alts_wide,
spec=model_spec,
log_alt_losers=log_alt_losers,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something to consider more holistically in activitysim: most of these function calls seem to require 5-10 parameters.

Many best practices call for <= 3.

All the parameters which relate to run settings (e.g. chunk size, trace label, trace choice name) and not "substance" (e.g. alternatives, estimator, chooser) get in the way of legibility of what is happening.

Don't get me wrong - I love being explicit about things - but I would consider bundling some of these things in a config class that gets passed around or something similar.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is something we have been actively discussing as a consortium. I think making changes to this affect is outside the scope of this pull request though.

Comment threadactivitysim/abm/tables/vehicles.py Outdated
vehicles['vehicle_id'] = vehicles.household_id * 10 + vehicles.vehicle_num
vehicles.set_index('vehicle_id', inplace = True)

# I do not understand why this line is necessary, it seems circular

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should figure this out before merging

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the purpose of this line is to replace the "table" function with the dataframe. Added comment to reflect this just like in persons and households. This is just a consequence of how the inject table decorator and add_table functions were constructed.

@e-lo

e-lo commented May 13, 2022

Copy link
Copy Markdown
Collaborator

I'm getting a numpy comparison error when running test_mtc_extended.py (note that test_mtc.py seems to run just find)

Erroring at:

File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line286, inassign_variablesexpr_values=to_series(eval(expression, globals_dict, _locals_dict))
File"<string>", line1, in<module>FutureWarning: elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparison

Numpy version: v1.21

Note I scanned the code where it seems like somebody was trying to get this to just warn not error - but it doesn't seem to be working as run for some reason. I haven't troubleshot too much yet - thought I'd post in case it is a known issue.

Full Trace

---------------------------------------------------------------Capturedstdoutcall----------------------------------------------------------------ConfiguredloggingusingbasicConfigINFO:activitysim:ConfiguredloggingusingbasicConfigINFO-Readloggingconfigurationfrom: /Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/configs/logging.yamlINFO-SETTINGconfigs_dir: ['/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/test/configs', '/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/configs', '/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/configs']
INFO-SETTINGsettings_file_name: settings.yamlINFO-SETTINGdata_dir: ['/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data']
INFO-SETTINGoutput_dir: /Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/test/outputINFO-SETTINGhouseholds_sample_size: 10INFO-SETTINGchunk_size: 0INFO-SETTINGchunk_method: hybrid_ussINFO-SETTINGchunk_training_mode: disabledINFO-SETTINGmultiprocess: NoneINFO-SETTINGnum_processes: NoneINFO-SETTINGresume_after: NoneINFO-SETTINGtrace_hh_id: NoneINFO-ENVMKL_NUM_THREADS: NoneINFO-ENVOMP_NUM_THREADS: NoneINFO-ENVOPENBLAS_NUM_THREADS: NoneINFO-NUMPYblas_infolibraries: ['cblas', 'blas', 'cblas', 'blas']
INFO-NUMPYblas_opt_infolibraries: ['cblas', 'blas', 'cblas', 'blas']
INFO-NUMPYlapack_infolibraries: ['lapack', 'blas', 'lapack', 'blas']
INFO-NUMPYlapack_opt_infolibraries: ['lapack', 'blas', 'lapack', 'blas', 'cblas', 'blas', 'cblas', 'blas']
INFO-runsingleprocesssimulationINFO-Timetoexecuteopen_pipeline : 0.062seconds (0.0minutes)
INFO-preload_injectablesINFO-Timetoexecutepreload_injectables : 0.014seconds (0.0minutes)
INFO-#run_model running step initialize_landuseRunningstep'initialize_landuse'INFO-ReadingCSVfile/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/land_use.csvINFO-loadedland_use (25, 24)
INFO-initialize_landuse.annotate_tables-annotatingland_useSPECannotate_landuseINFO-Network_LOSusingskim_dict_factory: NumpyArraySkimFactoryINFO-allocate_skim_buffersharedFalsetazshape (826, 25, 25) totalsize: 2_065_000 (2.1MB)
INFO-_read_skims_from_omx/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/skims.omxINFO-_read_skims_from_omxloaded826skimsfrom/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/skims.omxINFO-writingskimcachetaz (826, 25, 25) to/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/test/output/cache/cached_taz.mmapINFO-load_skims_to_buffertazshape (826, 25, 25)
INFO-get_skim_datatazSkimDatashape (826, 25, 25)
INFO-SkimDictinittazINFO-SkimDict.build_3d_skim_block_offset_tableregistered1673dkeysTimetoexecutestep'initialize_landuse': 1.82sTotaltimetoexecuteiteration1withiterationvalueNone: 1.82sINFO-#run_model running step initialize_householdsRunningstep'initialize_households'INFO-ReadingCSVfile/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/households.csvINFO-fullhouseholdlistcontains5000householdsINFO-sampling10of5000householdsINFO-loadedhouseholds (10, 7)
INFO-ReadingCSVfile/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/persons.csvINFO-loadedpersons (28, 7)
INFO-initialize_households.annotate_tables-annotatingpersonsSPECannotate_personsINFO-initialize_households.annotate_tables-annotatinghouseholdsSPECannotate_householdsINFO-initialize_households.annotate_tables-annotatingpersonsSPECannotate_persons_after_hhTimetoexecutestep'initialize_households': 0.37sTotaltimetoexecuteiteration1withiterationvalueNone: 0.37sINFO-#run_model running step compute_accessibilityRunningstep'compute_accessibility'INFO-Runningcompute_accessibilitywith25origzones25destzonesINFO-compute_accessibilityRunningadaptive_chunked_chooserswith25choosersINFO-Runningchunk1of1with25of25choosersINFO-Runningcompute_accessibilitywith25origzones25destzonesINFO-compute_accessibilitycomputedaccessibilities (25, 10)
Timetoexecutestep'compute_accessibility': 0.06sTotaltimetoexecuteiteration1withiterationvalueNone: 0.06sINFO-#run_model running step school_locationRunningstep'school_location'INFO-Runningschool_location.i1.sample.universitywith4personsINFO-school_location.i1.sample.university.interaction_sampleRunningadaptive_chunked_chooserswith4choosersINFO-Runningchunk1of1with4of4choosersINFO-Runningeval_interaction_utilitieson24rowsINFO-Runningschool_location.i1.logsums.universitywith11rowsERROR-assign_variables-FutureWarning (elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparison) evaluating: np.where(sov_auto_op_cost.isna() | (sov_veh_option=='non_hh_veh'), costPerMile, sov_auto_op_cost)
numpy.core._exceptions._UFuncInputCastingError: Cannotcastufunc'equal'input1fromdtype('<U10') todtype('float64') withcastingrule'same_kind'Theaboveexceptionwasthedirectcauseofthefollowingexception:
Traceback (mostrecentcalllast):
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line286, inassign_variablesexpr_values=to_series(eval(expression, globals_dict, _locals_dict))
File"<string>", line1, in<module>FutureWarning: elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparisonINFO-Timetoexecuteallmodelsuntilthiserror : 2.814seconds (0.0minutes)
ERROR-activitysimrunencounteredanunrecoverableerrornumpy.core._exceptions._UFuncInputCastingError: Cannotcastufunc'equal'input1fromdtype('<U10') todtype('float64') withcastingrule'same_kind'Theaboveexceptionwasthedirectcauseofthefollowingexception:
Traceback (mostrecentcalllast):
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/cli/run.py", line260, inrunpipeline.run(models=config.setting('models'), resume_after=resume_after)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/pipeline.py", line617, inrunrun_model(model)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/pipeline.py", line476, inrun_modelorca.run([step_name])
File"/Users/elizabeth/opt/miniconda3/envs/asim/lib/python3.9/site-packages/orca/orca.py", line2168, inrunstep()
File"/Users/elizabeth/opt/miniconda3/envs/asim/lib/python3.9/site-packages/orca/orca.py", line973, in__call__returnself._func(**kwargs)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line920, inschool_locationiterate_location_choice(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line774, initerate_location_choicechoices_df, save_sample_df=run_location_choice(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line619, inrun_location_choicerun_location_logsums(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line438, inrun_location_logsumslogsums=logsum.compute_logsums(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/util/logsums.py", line142, incompute_logsumsexpressions.assign_columns(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/expressions.py", line124, inassign_columnsresults=compute_columns(df, model_settings, locals_dict, trace_label)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/expressions.py", line95, incompute_columns=assign.assign_variables(expressions_spec,
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line298, inassign_variablesraiseerrFile"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line286, inassign_variablesexpr_values=to_series(eval(expression, globals_dict, _locals_dict))
File"<string>", line1, in<module>FutureWarning: elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparison---------------------------------------------------------------Capturedstderrcall----------------------------------------------------------------numpy.core._exceptions._UFuncInputCastingError: Cannotcastufunc'equal'input1fromdtype('<U10') todtype('float64') withcastingrule'same_kind'Theaboveexceptionwasthedirectcauseofthefollowingexception:
Traceback (mostrecentcalllast):
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/test/simulation.py", line15, in<module>sys.exit(run(args))
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/cli/run.py", line260, inrunpipeline.run(models=config.setting('models'), resume_after=resume_after)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/pipeline.py", line617, inrunrun_model(model)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/pipeline.py", line476, inrun_modelorca.run([step_name])
File"/Users/elizabeth/opt/miniconda3/envs/asim/lib/python3.9/site-packages/orca/orca.py", line2168, inrunstep()
File"/Users/elizabeth/opt/miniconda3/envs/asim/lib/python3.9/site-packages/orca/orca.py", line973, in__call__returnself._func(**kwargs)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line920, inschool_locationiterate_location_choice(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line774, initerate_location_choicechoices_df, save_sample_df=run_location_choice(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line619, inrun_location_choicerun_location_logsums(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line438, inrun_location_logsumslogsums=logsum.compute_logsums(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/util/logsums.py", line142, incompute_logsumsexpressions.assign_columns(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/expressions.py", line124, inassign_columnsresults=compute_columns(df, model_settings, locals_dict, trace_label)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/expressions.py", line95, incompute_columns=assign.assign_variables(expressions_spec,
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line298, inassign_variablesraiseerrFile"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line286, inassign_variablesexpr_values=to_series(eval(expression, globals_dict, _locals_dict))
File"<string>", line1, in<module>FutureWarning: elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparison

Conda List

# packages in environment at /Users/elizabeth/opt/miniconda3/envs/asim:
#
# Name Version Build Channel
abseil-cpp 20210324.2 he49afe7_0 conda-forge
activitysim 1.0.3 dev_0 <develop>
appnope 0.1.3 pyhd8ed1ab_0 conda-forge
argon2-cffi 21.3.0 pyhd8ed1ab_0 conda-forge
argon2-cffi-bindings 21.2.0 py39h63b48b0_2 conda-forge
arrow-cpp 8.0.0 py39hfe23411_0_cpu conda-forge
asttokens 2.0.5 pyhd8ed1ab_0 conda-forge
attrs 21.4.0 pyhd8ed1ab_0 conda-forge
aws-c-cal 0.5.11 hd2e2f4b_0 conda-forge
aws-c-common 0.6.2 h0d85af4_0 conda-forge
aws-c-event-stream 0.2.7 hb9330a7_13 conda-forge
aws-c-io 0.10.5 h35aa462_0 conda-forge
aws-checksums 0.1.11 h0010a65_7 conda-forge
aws-sdk-cpp 1.8.186 h766a74d_3 conda-forge
backcall 0.2.0 pyh9f0ad1d_0 conda-forge
backports 1.0 py_2 conda-forge
backports.functools_lru_cache 1.6.4 pyhd8ed1ab_0 conda-forge
beautifulsoup4 4.11.1 pyha770c72_0 conda-forge
bleach 5.0.0 pyhd8ed1ab_0 conda-forge
blosc 1.21.1 h97e831e_2 conda-forge
boost-cpp 1.74.0 hdbf7018_7 conda-forge
branca 0.5.0 pyhd8ed1ab_0 conda-forge
brotli 1.0.9 h5eb16cf_7 conda-forge
brotli-bin 1.0.9 h5eb16cf_7 conda-forge
brotlipy 0.7.0 py39h63b48b0_1004 conda-forge
bump2version 1.0.1 pyh9f0ad1d_0 conda-forge
bzip2 1.0.8 h0d85af4_4 conda-forge
c-ares 1.18.1 h0d85af4_0 conda-forge
ca-certificates 2021.10.8 h033912b_0 conda-forge
cairo 1.16.0 h9e0e54b_1010 conda-forge
certifi 2021.10.8 py39h6e9494a_2 conda-forge
cffi 1.15.0 py39he338e87_0 conda-forge
cfitsio 4.1.0 h2c97ad1_0 conda-forge
charset-normalizer 2.0.12 pyhd8ed1ab_0 conda-forge
click 8.1.3 py39h6e9494a_0 conda-forge
click-plugins 1.1.1 py_0 conda-forge
cligj 0.7.2 pyhd8ed1ab_1 conda-forge
coverage 6.3.2 py39h63b48b0_2 conda-forge
coveralls 3.3.1 pyhd8ed1ab_0 conda-forge
cryptography 36.0.2 py39h1644bb1_1 conda-forge
curl 7.83.1 h372c54d_0 conda-forge
cycler 0.11.0 pyhd8ed1ab_0 conda-forge
cytoolz 0.11.2 py39h63b48b0_2 conda-forge
dbus 1.13.6 h811a1a6_3 conda-forge
debugpy 1.6.0 py39hfd1d529_0 conda-forge
decorator 5.1.1 pyhd8ed1ab_0 conda-forge
defusedxml 0.7.1 pyhd8ed1ab_0 conda-forge
descartes 1.1.0 py_4 conda-forge
docopt 0.6.2 py_1 conda-forge
entrypoints 0.4 pyhd8ed1ab_0 conda-forge
executing 0.8.3 pyhd8ed1ab_0 conda-forge
expat 2.4.8 h96cf925_0 conda-forge
fiona 1.8.21 py39h6d65ddd_1 conda-forge
flask 2.1.2 pyhd8ed1ab_1 conda-forge
flit-core 3.7.1 pyhd8ed1ab_0 conda-forge
folium 0.12.1.post1 pyhd8ed1ab_1 conda-forge
font-ttf-dejavu-sans-mono 2.37 hab24e00_0 conda-forge
font-ttf-inconsolata 3.000 h77eed37_0 conda-forge
font-ttf-source-code-pro 2.038 h77eed37_0 conda-forge
font-ttf-ubuntu 0.83 hab24e00_0 conda-forge
fontconfig 2.14.0 h676cef8_0 conda-forge
fonts-conda-ecosystem 1 0 conda-forge
fonts-conda-forge 1 0 conda-forge
fonttools 4.33.3 py39h701faf5_0 conda-forge
freetype 2.10.4 h4cff582_1 conda-forge
freexl 1.0.6 h0d85af4_0 conda-forge
gdal 3.4.2 py39h97b4846_7 conda-forge
geopandas 0.10.2 pyhd8ed1ab_1 conda-forge
geopandas-base 0.10.2 pyha770c72_1 conda-forge
geos 3.10.2 he49afe7_0 conda-forge
geotiff 1.7.1 had63758_1 conda-forge
gettext 0.19.8.1 hd1a6beb_1008 conda-forge
gflags 2.2.2 hb1e8313_1004 conda-forge
gh 2.10.1 h990441c_0 conda-forge
giflib 5.2.1 hbcb3906_2 conda-forge
git 2.35.3 pl5321h33a4a8a_0 conda-forge
glog 0.6.0 h8ac2a54_0 conda-forge
grpc-cpp 1.43.2 ha04666b_3 conda-forge
hdf4 4.2.15 hefd3b78_3 conda-forge
hdf5 1.12.1 nompi_ha60fbc9_104 conda-forge
icu 69.1 he49afe7_0 conda-forge
idna 3.3 pyhd8ed1ab_0 conda-forge
importlib-metadata 4.11.3 py39h6e9494a_1 conda-forge
importlib_resources 5.7.1 pyhd8ed1ab_0 conda-forge
iniconfig 1.1.1 pyh9f0ad1d_0 conda-forge
ipykernel 6.13.0 py39h71a6800_0 conda-forge
ipython 8.3.0 py39h6e9494a_0 conda-forge
ipython_genutils 0.2.0 py_1 conda-forge
ipywidgets 7.7.0 pyhd8ed1ab_0 conda-forge
itsdangerous 2.1.2 pyhd8ed1ab_0 conda-forge
jbig 2.1 h0d85af4_2003 conda-forge
jedi 0.18.1 py39h6e9494a_1 conda-forge
jinja2 3.1.2 pyhd8ed1ab_0 conda-forge
joblib 1.1.0 pyhd8ed1ab_0 conda-forge
jpeg 9e h5eb16cf_1 conda-forge
json-c 0.16 h01d06f9_0 conda-forge
jsonschema 4.5.1 pyhd8ed1ab_0 conda-forge
jupyter 1.0.0 py39h6e9494a_7 conda-forge
jupyter_client 7.3.1 pyhd8ed1ab_0 conda-forge
jupyter_console 6.4.3 pyhd8ed1ab_0 conda-forge
jupyter_core 4.10.0 py39h6e9494a_0 conda-forge
jupyterlab_pygments 0.2.2 pyhd8ed1ab_0 conda-forge
jupyterlab_widgets 1.1.0 pyhd8ed1ab_0 conda-forge
kealib 1.4.14 ha22a8b1_3 conda-forge
kiwisolver 1.4.2 py39h7248d28_1 conda-forge
krb5 1.19.3 hb49756b_0 conda-forge
lcms2 2.12 h577c468_0 conda-forge
lerc 3.0 he49afe7_0 conda-forge
libblas 3.9.0 14_osx64_openblas conda-forge
libbrotlicommon 1.0.9 h5eb16cf_7 conda-forge
libbrotlidec 1.0.9 h5eb16cf_7 conda-forge
libbrotlienc 1.0.9 h5eb16cf_7 conda-forge
libcblas 3.9.0 14_osx64_openblas conda-forge
libclang 13.0.1 default_he082bbe_0 conda-forge
libcrc32c 1.1.2 he49afe7_0 conda-forge
libcurl 7.83.1 h372c54d_0 conda-forge
libcxx 14.0.3 hc203e6f_0 conda-forge
libdap4 3.20.6 h3e144a0_2 conda-forge
libdeflate 1.10 h0d85af4_0 conda-forge
libedit 3.1.20191231 h0678c8f_2 conda-forge
libev 4.33 haf1e3a3_1 conda-forge
libevent 2.1.10 h815e4d9_4 conda-forge
libffi 3.4.2 h0d85af4_5 conda-forge
libgdal 3.4.2 h6474519_7 conda-forge
libgfortran 5.0.0 9_3_0_h6c81a4c_23 conda-forge
libgfortran5 9.3.0 h6c81a4c_23 conda-forge
libglib 2.70.2 hf1fb8c0_4 conda-forge
libgoogle-cloud 1.36.0 h52a585b_0 conda-forge
libiconv 1.16 haf1e3a3_0 conda-forge
libkml 1.3.0 h8fd9edb_1014 conda-forge
liblapack 3.9.0 14_osx64_openblas conda-forge
libllvm11 11.1.0 hd011deb_3 conda-forge
libllvm13 13.0.1 h64f94b2_2 conda-forge
libnetcdf 4.8.1 nompi_h6609ca0_102 conda-forge
libnghttp2 1.47.0 h942079c_0 conda-forge
libopenblas 0.3.20 openmp_hb3cd9ec_0 conda-forge
libpng 1.6.37 h7cec526_2 conda-forge
libpq 14.2 hea3049e_0 conda-forge
libprotobuf 3.19.4 hcf210ce_0 conda-forge
librttopo 1.1.0 hec60dd8_9 conda-forge
libsodium 1.0.18 hbcb3906_1 conda-forge
libspatialindex 1.9.3 he49afe7_4 conda-forge
libspatialite 5.0.1 hadde3e2_15 conda-forge
libssh2 1.10.0 h52ee1ee_2 conda-forge
libthrift 0.16.0 h9702cd6_1 conda-forge
libtiff 4.3.0 h17f2ce3_3 conda-forge
libutf8proc 2.7.0 h0d85af4_0 conda-forge
libwebp 1.2.2 h28dabe5_0 conda-forge
libwebp-base 1.2.2 h0d85af4_1 conda-forge
libxcb 1.13 h0d85af4_1004 conda-forge
libxml2 2.9.12 h7e28ab6_1 conda-forge
libzip 1.8.0 h8b0c345_1 conda-forge
libzlib 1.2.11 h6c3fc93_1014 conda-forge
llvm-openmp 14.0.3 ha654fa7_0 conda-forge
llvmlite 0.38.0 py39ha9d9895_1 conda-forge
lz4-c 1.9.3 he49afe7_1 conda-forge
mapclassify 2.4.3 pyhd8ed1ab_0 conda-forge
markupsafe 2.1.1 py39h63b48b0_1 conda-forge
matplotlib 3.5.2 py39h6e9494a_0 conda-forge
matplotlib-base 3.5.2 py39h64a0072_0 conda-forge
matplotlib-inline 0.1.3 pyhd8ed1ab_0 conda-forge
mistune 0.8.4 py39h89e85a6_1005 conda-forge
munch 2.5.0 py_0 conda-forge
munkres 1.1.4 pyh9f0ad1d_0 conda-forge
mysql-common 8.0.29 h924029e_0 conda-forge
mysql-libs 8.0.29 h3cab752_0 conda-forge
nbclient 0.6.3 pyhd8ed1ab_0 conda-forge
nbconvert 6.5.0 pyhd8ed1ab_0 conda-forge
nbconvert-core 6.5.0 pyhd8ed1ab_0 conda-forge
nbconvert-pandoc 6.5.0 pyhd8ed1ab_0 conda-forge
nbformat 5.4.0 pyhd8ed1ab_0 conda-forge
ncurses 6.3 h96cf925_1 conda-forge
nest-asyncio 1.5.5 pyhd8ed1ab_0 conda-forge
networkx 2.8 pyhd8ed1ab_0 conda-forge
notebook 6.4.11 pyha770c72_0 conda-forge
nspr 4.32 hcd9eead_1 conda-forge
nss 3.77 hfce436b_0 conda-forge
numba 0.55.1 py39hc37845d_1 conda-forge
numexpr 2.8.0 py39hbd61c47_2 conda-forge
numpy 1.21.6 py39hf56e92f_0 conda-forge
openjpeg 2.4.0 h6e7aa92_1 conda-forge
openmatrix 0.3.5.0 pyhd8ed1ab_0 conda-forge
openssl 1.1.1o hfe4f2af_0 conda-forge
orc 1.7.3 h84518c8_0 conda-forge
orca 1.6 pyhd8ed1ab_0 conda-forge
packaging 21.3 pyhd8ed1ab_0 conda-forge
pandas 1.4.2 py39hbd61c47_1 conda-forge
pandoc 2.18 h694c41f_0 conda-forge
pandocfilters 1.5.0 pyhd8ed1ab_0 conda-forge
parquet-cpp 1.5.1 2 conda-forge
parso 0.8.3 pyhd8ed1ab_0 conda-forge
pcre 8.45 he49afe7_0 conda-forge
pcre2 10.37 ha16e1b2_0 conda-forge
perl 5.32.1 2_h0d85af4_perl5 conda-forge
pexpect 4.8.0 pyh9f0ad1d_2 conda-forge
pickleshare 0.7.5 py_1003 conda-forge
pillow 9.1.0 py39hd2c7aa1_2 conda-forge
pip 22.1 pyhd8ed1ab_0 conda-forge
pixman 0.40.0 hbcb3906_0 conda-forge
pluggy 1.0.0 py39h6e9494a_3 conda-forge
poppler 22.04.0 h39497b0_0 conda-forge
poppler-data 0.4.11 hd8ed1ab_0 conda-forge
postgresql 14.2 he8fe76e_0 conda-forge
proj 9.0.0 h2364a93_1 conda-forge
prometheus_client 0.14.1 pyhd8ed1ab_0 conda-forge
prompt-toolkit 3.0.29 pyha770c72_0 conda-forge
prompt_toolkit 3.0.29 hd8ed1ab_0 conda-forge
psutil 5.9.0 py39h63b48b0_1 conda-forge
pthread-stubs 0.4 hc929b4f_1001 conda-forge
ptyprocess 0.7.0 pyhd3deb0d_0 conda-forge
pure_eval 0.2.2 pyhd8ed1ab_0 conda-forge
py 1.11.0 pyh6c4a22f_0 conda-forge
pyarrow 8.0.0 py39hb9688c1_0_cpu conda-forge
pycodestyle 2.8.0 pyhd8ed1ab_0 conda-forge
pycparser 2.21 pyhd8ed1ab_0 conda-forge
pygments 2.12.0 pyhd8ed1ab_0 conda-forge
pyopenssl 22.0.0 pyhd8ed1ab_0 conda-forge
pyparsing 3.0.9 pyhd8ed1ab_0 conda-forge
pyproj 3.3.1 py39hfe197cf_0 conda-forge
pyqt 5.12.3 py39h9d385e7_4 conda-forge
pyqt5-sip 4.19.18 pypi_0 pypi
pyqtchart 5.12 pypi_0 pypi
pyqtwebengine 5.12.1 pypi_0 pypi
pyrsistent 0.18.1 py39h63b48b0_1 conda-forge
pysocks 1.7.1 py39h6e9494a_5 conda-forge
pytest 7.1.2 py39h6e9494a_0 conda-forge
pytest-cov 3.0.0 pyhd8ed1ab_0 conda-forge
pytest-datadir 1.3.1 py_0 conda-forge
pytest-regressions 2.3.1 pyhd8ed1ab_0 conda-forge
python 3.9.12 h8b4d769_1_cpython conda-forge
python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge
python-fastjsonschema 2.15.3 pyhd8ed1ab_0 conda-forge
python_abi 3.9 2_cp39 conda-forge
pytz 2022.1 pyhd8ed1ab_0 conda-forge
pyyaml 6.0 py39h63b48b0_4 conda-forge
pyzmq 22.3.0 py39hc2dc7ec_2 conda-forge
qt 5.12.9 h2a607e2_5 conda-forge
qtconsole 5.3.0 pyhd8ed1ab_0 conda-forge
qtconsole-base 5.3.0 pyhd8ed1ab_0 conda-forge
qtpy 2.1.0 pyhd8ed1ab_0 conda-forge
re2 2022.02.01 he49afe7_0 conda-forge
readline 8.1 h05e3726_0 conda-forge
requests 2.27.1 pyhd8ed1ab_0 conda-forge
rtree 1.0.0 py39h7d0d40a_1 conda-forge
scikit-learn 1.0.2 py39hd4eea88_0 conda-forge
scipy 1.8.0 py39h056f1c0_1 conda-forge
send2trash 1.8.0 pyhd8ed1ab_0 conda-forge
setuptools 62.2.0 py39h6e9494a_0 conda-forge
shapely 1.8.2 py39hd471b09_1 conda-forge
six 1.16.0 pyh6c4a22f_0 conda-forge
snappy 1.1.9 h6e38e02_0 conda-forge
soupsieve 2.3.1 pyhd8ed1ab_0 conda-forge
sqlite 3.38.5 hd9f0692_0 conda-forge
stack_data 0.2.0 pyhd8ed1ab_0 conda-forge
tables 3.6.1 pypi_0 pypi
terminado 0.13.3 py39h6e9494a_1 conda-forge
threadpoolctl 3.1.0 pyh8a188c0_0 conda-forge
tiledb 2.8.2 hf17dc58_0 conda-forge
tinycss2 1.1.1 pyhd8ed1ab_0 conda-forge
tk 8.6.12 h5dbffcc_0 conda-forge
toml 0.10.2 pyhd8ed1ab_0 conda-forge
tomli 2.0.1 pyhd8ed1ab_0 conda-forge
toolz 0.11.2 pyhd8ed1ab_0 conda-forge
tornado 6.1 py39h63b48b0_3 conda-forge
traitlets 5.2.0 pyhd8ed1ab_0 conda-forge
tzcode 2022a h5eb16cf_0 conda-forge
tzdata 2022a h191b570_0 conda-forge
unicodedata2 14.0.0 py39h63b48b0_1 conda-forge
urllib3 1.26.9 pyhd8ed1ab_0 conda-forge
wcwidth 0.2.5 pyh9f0ad1d_2 conda-forge
webencodings 0.5.1 py_1 conda-forge
werkzeug 2.1.2 pyhd8ed1ab_1 conda-forge
wheel 0.37.1 pyhd8ed1ab_0 conda-forge
widgetsnbextension 3.6.0 py39h6e9494a_0 conda-forge
xerces-c 3.2.3 h6564042_4 conda-forge
xorg-libxau 1.0.9 h35c211d_0 conda-forge
xorg-libxdmcp 1.1.3 h35c211d_0 conda-forge
xyzservices 2022.4.0 pyhd8ed1ab_0 conda-forge
xz 5.2.5 haf1e3a3_1 conda-forge
yaml 0.2.5 h0d85af4_2 conda-forge
zeromq 4.3.4 he49afe7_1 conda-forge
zipp 3.8.0 pyhd8ed1ab_0 conda-forge
zlib 1.2.11 h6c3fc93_1014 conda-forge
zstd 1.5.2 h582d3a0_0 conda-forge

@dhensle

Copy link
Copy Markdown
Contributor

I'm getting a numpy comparison error when running test_mtc_extended.py (note that test_mtc.py seems to run just find)

Sorry about that, the setup I had was pointing to some other configs. This test should be passing now.

@dhensle

Copy link
Copy Markdown
Contributor

@e-lo I believe I have addressed all of your comments. I left a couple conversations open for you to sign off on. Thanks for your helpful comments and please let me know if there's anything else I missed.

Comment threadactivitysim/examples/example_mtc/configs/annotate_households.csv Outdated
@jfdman

Copy link
Copy Markdown

Have all comments been addressed? Please advise, we have several regions waiting to pull this model into their implementation. Thanks!

@guyrousseau

Copy link
Copy Markdown

@jfdman Since all vehicle make/model coding for the NHTS (since inception) maps to NHTSA’s FARS vehicle make/mode coding scheme [https://www.nhtsa.gov/research-data/fatality-analysis-reporting-system-fars], can you confirm that our vehicle type model conforms with NHTSA’s FARS?

@i-am-sijia

i-am-sijia commented Jun 6, 2022

Copy link
Copy Markdown
Member

Have all comments been addressed? Please advise, we have several regions waiting to pull this model into their implementation. Thanks!

Confirmed all previous comments are addressed. Guy's question is the only one left. Thanks.

@jpn--
jpn-- merged commit 367cbac into ActivitySim:developJun 6, 2022
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FeatureNew feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

create vehicle type model and add vehicle table to pipeline

10 participants

@mxndrwgrdnr@bstabler@coveralls@e-lo@dhensle@jfdman@guyrousseau@i-am-sijia@toliwaga@jpn--
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

🚀 [feat] vehicle type model - #486

Merged
jpn-- merged 44 commits into
ActivitySim:developfrom
mxndrwgrdnr:vehicle
Jun 6, 2022
Merged

🚀 [feat] vehicle type model#486
jpn-- merged 44 commits into
ActivitySim:developfrom
mxndrwgrdnr:vehicle

Conversation

@mxndrwgrdnr

@mxndrwgrdnrmxndrwgrdnr commented Sep 21, 2021

Copy link
Copy Markdown
Contributor

User Story

As a planner, I would like to understand the effects of vehicle type choice on travel behavior in order to support more detailed emissions analysis and more refined travel costs.

Requirements

Per https://github.com/ActivitySim/activitysim/wiki/Phase-6b-Scope-of-Work#task-2-vehicle-type-model

After applying this submodel, household vehicles should have the following properties:

  • vehicle type (e.g. auto, light-truck, etc)
  • capacity (# of people it can carry)
  • power train (ICE, hybrid, phev, etc)
  • range
  • age

In addition, each auto tour should be assigned the most likely household vehicles based on:

  • household
  • tour-characteristics
  • household vehicle attributes

*Note: For this task, vehicle allocation to auto tours should not consider the availability of each individual vehicles. *

The implementation should have the following usability features:

  • ability to read an input vehicle table, as opposed to create one during a model run, an initialize_vehicles submodel will be added that can read a vehicle table from CSV file, annotate it with custom expressions, ensure table keys are consistent with household IDs, and add it to the pipeline.
  • detailed technical documentation of all vehicle type and allocation models or methods.
  • updated users guide
  • tests covering the new methods
  • examples covering new methods

Approach

Model Estimation

  • estimate vehicle type model based on 5,000 household Bay Area TNC survey data
  • run the submodel with the existing example model
  • reasonably verify goodness-of-fit across key dimensions such as:
    • socio-demographics and
    • geography

Implementation

  • integrate method into the ActivitySim run stream.
  • develop method for allocating household-generated VMT to household vehicles
  • sensitivity tests

Issues

Fixes#438

@mxndrwgrdnr
mxndrwgrdnr marked this pull request as draft September 21, 2021 05:24
@bstabler

Copy link
Copy Markdown
Contributor

#438

@coveralls

coveralls commented Sep 21, 2021

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.5%) to 53.603% when pulling d556239 on mxndrwgrdnr:vehicle into 91930b5 on ActivitySim:develop.

@bstabler

Copy link
Copy Markdown
Contributor

@mxndrwgrdnr - can you adjust this PR to merge to develop? Thanks.

@mxndrwgrdnr
mxndrwgrdnr changed the base branch from master to developNovember 9, 2021 00:05
@mxndrwgrdnr
mxndrwgrdnr marked this pull request as ready for review November 12, 2021 22:52
@e-loe-lo added the Feature New feature or request label Dec 7, 2021
@e-loe-lo changed the title vehicle type model🚀 [feat] vehicle type modelDec 7, 2021
@e-loe-lo linked an issue Dec 7, 2021 that may be closed by this pull request

@e-loe-lo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally I found the code easy to read and it flowed well. There is a general lack of documentation including:

  • docstrings appropriately formatted for autodoc-ing
  • typehints
  • origin of model coefficients, what estimation are they from, etc
  • general documentation about capabilities
  • intra-activity sim links to documentation about general activitysim "things" (i.e. various formats, etc)

There is also a lack of tests for the specific unit of the vehicle type choice.

I also found it odd when running the MTC test example locally, that it didn't pick up the config? I suspect I'm doing something wrong but if I'm doing it wrong others might too (maybe?)

Comment threadactivitysim/abm/models/vehicle_type_choice.py
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/tables/vehicles.py
Comment threadactivitysim/abm/tables/vehicles.py
Comment threadactivitysim/abm/tables/vehicles.py
Comment threadactivitysim/examples/example_mtc/configs/free_parking.csv Outdated
Comment threadactivitysim/examples/example_mtc/configs/settings.yaml Outdated
@e-lo

e-lo commented Dec 8, 2021

Copy link
Copy Markdown
Collaborator

BTW I'll probably have more questions once I get the MTC example working on my local machine - i.e. is it annotating tours etc.

@jpn--
jpn-- requested a review from i-am-sijiaMay 5, 2022 13:53
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Car_8,.9541,0.0096,0.0355,0.0007,0.0000
Car_9,.9548,0.0037,0.0409,0.0004,0.0001
Car_10,0.9530,0.0015,0.0451,0.0003,0.0001
Car_11,0.9676,0.0096,0.0225,0.0003,0.0000

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems as though some amount of "smoothing" would make sense here between the years. Many of the numbers for the lower-probability options go back and forth between 0 and >0 several times.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, these probabilities are "lumpy". This is due to the fact that they came directly from the National Household Travel Survey data. A comment about the "lumpy-ness" was added to the models.rst vehicle type choice documentation encouraging the user to change the probabilities to their region and smooth them as they see fit. Additional links in the documentation point to the presented results and sensitivity studies.

So, I suggest we leave the probabilities as is in the context of this pull request for the purpose of simplicity and transparency.

config.config_file_path(vehicle_type_data_file), comment='#')
fleet_year = model_settings.get('FLEET_YEAR')

vehicle_type_data['age'] = (1 + fleet_year - vehicle_type_data['vehicle_year']).astype(str)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to make sense that we would be able to imply a variation in fuel type based on vehicle age. However, in this case age isn't necessarily relative. A 10 year old car in a 2030 scenario should be equal to a 2 year old car in 2022.

I'm trying to figure out how this is accommodated within the probabilities but can't seem to find anywhere that this is done?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this wasn't done very consistently... I changed the probabilities file to include this same calculation -- the probabilities file now includes body_type and vehicle_year columns just like the vehicle_type_data.csv file and age is explicitly calculated based on the user input fleet_year.

Comment threadactivitysim/abm/models/vehicle_allocation.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_allocation.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py
Comment threadactivitysim/abm/models/vehicle_type_choice.py
logger = logging.getLogger(__name__)


def get_combinatorial_vehicle_alternatives(alts_cats_dict, model_settings):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest adding a unit test for this function.

@dhensledhensleMay 24, 2022

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done. See the abm/test/test_misc/test_vehicle_type_alternatives.py script. Also cleaned up the function to remove model settings and make it better for a stand-alone unit test.

Comment threadactivitysim/abm/models/vehicle_type_choice.py
choosers=choosers,
alternatives=alts_wide,
spec=model_spec,
log_alt_losers=log_alt_losers,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something to consider more holistically in activitysim: most of these function calls seem to require 5-10 parameters.

Many best practices call for <= 3.

All the parameters which relate to run settings (e.g. chunk size, trace label, trace choice name) and not "substance" (e.g. alternatives, estimator, chooser) get in the way of legibility of what is happening.

Don't get me wrong - I love being explicit about things - but I would consider bundling some of these things in a config class that gets passed around or something similar.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is something we have been actively discussing as a consortium. I think making changes to this affect is outside the scope of this pull request though.

Comment threadactivitysim/abm/tables/vehicles.py Outdated
vehicles['vehicle_id'] = vehicles.household_id * 10 + vehicles.vehicle_num
vehicles.set_index('vehicle_id', inplace = True)

# I do not understand why this line is necessary, it seems circular

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should figure this out before merging

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the purpose of this line is to replace the "table" function with the dataframe. Added comment to reflect this just like in persons and households. This is just a consequence of how the inject table decorator and add_table functions were constructed.

@e-lo

e-lo commented May 13, 2022

Copy link
Copy Markdown
Collaborator

I'm getting a numpy comparison error when running test_mtc_extended.py (note that test_mtc.py seems to run just find)

Erroring at:

File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line286, inassign_variablesexpr_values=to_series(eval(expression, globals_dict, _locals_dict))
File"<string>", line1, in<module>FutureWarning: elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparison

Numpy version: v1.21

Note I scanned the code where it seems like somebody was trying to get this to just warn not error - but it doesn't seem to be working as run for some reason. I haven't troubleshot too much yet - thought I'd post in case it is a known issue.

Full Trace

---------------------------------------------------------------Capturedstdoutcall----------------------------------------------------------------ConfiguredloggingusingbasicConfigINFO:activitysim:ConfiguredloggingusingbasicConfigINFO-Readloggingconfigurationfrom: /Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/configs/logging.yamlINFO-SETTINGconfigs_dir: ['/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/test/configs', '/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/configs', '/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/configs']
INFO-SETTINGsettings_file_name: settings.yamlINFO-SETTINGdata_dir: ['/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data']
INFO-SETTINGoutput_dir: /Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/test/outputINFO-SETTINGhouseholds_sample_size: 10INFO-SETTINGchunk_size: 0INFO-SETTINGchunk_method: hybrid_ussINFO-SETTINGchunk_training_mode: disabledINFO-SETTINGmultiprocess: NoneINFO-SETTINGnum_processes: NoneINFO-SETTINGresume_after: NoneINFO-SETTINGtrace_hh_id: NoneINFO-ENVMKL_NUM_THREADS: NoneINFO-ENVOMP_NUM_THREADS: NoneINFO-ENVOPENBLAS_NUM_THREADS: NoneINFO-NUMPYblas_infolibraries: ['cblas', 'blas', 'cblas', 'blas']
INFO-NUMPYblas_opt_infolibraries: ['cblas', 'blas', 'cblas', 'blas']
INFO-NUMPYlapack_infolibraries: ['lapack', 'blas', 'lapack', 'blas']
INFO-NUMPYlapack_opt_infolibraries: ['lapack', 'blas', 'lapack', 'blas', 'cblas', 'blas', 'cblas', 'blas']
INFO-runsingleprocesssimulationINFO-Timetoexecuteopen_pipeline : 0.062seconds (0.0minutes)
INFO-preload_injectablesINFO-Timetoexecutepreload_injectables : 0.014seconds (0.0minutes)
INFO-#run_model running step initialize_landuseRunningstep'initialize_landuse'INFO-ReadingCSVfile/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/land_use.csvINFO-loadedland_use (25, 24)
INFO-initialize_landuse.annotate_tables-annotatingland_useSPECannotate_landuseINFO-Network_LOSusingskim_dict_factory: NumpyArraySkimFactoryINFO-allocate_skim_buffersharedFalsetazshape (826, 25, 25) totalsize: 2_065_000 (2.1MB)
INFO-_read_skims_from_omx/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/skims.omxINFO-_read_skims_from_omxloaded826skimsfrom/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/skims.omxINFO-writingskimcachetaz (826, 25, 25) to/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/test/output/cache/cached_taz.mmapINFO-load_skims_to_buffertazshape (826, 25, 25)
INFO-get_skim_datatazSkimDatashape (826, 25, 25)
INFO-SkimDictinittazINFO-SkimDict.build_3d_skim_block_offset_tableregistered1673dkeysTimetoexecutestep'initialize_landuse': 1.82sTotaltimetoexecuteiteration1withiterationvalueNone: 1.82sINFO-#run_model running step initialize_householdsRunningstep'initialize_households'INFO-ReadingCSVfile/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/households.csvINFO-fullhouseholdlistcontains5000householdsINFO-sampling10of5000householdsINFO-loadedhouseholds (10, 7)
INFO-ReadingCSVfile/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/persons.csvINFO-loadedpersons (28, 7)
INFO-initialize_households.annotate_tables-annotatingpersonsSPECannotate_personsINFO-initialize_households.annotate_tables-annotatinghouseholdsSPECannotate_householdsINFO-initialize_households.annotate_tables-annotatingpersonsSPECannotate_persons_after_hhTimetoexecutestep'initialize_households': 0.37sTotaltimetoexecuteiteration1withiterationvalueNone: 0.37sINFO-#run_model running step compute_accessibilityRunningstep'compute_accessibility'INFO-Runningcompute_accessibilitywith25origzones25destzonesINFO-compute_accessibilityRunningadaptive_chunked_chooserswith25choosersINFO-Runningchunk1of1with25of25choosersINFO-Runningcompute_accessibilitywith25origzones25destzonesINFO-compute_accessibilitycomputedaccessibilities (25, 10)
Timetoexecutestep'compute_accessibility': 0.06sTotaltimetoexecuteiteration1withiterationvalueNone: 0.06sINFO-#run_model running step school_locationRunningstep'school_location'INFO-Runningschool_location.i1.sample.universitywith4personsINFO-school_location.i1.sample.university.interaction_sampleRunningadaptive_chunked_chooserswith4choosersINFO-Runningchunk1of1with4of4choosersINFO-Runningeval_interaction_utilitieson24rowsINFO-Runningschool_location.i1.logsums.universitywith11rowsERROR-assign_variables-FutureWarning (elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparison) evaluating: np.where(sov_auto_op_cost.isna() | (sov_veh_option=='non_hh_veh'), costPerMile, sov_auto_op_cost)
numpy.core._exceptions._UFuncInputCastingError: Cannotcastufunc'equal'input1fromdtype('<U10') todtype('float64') withcastingrule'same_kind'Theaboveexceptionwasthedirectcauseofthefollowingexception:
Traceback (mostrecentcalllast):
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line286, inassign_variablesexpr_values=to_series(eval(expression, globals_dict, _locals_dict))
File"<string>", line1, in<module>FutureWarning: elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparisonINFO-Timetoexecuteallmodelsuntilthiserror : 2.814seconds (0.0minutes)
ERROR-activitysimrunencounteredanunrecoverableerrornumpy.core._exceptions._UFuncInputCastingError: Cannotcastufunc'equal'input1fromdtype('<U10') todtype('float64') withcastingrule'same_kind'Theaboveexceptionwasthedirectcauseofthefollowingexception:
Traceback (mostrecentcalllast):
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/cli/run.py", line260, inrunpipeline.run(models=config.setting('models'), resume_after=resume_after)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/pipeline.py", line617, inrunrun_model(model)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/pipeline.py", line476, inrun_modelorca.run([step_name])
File"/Users/elizabeth/opt/miniconda3/envs/asim/lib/python3.9/site-packages/orca/orca.py", line2168, inrunstep()
File"/Users/elizabeth/opt/miniconda3/envs/asim/lib/python3.9/site-packages/orca/orca.py", line973, in__call__returnself._func(**kwargs)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line920, inschool_locationiterate_location_choice(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line774, initerate_location_choicechoices_df, save_sample_df=run_location_choice(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line619, inrun_location_choicerun_location_logsums(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line438, inrun_location_logsumslogsums=logsum.compute_logsums(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/util/logsums.py", line142, incompute_logsumsexpressions.assign_columns(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/expressions.py", line124, inassign_columnsresults=compute_columns(df, model_settings, locals_dict, trace_label)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/expressions.py", line95, incompute_columns=assign.assign_variables(expressions_spec,
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line298, inassign_variablesraiseerrFile"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line286, inassign_variablesexpr_values=to_series(eval(expression, globals_dict, _locals_dict))
File"<string>", line1, in<module>FutureWarning: elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparison---------------------------------------------------------------Capturedstderrcall----------------------------------------------------------------numpy.core._exceptions._UFuncInputCastingError: Cannotcastufunc'equal'input1fromdtype('<U10') todtype('float64') withcastingrule'same_kind'Theaboveexceptionwasthedirectcauseofthefollowingexception:
Traceback (mostrecentcalllast):
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/test/simulation.py", line15, in<module>sys.exit(run(args))
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/cli/run.py", line260, inrunpipeline.run(models=config.setting('models'), resume_after=resume_after)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/pipeline.py", line617, inrunrun_model(model)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/pipeline.py", line476, inrun_modelorca.run([step_name])
File"/Users/elizabeth/opt/miniconda3/envs/asim/lib/python3.9/site-packages/orca/orca.py", line2168, inrunstep()
File"/Users/elizabeth/opt/miniconda3/envs/asim/lib/python3.9/site-packages/orca/orca.py", line973, in__call__returnself._func(**kwargs)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line920, inschool_locationiterate_location_choice(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line774, initerate_location_choicechoices_df, save_sample_df=run_location_choice(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line619, inrun_location_choicerun_location_logsums(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line438, inrun_location_logsumslogsums=logsum.compute_logsums(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/util/logsums.py", line142, incompute_logsumsexpressions.assign_columns(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/expressions.py", line124, inassign_columnsresults=compute_columns(df, model_settings, locals_dict, trace_label)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/expressions.py", line95, incompute_columns=assign.assign_variables(expressions_spec,
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line298, inassign_variablesraiseerrFile"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line286, inassign_variablesexpr_values=to_series(eval(expression, globals_dict, _locals_dict))
File"<string>", line1, in<module>FutureWarning: elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparison

Conda List

# packages in environment at /Users/elizabeth/opt/miniconda3/envs/asim:
#
# Name Version Build Channel
abseil-cpp 20210324.2 he49afe7_0 conda-forge
activitysim 1.0.3 dev_0 <develop>
appnope 0.1.3 pyhd8ed1ab_0 conda-forge
argon2-cffi 21.3.0 pyhd8ed1ab_0 conda-forge
argon2-cffi-bindings 21.2.0 py39h63b48b0_2 conda-forge
arrow-cpp 8.0.0 py39hfe23411_0_cpu conda-forge
asttokens 2.0.5 pyhd8ed1ab_0 conda-forge
attrs 21.4.0 pyhd8ed1ab_0 conda-forge
aws-c-cal 0.5.11 hd2e2f4b_0 conda-forge
aws-c-common 0.6.2 h0d85af4_0 conda-forge
aws-c-event-stream 0.2.7 hb9330a7_13 conda-forge
aws-c-io 0.10.5 h35aa462_0 conda-forge
aws-checksums 0.1.11 h0010a65_7 conda-forge
aws-sdk-cpp 1.8.186 h766a74d_3 conda-forge
backcall 0.2.0 pyh9f0ad1d_0 conda-forge
backports 1.0 py_2 conda-forge
backports.functools_lru_cache 1.6.4 pyhd8ed1ab_0 conda-forge
beautifulsoup4 4.11.1 pyha770c72_0 conda-forge
bleach 5.0.0 pyhd8ed1ab_0 conda-forge
blosc 1.21.1 h97e831e_2 conda-forge
boost-cpp 1.74.0 hdbf7018_7 conda-forge
branca 0.5.0 pyhd8ed1ab_0 conda-forge
brotli 1.0.9 h5eb16cf_7 conda-forge
brotli-bin 1.0.9 h5eb16cf_7 conda-forge
brotlipy 0.7.0 py39h63b48b0_1004 conda-forge
bump2version 1.0.1 pyh9f0ad1d_0 conda-forge
bzip2 1.0.8 h0d85af4_4 conda-forge
c-ares 1.18.1 h0d85af4_0 conda-forge
ca-certificates 2021.10.8 h033912b_0 conda-forge
cairo 1.16.0 h9e0e54b_1010 conda-forge
certifi 2021.10.8 py39h6e9494a_2 conda-forge
cffi 1.15.0 py39he338e87_0 conda-forge
cfitsio 4.1.0 h2c97ad1_0 conda-forge
charset-normalizer 2.0.12 pyhd8ed1ab_0 conda-forge
click 8.1.3 py39h6e9494a_0 conda-forge
click-plugins 1.1.1 py_0 conda-forge
cligj 0.7.2 pyhd8ed1ab_1 conda-forge
coverage 6.3.2 py39h63b48b0_2 conda-forge
coveralls 3.3.1 pyhd8ed1ab_0 conda-forge
cryptography 36.0.2 py39h1644bb1_1 conda-forge
curl 7.83.1 h372c54d_0 conda-forge
cycler 0.11.0 pyhd8ed1ab_0 conda-forge
cytoolz 0.11.2 py39h63b48b0_2 conda-forge
dbus 1.13.6 h811a1a6_3 conda-forge
debugpy 1.6.0 py39hfd1d529_0 conda-forge
decorator 5.1.1 pyhd8ed1ab_0 conda-forge
defusedxml 0.7.1 pyhd8ed1ab_0 conda-forge
descartes 1.1.0 py_4 conda-forge
docopt 0.6.2 py_1 conda-forge
entrypoints 0.4 pyhd8ed1ab_0 conda-forge
executing 0.8.3 pyhd8ed1ab_0 conda-forge
expat 2.4.8 h96cf925_0 conda-forge
fiona 1.8.21 py39h6d65ddd_1 conda-forge
flask 2.1.2 pyhd8ed1ab_1 conda-forge
flit-core 3.7.1 pyhd8ed1ab_0 conda-forge
folium 0.12.1.post1 pyhd8ed1ab_1 conda-forge
font-ttf-dejavu-sans-mono 2.37 hab24e00_0 conda-forge
font-ttf-inconsolata 3.000 h77eed37_0 conda-forge
font-ttf-source-code-pro 2.038 h77eed37_0 conda-forge
font-ttf-ubuntu 0.83 hab24e00_0 conda-forge
fontconfig 2.14.0 h676cef8_0 conda-forge
fonts-conda-ecosystem 1 0 conda-forge
fonts-conda-forge 1 0 conda-forge
fonttools 4.33.3 py39h701faf5_0 conda-forge
freetype 2.10.4 h4cff582_1 conda-forge
freexl 1.0.6 h0d85af4_0 conda-forge
gdal 3.4.2 py39h97b4846_7 conda-forge
geopandas 0.10.2 pyhd8ed1ab_1 conda-forge
geopandas-base 0.10.2 pyha770c72_1 conda-forge
geos 3.10.2 he49afe7_0 conda-forge
geotiff 1.7.1 had63758_1 conda-forge
gettext 0.19.8.1 hd1a6beb_1008 conda-forge
gflags 2.2.2 hb1e8313_1004 conda-forge
gh 2.10.1 h990441c_0 conda-forge
giflib 5.2.1 hbcb3906_2 conda-forge
git 2.35.3 pl5321h33a4a8a_0 conda-forge
glog 0.6.0 h8ac2a54_0 conda-forge
grpc-cpp 1.43.2 ha04666b_3 conda-forge
hdf4 4.2.15 hefd3b78_3 conda-forge
hdf5 1.12.1 nompi_ha60fbc9_104 conda-forge
icu 69.1 he49afe7_0 conda-forge
idna 3.3 pyhd8ed1ab_0 conda-forge
importlib-metadata 4.11.3 py39h6e9494a_1 conda-forge
importlib_resources 5.7.1 pyhd8ed1ab_0 conda-forge
iniconfig 1.1.1 pyh9f0ad1d_0 conda-forge
ipykernel 6.13.0 py39h71a6800_0 conda-forge
ipython 8.3.0 py39h6e9494a_0 conda-forge
ipython_genutils 0.2.0 py_1 conda-forge
ipywidgets 7.7.0 pyhd8ed1ab_0 conda-forge
itsdangerous 2.1.2 pyhd8ed1ab_0 conda-forge
jbig 2.1 h0d85af4_2003 conda-forge
jedi 0.18.1 py39h6e9494a_1 conda-forge
jinja2 3.1.2 pyhd8ed1ab_0 conda-forge
joblib 1.1.0 pyhd8ed1ab_0 conda-forge
jpeg 9e h5eb16cf_1 conda-forge
json-c 0.16 h01d06f9_0 conda-forge
jsonschema 4.5.1 pyhd8ed1ab_0 conda-forge
jupyter 1.0.0 py39h6e9494a_7 conda-forge
jupyter_client 7.3.1 pyhd8ed1ab_0 conda-forge
jupyter_console 6.4.3 pyhd8ed1ab_0 conda-forge
jupyter_core 4.10.0 py39h6e9494a_0 conda-forge
jupyterlab_pygments 0.2.2 pyhd8ed1ab_0 conda-forge
jupyterlab_widgets 1.1.0 pyhd8ed1ab_0 conda-forge
kealib 1.4.14 ha22a8b1_3 conda-forge
kiwisolver 1.4.2 py39h7248d28_1 conda-forge
krb5 1.19.3 hb49756b_0 conda-forge
lcms2 2.12 h577c468_0 conda-forge
lerc 3.0 he49afe7_0 conda-forge
libblas 3.9.0 14_osx64_openblas conda-forge
libbrotlicommon 1.0.9 h5eb16cf_7 conda-forge
libbrotlidec 1.0.9 h5eb16cf_7 conda-forge
libbrotlienc 1.0.9 h5eb16cf_7 conda-forge
libcblas 3.9.0 14_osx64_openblas conda-forge
libclang 13.0.1 default_he082bbe_0 conda-forge
libcrc32c 1.1.2 he49afe7_0 conda-forge
libcurl 7.83.1 h372c54d_0 conda-forge
libcxx 14.0.3 hc203e6f_0 conda-forge
libdap4 3.20.6 h3e144a0_2 conda-forge
libdeflate 1.10 h0d85af4_0 conda-forge
libedit 3.1.20191231 h0678c8f_2 conda-forge
libev 4.33 haf1e3a3_1 conda-forge
libevent 2.1.10 h815e4d9_4 conda-forge
libffi 3.4.2 h0d85af4_5 conda-forge
libgdal 3.4.2 h6474519_7 conda-forge
libgfortran 5.0.0 9_3_0_h6c81a4c_23 conda-forge
libgfortran5 9.3.0 h6c81a4c_23 conda-forge
libglib 2.70.2 hf1fb8c0_4 conda-forge
libgoogle-cloud 1.36.0 h52a585b_0 conda-forge
libiconv 1.16 haf1e3a3_0 conda-forge
libkml 1.3.0 h8fd9edb_1014 conda-forge
liblapack 3.9.0 14_osx64_openblas conda-forge
libllvm11 11.1.0 hd011deb_3 conda-forge
libllvm13 13.0.1 h64f94b2_2 conda-forge
libnetcdf 4.8.1 nompi_h6609ca0_102 conda-forge
libnghttp2 1.47.0 h942079c_0 conda-forge
libopenblas 0.3.20 openmp_hb3cd9ec_0 conda-forge
libpng 1.6.37 h7cec526_2 conda-forge
libpq 14.2 hea3049e_0 conda-forge
libprotobuf 3.19.4 hcf210ce_0 conda-forge
librttopo 1.1.0 hec60dd8_9 conda-forge
libsodium 1.0.18 hbcb3906_1 conda-forge
libspatialindex 1.9.3 he49afe7_4 conda-forge
libspatialite 5.0.1 hadde3e2_15 conda-forge
libssh2 1.10.0 h52ee1ee_2 conda-forge
libthrift 0.16.0 h9702cd6_1 conda-forge
libtiff 4.3.0 h17f2ce3_3 conda-forge
libutf8proc 2.7.0 h0d85af4_0 conda-forge
libwebp 1.2.2 h28dabe5_0 conda-forge
libwebp-base 1.2.2 h0d85af4_1 conda-forge
libxcb 1.13 h0d85af4_1004 conda-forge
libxml2 2.9.12 h7e28ab6_1 conda-forge
libzip 1.8.0 h8b0c345_1 conda-forge
libzlib 1.2.11 h6c3fc93_1014 conda-forge
llvm-openmp 14.0.3 ha654fa7_0 conda-forge
llvmlite 0.38.0 py39ha9d9895_1 conda-forge
lz4-c 1.9.3 he49afe7_1 conda-forge
mapclassify 2.4.3 pyhd8ed1ab_0 conda-forge
markupsafe 2.1.1 py39h63b48b0_1 conda-forge
matplotlib 3.5.2 py39h6e9494a_0 conda-forge
matplotlib-base 3.5.2 py39h64a0072_0 conda-forge
matplotlib-inline 0.1.3 pyhd8ed1ab_0 conda-forge
mistune 0.8.4 py39h89e85a6_1005 conda-forge
munch 2.5.0 py_0 conda-forge
munkres 1.1.4 pyh9f0ad1d_0 conda-forge
mysql-common 8.0.29 h924029e_0 conda-forge
mysql-libs 8.0.29 h3cab752_0 conda-forge
nbclient 0.6.3 pyhd8ed1ab_0 conda-forge
nbconvert 6.5.0 pyhd8ed1ab_0 conda-forge
nbconvert-core 6.5.0 pyhd8ed1ab_0 conda-forge
nbconvert-pandoc 6.5.0 pyhd8ed1ab_0 conda-forge
nbformat 5.4.0 pyhd8ed1ab_0 conda-forge
ncurses 6.3 h96cf925_1 conda-forge
nest-asyncio 1.5.5 pyhd8ed1ab_0 conda-forge
networkx 2.8 pyhd8ed1ab_0 conda-forge
notebook 6.4.11 pyha770c72_0 conda-forge
nspr 4.32 hcd9eead_1 conda-forge
nss 3.77 hfce436b_0 conda-forge
numba 0.55.1 py39hc37845d_1 conda-forge
numexpr 2.8.0 py39hbd61c47_2 conda-forge
numpy 1.21.6 py39hf56e92f_0 conda-forge
openjpeg 2.4.0 h6e7aa92_1 conda-forge
openmatrix 0.3.5.0 pyhd8ed1ab_0 conda-forge
openssl 1.1.1o hfe4f2af_0 conda-forge
orc 1.7.3 h84518c8_0 conda-forge
orca 1.6 pyhd8ed1ab_0 conda-forge
packaging 21.3 pyhd8ed1ab_0 conda-forge
pandas 1.4.2 py39hbd61c47_1 conda-forge
pandoc 2.18 h694c41f_0 conda-forge
pandocfilters 1.5.0 pyhd8ed1ab_0 conda-forge
parquet-cpp 1.5.1 2 conda-forge
parso 0.8.3 pyhd8ed1ab_0 conda-forge
pcre 8.45 he49afe7_0 conda-forge
pcre2 10.37 ha16e1b2_0 conda-forge
perl 5.32.1 2_h0d85af4_perl5 conda-forge
pexpect 4.8.0 pyh9f0ad1d_2 conda-forge
pickleshare 0.7.5 py_1003 conda-forge
pillow 9.1.0 py39hd2c7aa1_2 conda-forge
pip 22.1 pyhd8ed1ab_0 conda-forge
pixman 0.40.0 hbcb3906_0 conda-forge
pluggy 1.0.0 py39h6e9494a_3 conda-forge
poppler 22.04.0 h39497b0_0 conda-forge
poppler-data 0.4.11 hd8ed1ab_0 conda-forge
postgresql 14.2 he8fe76e_0 conda-forge
proj 9.0.0 h2364a93_1 conda-forge
prometheus_client 0.14.1 pyhd8ed1ab_0 conda-forge
prompt-toolkit 3.0.29 pyha770c72_0 conda-forge
prompt_toolkit 3.0.29 hd8ed1ab_0 conda-forge
psutil 5.9.0 py39h63b48b0_1 conda-forge
pthread-stubs 0.4 hc929b4f_1001 conda-forge
ptyprocess 0.7.0 pyhd3deb0d_0 conda-forge
pure_eval 0.2.2 pyhd8ed1ab_0 conda-forge
py 1.11.0 pyh6c4a22f_0 conda-forge
pyarrow 8.0.0 py39hb9688c1_0_cpu conda-forge
pycodestyle 2.8.0 pyhd8ed1ab_0 conda-forge
pycparser 2.21 pyhd8ed1ab_0 conda-forge
pygments 2.12.0 pyhd8ed1ab_0 conda-forge
pyopenssl 22.0.0 pyhd8ed1ab_0 conda-forge
pyparsing 3.0.9 pyhd8ed1ab_0 conda-forge
pyproj 3.3.1 py39hfe197cf_0 conda-forge
pyqt 5.12.3 py39h9d385e7_4 conda-forge
pyqt5-sip 4.19.18 pypi_0 pypi
pyqtchart 5.12 pypi_0 pypi
pyqtwebengine 5.12.1 pypi_0 pypi
pyrsistent 0.18.1 py39h63b48b0_1 conda-forge
pysocks 1.7.1 py39h6e9494a_5 conda-forge
pytest 7.1.2 py39h6e9494a_0 conda-forge
pytest-cov 3.0.0 pyhd8ed1ab_0 conda-forge
pytest-datadir 1.3.1 py_0 conda-forge
pytest-regressions 2.3.1 pyhd8ed1ab_0 conda-forge
python 3.9.12 h8b4d769_1_cpython conda-forge
python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge
python-fastjsonschema 2.15.3 pyhd8ed1ab_0 conda-forge
python_abi 3.9 2_cp39 conda-forge
pytz 2022.1 pyhd8ed1ab_0 conda-forge
pyyaml 6.0 py39h63b48b0_4 conda-forge
pyzmq 22.3.0 py39hc2dc7ec_2 conda-forge
qt 5.12.9 h2a607e2_5 conda-forge
qtconsole 5.3.0 pyhd8ed1ab_0 conda-forge
qtconsole-base 5.3.0 pyhd8ed1ab_0 conda-forge
qtpy 2.1.0 pyhd8ed1ab_0 conda-forge
re2 2022.02.01 he49afe7_0 conda-forge
readline 8.1 h05e3726_0 conda-forge
requests 2.27.1 pyhd8ed1ab_0 conda-forge
rtree 1.0.0 py39h7d0d40a_1 conda-forge
scikit-learn 1.0.2 py39hd4eea88_0 conda-forge
scipy 1.8.0 py39h056f1c0_1 conda-forge
send2trash 1.8.0 pyhd8ed1ab_0 conda-forge
setuptools 62.2.0 py39h6e9494a_0 conda-forge
shapely 1.8.2 py39hd471b09_1 conda-forge
six 1.16.0 pyh6c4a22f_0 conda-forge
snappy 1.1.9 h6e38e02_0 conda-forge
soupsieve 2.3.1 pyhd8ed1ab_0 conda-forge
sqlite 3.38.5 hd9f0692_0 conda-forge
stack_data 0.2.0 pyhd8ed1ab_0 conda-forge
tables 3.6.1 pypi_0 pypi
terminado 0.13.3 py39h6e9494a_1 conda-forge
threadpoolctl 3.1.0 pyh8a188c0_0 conda-forge
tiledb 2.8.2 hf17dc58_0 conda-forge
tinycss2 1.1.1 pyhd8ed1ab_0 conda-forge
tk 8.6.12 h5dbffcc_0 conda-forge
toml 0.10.2 pyhd8ed1ab_0 conda-forge
tomli 2.0.1 pyhd8ed1ab_0 conda-forge
toolz 0.11.2 pyhd8ed1ab_0 conda-forge
tornado 6.1 py39h63b48b0_3 conda-forge
traitlets 5.2.0 pyhd8ed1ab_0 conda-forge
tzcode 2022a h5eb16cf_0 conda-forge
tzdata 2022a h191b570_0 conda-forge
unicodedata2 14.0.0 py39h63b48b0_1 conda-forge
urllib3 1.26.9 pyhd8ed1ab_0 conda-forge
wcwidth 0.2.5 pyh9f0ad1d_2 conda-forge
webencodings 0.5.1 py_1 conda-forge
werkzeug 2.1.2 pyhd8ed1ab_1 conda-forge
wheel 0.37.1 pyhd8ed1ab_0 conda-forge
widgetsnbextension 3.6.0 py39h6e9494a_0 conda-forge
xerces-c 3.2.3 h6564042_4 conda-forge
xorg-libxau 1.0.9 h35c211d_0 conda-forge
xorg-libxdmcp 1.1.3 h35c211d_0 conda-forge
xyzservices 2022.4.0 pyhd8ed1ab_0 conda-forge
xz 5.2.5 haf1e3a3_1 conda-forge
yaml 0.2.5 h0d85af4_2 conda-forge
zeromq 4.3.4 he49afe7_1 conda-forge
zipp 3.8.0 pyhd8ed1ab_0 conda-forge
zlib 1.2.11 h6c3fc93_1014 conda-forge
zstd 1.5.2 h582d3a0_0 conda-forge

@dhensle

Copy link
Copy Markdown
Contributor

I'm getting a numpy comparison error when running test_mtc_extended.py (note that test_mtc.py seems to run just find)

Sorry about that, the setup I had was pointing to some other configs. This test should be passing now.

@dhensle

Copy link
Copy Markdown
Contributor

@e-lo I believe I have addressed all of your comments. I left a couple conversations open for you to sign off on. Thanks for your helpful comments and please let me know if there's anything else I missed.

Comment threadactivitysim/examples/example_mtc/configs/annotate_households.csv Outdated
@jfdman

Copy link
Copy Markdown

Have all comments been addressed? Please advise, we have several regions waiting to pull this model into their implementation. Thanks!

@guyrousseau

Copy link
Copy Markdown

@jfdman Since all vehicle make/model coding for the NHTS (since inception) maps to NHTSA’s FARS vehicle make/mode coding scheme [https://www.nhtsa.gov/research-data/fatality-analysis-reporting-system-fars], can you confirm that our vehicle type model conforms with NHTSA’s FARS?

@i-am-sijia

i-am-sijia commented Jun 6, 2022

Copy link
Copy Markdown
Member

Have all comments been addressed? Please advise, we have several regions waiting to pull this model into their implementation. Thanks!

Confirmed all previous comments are addressed. Guy's question is the only one left. Thanks.

@jpn--
jpn-- merged commit 367cbac into ActivitySim:developJun 6, 2022
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FeatureNew feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

create vehicle type model and add vehicle table to pipeline

10 participants

@mxndrwgrdnr@bstabler@coveralls@e-lo@dhensle@jfdman@guyrousseau@i-am-sijia@toliwaga@jpn--
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

🚀 [feat] vehicle type model - #486

Merged
jpn-- merged 44 commits into
ActivitySim:developfrom
mxndrwgrdnr:vehicle
Jun 6, 2022
Merged

🚀 [feat] vehicle type model#486
jpn-- merged 44 commits into
ActivitySim:developfrom
mxndrwgrdnr:vehicle

Conversation

@mxndrwgrdnr

@mxndrwgrdnrmxndrwgrdnr commented Sep 21, 2021

Copy link
Copy Markdown
Contributor

User Story

As a planner, I would like to understand the effects of vehicle type choice on travel behavior in order to support more detailed emissions analysis and more refined travel costs.

Requirements

Per https://github.com/ActivitySim/activitysim/wiki/Phase-6b-Scope-of-Work#task-2-vehicle-type-model

After applying this submodel, household vehicles should have the following properties:

  • vehicle type (e.g. auto, light-truck, etc)
  • capacity (# of people it can carry)
  • power train (ICE, hybrid, phev, etc)
  • range
  • age

In addition, each auto tour should be assigned the most likely household vehicles based on:

  • household
  • tour-characteristics
  • household vehicle attributes

*Note: For this task, vehicle allocation to auto tours should not consider the availability of each individual vehicles. *

The implementation should have the following usability features:

  • ability to read an input vehicle table, as opposed to create one during a model run, an initialize_vehicles submodel will be added that can read a vehicle table from CSV file, annotate it with custom expressions, ensure table keys are consistent with household IDs, and add it to the pipeline.
  • detailed technical documentation of all vehicle type and allocation models or methods.
  • updated users guide
  • tests covering the new methods
  • examples covering new methods

Approach

Model Estimation

  • estimate vehicle type model based on 5,000 household Bay Area TNC survey data
  • run the submodel with the existing example model
  • reasonably verify goodness-of-fit across key dimensions such as:
    • socio-demographics and
    • geography

Implementation

  • integrate method into the ActivitySim run stream.
  • develop method for allocating household-generated VMT to household vehicles
  • sensitivity tests

Issues

Fixes#438

@mxndrwgrdnr
mxndrwgrdnr marked this pull request as draft September 21, 2021 05:24
@bstabler

Copy link
Copy Markdown
Contributor

#438

@coveralls

coveralls commented Sep 21, 2021

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.5%) to 53.603% when pulling d556239 on mxndrwgrdnr:vehicle into 91930b5 on ActivitySim:develop.

@bstabler

Copy link
Copy Markdown
Contributor

@mxndrwgrdnr - can you adjust this PR to merge to develop? Thanks.

@mxndrwgrdnr
mxndrwgrdnr changed the base branch from master to developNovember 9, 2021 00:05
@mxndrwgrdnr
mxndrwgrdnr marked this pull request as ready for review November 12, 2021 22:52
@e-loe-lo added the Feature New feature or request label Dec 7, 2021
@e-loe-lo changed the title vehicle type model🚀 [feat] vehicle type modelDec 7, 2021
@e-loe-lo linked an issue Dec 7, 2021 that may be closed by this pull request

@e-loe-lo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally I found the code easy to read and it flowed well. There is a general lack of documentation including:

  • docstrings appropriately formatted for autodoc-ing
  • typehints
  • origin of model coefficients, what estimation are they from, etc
  • general documentation about capabilities
  • intra-activity sim links to documentation about general activitysim "things" (i.e. various formats, etc)

There is also a lack of tests for the specific unit of the vehicle type choice.

I also found it odd when running the MTC test example locally, that it didn't pick up the config? I suspect I'm doing something wrong but if I'm doing it wrong others might too (maybe?)

Comment threadactivitysim/abm/models/vehicle_type_choice.py
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/tables/vehicles.py
Comment threadactivitysim/abm/tables/vehicles.py
Comment threadactivitysim/abm/tables/vehicles.py
Comment threadactivitysim/examples/example_mtc/configs/free_parking.csv Outdated
Comment threadactivitysim/examples/example_mtc/configs/settings.yaml Outdated
@e-lo

e-lo commented Dec 8, 2021

Copy link
Copy Markdown
Collaborator

BTW I'll probably have more questions once I get the MTC example working on my local machine - i.e. is it annotating tours etc.

@jpn--
jpn-- requested a review from i-am-sijiaMay 5, 2022 13:53
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Car_8,.9541,0.0096,0.0355,0.0007,0.0000
Car_9,.9548,0.0037,0.0409,0.0004,0.0001
Car_10,0.9530,0.0015,0.0451,0.0003,0.0001
Car_11,0.9676,0.0096,0.0225,0.0003,0.0000

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems as though some amount of "smoothing" would make sense here between the years. Many of the numbers for the lower-probability options go back and forth between 0 and >0 several times.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, these probabilities are "lumpy". This is due to the fact that they came directly from the National Household Travel Survey data. A comment about the "lumpy-ness" was added to the models.rst vehicle type choice documentation encouraging the user to change the probabilities to their region and smooth them as they see fit. Additional links in the documentation point to the presented results and sensitivity studies.

So, I suggest we leave the probabilities as is in the context of this pull request for the purpose of simplicity and transparency.

config.config_file_path(vehicle_type_data_file), comment='#')
fleet_year = model_settings.get('FLEET_YEAR')

vehicle_type_data['age'] = (1 + fleet_year - vehicle_type_data['vehicle_year']).astype(str)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to make sense that we would be able to imply a variation in fuel type based on vehicle age. However, in this case age isn't necessarily relative. A 10 year old car in a 2030 scenario should be equal to a 2 year old car in 2022.

I'm trying to figure out how this is accommodated within the probabilities but can't seem to find anywhere that this is done?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this wasn't done very consistently... I changed the probabilities file to include this same calculation -- the probabilities file now includes body_type and vehicle_year columns just like the vehicle_type_data.csv file and age is explicitly calculated based on the user input fleet_year.

Comment threadactivitysim/abm/models/vehicle_allocation.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_allocation.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py
Comment threadactivitysim/abm/models/vehicle_type_choice.py
logger = logging.getLogger(__name__)


def get_combinatorial_vehicle_alternatives(alts_cats_dict, model_settings):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest adding a unit test for this function.

@dhensledhensleMay 24, 2022

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done. See the abm/test/test_misc/test_vehicle_type_alternatives.py script. Also cleaned up the function to remove model settings and make it better for a stand-alone unit test.

Comment threadactivitysim/abm/models/vehicle_type_choice.py
choosers=choosers,
alternatives=alts_wide,
spec=model_spec,
log_alt_losers=log_alt_losers,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something to consider more holistically in activitysim: most of these function calls seem to require 5-10 parameters.

Many best practices call for <= 3.

All the parameters which relate to run settings (e.g. chunk size, trace label, trace choice name) and not "substance" (e.g. alternatives, estimator, chooser) get in the way of legibility of what is happening.

Don't get me wrong - I love being explicit about things - but I would consider bundling some of these things in a config class that gets passed around or something similar.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is something we have been actively discussing as a consortium. I think making changes to this affect is outside the scope of this pull request though.

Comment threadactivitysim/abm/tables/vehicles.py Outdated
vehicles['vehicle_id'] = vehicles.household_id * 10 + vehicles.vehicle_num
vehicles.set_index('vehicle_id', inplace = True)

# I do not understand why this line is necessary, it seems circular

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should figure this out before merging

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the purpose of this line is to replace the "table" function with the dataframe. Added comment to reflect this just like in persons and households. This is just a consequence of how the inject table decorator and add_table functions were constructed.

@e-lo

e-lo commented May 13, 2022

Copy link
Copy Markdown
Collaborator

I'm getting a numpy comparison error when running test_mtc_extended.py (note that test_mtc.py seems to run just find)

Erroring at:

File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line286, inassign_variablesexpr_values=to_series(eval(expression, globals_dict, _locals_dict))
File"<string>", line1, in<module>FutureWarning: elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparison

Numpy version: v1.21

Note I scanned the code where it seems like somebody was trying to get this to just warn not error - but it doesn't seem to be working as run for some reason. I haven't troubleshot too much yet - thought I'd post in case it is a known issue.

Full Trace

---------------------------------------------------------------Capturedstdoutcall----------------------------------------------------------------ConfiguredloggingusingbasicConfigINFO:activitysim:ConfiguredloggingusingbasicConfigINFO-Readloggingconfigurationfrom: /Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/configs/logging.yamlINFO-SETTINGconfigs_dir: ['/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/test/configs', '/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/configs', '/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/configs']
INFO-SETTINGsettings_file_name: settings.yamlINFO-SETTINGdata_dir: ['/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data']
INFO-SETTINGoutput_dir: /Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/test/outputINFO-SETTINGhouseholds_sample_size: 10INFO-SETTINGchunk_size: 0INFO-SETTINGchunk_method: hybrid_ussINFO-SETTINGchunk_training_mode: disabledINFO-SETTINGmultiprocess: NoneINFO-SETTINGnum_processes: NoneINFO-SETTINGresume_after: NoneINFO-SETTINGtrace_hh_id: NoneINFO-ENVMKL_NUM_THREADS: NoneINFO-ENVOMP_NUM_THREADS: NoneINFO-ENVOPENBLAS_NUM_THREADS: NoneINFO-NUMPYblas_infolibraries: ['cblas', 'blas', 'cblas', 'blas']
INFO-NUMPYblas_opt_infolibraries: ['cblas', 'blas', 'cblas', 'blas']
INFO-NUMPYlapack_infolibraries: ['lapack', 'blas', 'lapack', 'blas']
INFO-NUMPYlapack_opt_infolibraries: ['lapack', 'blas', 'lapack', 'blas', 'cblas', 'blas', 'cblas', 'blas']
INFO-runsingleprocesssimulationINFO-Timetoexecuteopen_pipeline : 0.062seconds (0.0minutes)
INFO-preload_injectablesINFO-Timetoexecutepreload_injectables : 0.014seconds (0.0minutes)
INFO-#run_model running step initialize_landuseRunningstep'initialize_landuse'INFO-ReadingCSVfile/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/land_use.csvINFO-loadedland_use (25, 24)
INFO-initialize_landuse.annotate_tables-annotatingland_useSPECannotate_landuseINFO-Network_LOSusingskim_dict_factory: NumpyArraySkimFactoryINFO-allocate_skim_buffersharedFalsetazshape (826, 25, 25) totalsize: 2_065_000 (2.1MB)
INFO-_read_skims_from_omx/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/skims.omxINFO-_read_skims_from_omxloaded826skimsfrom/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/skims.omxINFO-writingskimcachetaz (826, 25, 25) to/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/test/output/cache/cached_taz.mmapINFO-load_skims_to_buffertazshape (826, 25, 25)
INFO-get_skim_datatazSkimDatashape (826, 25, 25)
INFO-SkimDictinittazINFO-SkimDict.build_3d_skim_block_offset_tableregistered1673dkeysTimetoexecutestep'initialize_landuse': 1.82sTotaltimetoexecuteiteration1withiterationvalueNone: 1.82sINFO-#run_model running step initialize_householdsRunningstep'initialize_households'INFO-ReadingCSVfile/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/households.csvINFO-fullhouseholdlistcontains5000householdsINFO-sampling10of5000householdsINFO-loadedhouseholds (10, 7)
INFO-ReadingCSVfile/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/persons.csvINFO-loadedpersons (28, 7)
INFO-initialize_households.annotate_tables-annotatingpersonsSPECannotate_personsINFO-initialize_households.annotate_tables-annotatinghouseholdsSPECannotate_householdsINFO-initialize_households.annotate_tables-annotatingpersonsSPECannotate_persons_after_hhTimetoexecutestep'initialize_households': 0.37sTotaltimetoexecuteiteration1withiterationvalueNone: 0.37sINFO-#run_model running step compute_accessibilityRunningstep'compute_accessibility'INFO-Runningcompute_accessibilitywith25origzones25destzonesINFO-compute_accessibilityRunningadaptive_chunked_chooserswith25choosersINFO-Runningchunk1of1with25of25choosersINFO-Runningcompute_accessibilitywith25origzones25destzonesINFO-compute_accessibilitycomputedaccessibilities (25, 10)
Timetoexecutestep'compute_accessibility': 0.06sTotaltimetoexecuteiteration1withiterationvalueNone: 0.06sINFO-#run_model running step school_locationRunningstep'school_location'INFO-Runningschool_location.i1.sample.universitywith4personsINFO-school_location.i1.sample.university.interaction_sampleRunningadaptive_chunked_chooserswith4choosersINFO-Runningchunk1of1with4of4choosersINFO-Runningeval_interaction_utilitieson24rowsINFO-Runningschool_location.i1.logsums.universitywith11rowsERROR-assign_variables-FutureWarning (elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparison) evaluating: np.where(sov_auto_op_cost.isna() | (sov_veh_option=='non_hh_veh'), costPerMile, sov_auto_op_cost)
numpy.core._exceptions._UFuncInputCastingError: Cannotcastufunc'equal'input1fromdtype('<U10') todtype('float64') withcastingrule'same_kind'Theaboveexceptionwasthedirectcauseofthefollowingexception:
Traceback (mostrecentcalllast):
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line286, inassign_variablesexpr_values=to_series(eval(expression, globals_dict, _locals_dict))
File"<string>", line1, in<module>FutureWarning: elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparisonINFO-Timetoexecuteallmodelsuntilthiserror : 2.814seconds (0.0minutes)
ERROR-activitysimrunencounteredanunrecoverableerrornumpy.core._exceptions._UFuncInputCastingError: Cannotcastufunc'equal'input1fromdtype('<U10') todtype('float64') withcastingrule'same_kind'Theaboveexceptionwasthedirectcauseofthefollowingexception:
Traceback (mostrecentcalllast):
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/cli/run.py", line260, inrunpipeline.run(models=config.setting('models'), resume_after=resume_after)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/pipeline.py", line617, inrunrun_model(model)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/pipeline.py", line476, inrun_modelorca.run([step_name])
File"/Users/elizabeth/opt/miniconda3/envs/asim/lib/python3.9/site-packages/orca/orca.py", line2168, inrunstep()
File"/Users/elizabeth/opt/miniconda3/envs/asim/lib/python3.9/site-packages/orca/orca.py", line973, in__call__returnself._func(**kwargs)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line920, inschool_locationiterate_location_choice(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line774, initerate_location_choicechoices_df, save_sample_df=run_location_choice(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line619, inrun_location_choicerun_location_logsums(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line438, inrun_location_logsumslogsums=logsum.compute_logsums(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/util/logsums.py", line142, incompute_logsumsexpressions.assign_columns(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/expressions.py", line124, inassign_columnsresults=compute_columns(df, model_settings, locals_dict, trace_label)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/expressions.py", line95, incompute_columns=assign.assign_variables(expressions_spec,
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line298, inassign_variablesraiseerrFile"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line286, inassign_variablesexpr_values=to_series(eval(expression, globals_dict, _locals_dict))
File"<string>", line1, in<module>FutureWarning: elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparison---------------------------------------------------------------Capturedstderrcall----------------------------------------------------------------numpy.core._exceptions._UFuncInputCastingError: Cannotcastufunc'equal'input1fromdtype('<U10') todtype('float64') withcastingrule'same_kind'Theaboveexceptionwasthedirectcauseofthefollowingexception:
Traceback (mostrecentcalllast):
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/test/simulation.py", line15, in<module>sys.exit(run(args))
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/cli/run.py", line260, inrunpipeline.run(models=config.setting('models'), resume_after=resume_after)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/pipeline.py", line617, inrunrun_model(model)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/pipeline.py", line476, inrun_modelorca.run([step_name])
File"/Users/elizabeth/opt/miniconda3/envs/asim/lib/python3.9/site-packages/orca/orca.py", line2168, inrunstep()
File"/Users/elizabeth/opt/miniconda3/envs/asim/lib/python3.9/site-packages/orca/orca.py", line973, in__call__returnself._func(**kwargs)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line920, inschool_locationiterate_location_choice(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line774, initerate_location_choicechoices_df, save_sample_df=run_location_choice(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line619, inrun_location_choicerun_location_logsums(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line438, inrun_location_logsumslogsums=logsum.compute_logsums(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/util/logsums.py", line142, incompute_logsumsexpressions.assign_columns(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/expressions.py", line124, inassign_columnsresults=compute_columns(df, model_settings, locals_dict, trace_label)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/expressions.py", line95, incompute_columns=assign.assign_variables(expressions_spec,
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line298, inassign_variablesraiseerrFile"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line286, inassign_variablesexpr_values=to_series(eval(expression, globals_dict, _locals_dict))
File"<string>", line1, in<module>FutureWarning: elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparison

Conda List

# packages in environment at /Users/elizabeth/opt/miniconda3/envs/asim:
#
# Name Version Build Channel
abseil-cpp 20210324.2 he49afe7_0 conda-forge
activitysim 1.0.3 dev_0 <develop>
appnope 0.1.3 pyhd8ed1ab_0 conda-forge
argon2-cffi 21.3.0 pyhd8ed1ab_0 conda-forge
argon2-cffi-bindings 21.2.0 py39h63b48b0_2 conda-forge
arrow-cpp 8.0.0 py39hfe23411_0_cpu conda-forge
asttokens 2.0.5 pyhd8ed1ab_0 conda-forge
attrs 21.4.0 pyhd8ed1ab_0 conda-forge
aws-c-cal 0.5.11 hd2e2f4b_0 conda-forge
aws-c-common 0.6.2 h0d85af4_0 conda-forge
aws-c-event-stream 0.2.7 hb9330a7_13 conda-forge
aws-c-io 0.10.5 h35aa462_0 conda-forge
aws-checksums 0.1.11 h0010a65_7 conda-forge
aws-sdk-cpp 1.8.186 h766a74d_3 conda-forge
backcall 0.2.0 pyh9f0ad1d_0 conda-forge
backports 1.0 py_2 conda-forge
backports.functools_lru_cache 1.6.4 pyhd8ed1ab_0 conda-forge
beautifulsoup4 4.11.1 pyha770c72_0 conda-forge
bleach 5.0.0 pyhd8ed1ab_0 conda-forge
blosc 1.21.1 h97e831e_2 conda-forge
boost-cpp 1.74.0 hdbf7018_7 conda-forge
branca 0.5.0 pyhd8ed1ab_0 conda-forge
brotli 1.0.9 h5eb16cf_7 conda-forge
brotli-bin 1.0.9 h5eb16cf_7 conda-forge
brotlipy 0.7.0 py39h63b48b0_1004 conda-forge
bump2version 1.0.1 pyh9f0ad1d_0 conda-forge
bzip2 1.0.8 h0d85af4_4 conda-forge
c-ares 1.18.1 h0d85af4_0 conda-forge
ca-certificates 2021.10.8 h033912b_0 conda-forge
cairo 1.16.0 h9e0e54b_1010 conda-forge
certifi 2021.10.8 py39h6e9494a_2 conda-forge
cffi 1.15.0 py39he338e87_0 conda-forge
cfitsio 4.1.0 h2c97ad1_0 conda-forge
charset-normalizer 2.0.12 pyhd8ed1ab_0 conda-forge
click 8.1.3 py39h6e9494a_0 conda-forge
click-plugins 1.1.1 py_0 conda-forge
cligj 0.7.2 pyhd8ed1ab_1 conda-forge
coverage 6.3.2 py39h63b48b0_2 conda-forge
coveralls 3.3.1 pyhd8ed1ab_0 conda-forge
cryptography 36.0.2 py39h1644bb1_1 conda-forge
curl 7.83.1 h372c54d_0 conda-forge
cycler 0.11.0 pyhd8ed1ab_0 conda-forge
cytoolz 0.11.2 py39h63b48b0_2 conda-forge
dbus 1.13.6 h811a1a6_3 conda-forge
debugpy 1.6.0 py39hfd1d529_0 conda-forge
decorator 5.1.1 pyhd8ed1ab_0 conda-forge
defusedxml 0.7.1 pyhd8ed1ab_0 conda-forge
descartes 1.1.0 py_4 conda-forge
docopt 0.6.2 py_1 conda-forge
entrypoints 0.4 pyhd8ed1ab_0 conda-forge
executing 0.8.3 pyhd8ed1ab_0 conda-forge
expat 2.4.8 h96cf925_0 conda-forge
fiona 1.8.21 py39h6d65ddd_1 conda-forge
flask 2.1.2 pyhd8ed1ab_1 conda-forge
flit-core 3.7.1 pyhd8ed1ab_0 conda-forge
folium 0.12.1.post1 pyhd8ed1ab_1 conda-forge
font-ttf-dejavu-sans-mono 2.37 hab24e00_0 conda-forge
font-ttf-inconsolata 3.000 h77eed37_0 conda-forge
font-ttf-source-code-pro 2.038 h77eed37_0 conda-forge
font-ttf-ubuntu 0.83 hab24e00_0 conda-forge
fontconfig 2.14.0 h676cef8_0 conda-forge
fonts-conda-ecosystem 1 0 conda-forge
fonts-conda-forge 1 0 conda-forge
fonttools 4.33.3 py39h701faf5_0 conda-forge
freetype 2.10.4 h4cff582_1 conda-forge
freexl 1.0.6 h0d85af4_0 conda-forge
gdal 3.4.2 py39h97b4846_7 conda-forge
geopandas 0.10.2 pyhd8ed1ab_1 conda-forge
geopandas-base 0.10.2 pyha770c72_1 conda-forge
geos 3.10.2 he49afe7_0 conda-forge
geotiff 1.7.1 had63758_1 conda-forge
gettext 0.19.8.1 hd1a6beb_1008 conda-forge
gflags 2.2.2 hb1e8313_1004 conda-forge
gh 2.10.1 h990441c_0 conda-forge
giflib 5.2.1 hbcb3906_2 conda-forge
git 2.35.3 pl5321h33a4a8a_0 conda-forge
glog 0.6.0 h8ac2a54_0 conda-forge
grpc-cpp 1.43.2 ha04666b_3 conda-forge
hdf4 4.2.15 hefd3b78_3 conda-forge
hdf5 1.12.1 nompi_ha60fbc9_104 conda-forge
icu 69.1 he49afe7_0 conda-forge
idna 3.3 pyhd8ed1ab_0 conda-forge
importlib-metadata 4.11.3 py39h6e9494a_1 conda-forge
importlib_resources 5.7.1 pyhd8ed1ab_0 conda-forge
iniconfig 1.1.1 pyh9f0ad1d_0 conda-forge
ipykernel 6.13.0 py39h71a6800_0 conda-forge
ipython 8.3.0 py39h6e9494a_0 conda-forge
ipython_genutils 0.2.0 py_1 conda-forge
ipywidgets 7.7.0 pyhd8ed1ab_0 conda-forge
itsdangerous 2.1.2 pyhd8ed1ab_0 conda-forge
jbig 2.1 h0d85af4_2003 conda-forge
jedi 0.18.1 py39h6e9494a_1 conda-forge
jinja2 3.1.2 pyhd8ed1ab_0 conda-forge
joblib 1.1.0 pyhd8ed1ab_0 conda-forge
jpeg 9e h5eb16cf_1 conda-forge
json-c 0.16 h01d06f9_0 conda-forge
jsonschema 4.5.1 pyhd8ed1ab_0 conda-forge
jupyter 1.0.0 py39h6e9494a_7 conda-forge
jupyter_client 7.3.1 pyhd8ed1ab_0 conda-forge
jupyter_console 6.4.3 pyhd8ed1ab_0 conda-forge
jupyter_core 4.10.0 py39h6e9494a_0 conda-forge
jupyterlab_pygments 0.2.2 pyhd8ed1ab_0 conda-forge
jupyterlab_widgets 1.1.0 pyhd8ed1ab_0 conda-forge
kealib 1.4.14 ha22a8b1_3 conda-forge
kiwisolver 1.4.2 py39h7248d28_1 conda-forge
krb5 1.19.3 hb49756b_0 conda-forge
lcms2 2.12 h577c468_0 conda-forge
lerc 3.0 he49afe7_0 conda-forge
libblas 3.9.0 14_osx64_openblas conda-forge
libbrotlicommon 1.0.9 h5eb16cf_7 conda-forge
libbrotlidec 1.0.9 h5eb16cf_7 conda-forge
libbrotlienc 1.0.9 h5eb16cf_7 conda-forge
libcblas 3.9.0 14_osx64_openblas conda-forge
libclang 13.0.1 default_he082bbe_0 conda-forge
libcrc32c 1.1.2 he49afe7_0 conda-forge
libcurl 7.83.1 h372c54d_0 conda-forge
libcxx 14.0.3 hc203e6f_0 conda-forge
libdap4 3.20.6 h3e144a0_2 conda-forge
libdeflate 1.10 h0d85af4_0 conda-forge
libedit 3.1.20191231 h0678c8f_2 conda-forge
libev 4.33 haf1e3a3_1 conda-forge
libevent 2.1.10 h815e4d9_4 conda-forge
libffi 3.4.2 h0d85af4_5 conda-forge
libgdal 3.4.2 h6474519_7 conda-forge
libgfortran 5.0.0 9_3_0_h6c81a4c_23 conda-forge
libgfortran5 9.3.0 h6c81a4c_23 conda-forge
libglib 2.70.2 hf1fb8c0_4 conda-forge
libgoogle-cloud 1.36.0 h52a585b_0 conda-forge
libiconv 1.16 haf1e3a3_0 conda-forge
libkml 1.3.0 h8fd9edb_1014 conda-forge
liblapack 3.9.0 14_osx64_openblas conda-forge
libllvm11 11.1.0 hd011deb_3 conda-forge
libllvm13 13.0.1 h64f94b2_2 conda-forge
libnetcdf 4.8.1 nompi_h6609ca0_102 conda-forge
libnghttp2 1.47.0 h942079c_0 conda-forge
libopenblas 0.3.20 openmp_hb3cd9ec_0 conda-forge
libpng 1.6.37 h7cec526_2 conda-forge
libpq 14.2 hea3049e_0 conda-forge
libprotobuf 3.19.4 hcf210ce_0 conda-forge
librttopo 1.1.0 hec60dd8_9 conda-forge
libsodium 1.0.18 hbcb3906_1 conda-forge
libspatialindex 1.9.3 he49afe7_4 conda-forge
libspatialite 5.0.1 hadde3e2_15 conda-forge
libssh2 1.10.0 h52ee1ee_2 conda-forge
libthrift 0.16.0 h9702cd6_1 conda-forge
libtiff 4.3.0 h17f2ce3_3 conda-forge
libutf8proc 2.7.0 h0d85af4_0 conda-forge
libwebp 1.2.2 h28dabe5_0 conda-forge
libwebp-base 1.2.2 h0d85af4_1 conda-forge
libxcb 1.13 h0d85af4_1004 conda-forge
libxml2 2.9.12 h7e28ab6_1 conda-forge
libzip 1.8.0 h8b0c345_1 conda-forge
libzlib 1.2.11 h6c3fc93_1014 conda-forge
llvm-openmp 14.0.3 ha654fa7_0 conda-forge
llvmlite 0.38.0 py39ha9d9895_1 conda-forge
lz4-c 1.9.3 he49afe7_1 conda-forge
mapclassify 2.4.3 pyhd8ed1ab_0 conda-forge
markupsafe 2.1.1 py39h63b48b0_1 conda-forge
matplotlib 3.5.2 py39h6e9494a_0 conda-forge
matplotlib-base 3.5.2 py39h64a0072_0 conda-forge
matplotlib-inline 0.1.3 pyhd8ed1ab_0 conda-forge
mistune 0.8.4 py39h89e85a6_1005 conda-forge
munch 2.5.0 py_0 conda-forge
munkres 1.1.4 pyh9f0ad1d_0 conda-forge
mysql-common 8.0.29 h924029e_0 conda-forge
mysql-libs 8.0.29 h3cab752_0 conda-forge
nbclient 0.6.3 pyhd8ed1ab_0 conda-forge
nbconvert 6.5.0 pyhd8ed1ab_0 conda-forge
nbconvert-core 6.5.0 pyhd8ed1ab_0 conda-forge
nbconvert-pandoc 6.5.0 pyhd8ed1ab_0 conda-forge
nbformat 5.4.0 pyhd8ed1ab_0 conda-forge
ncurses 6.3 h96cf925_1 conda-forge
nest-asyncio 1.5.5 pyhd8ed1ab_0 conda-forge
networkx 2.8 pyhd8ed1ab_0 conda-forge
notebook 6.4.11 pyha770c72_0 conda-forge
nspr 4.32 hcd9eead_1 conda-forge
nss 3.77 hfce436b_0 conda-forge
numba 0.55.1 py39hc37845d_1 conda-forge
numexpr 2.8.0 py39hbd61c47_2 conda-forge
numpy 1.21.6 py39hf56e92f_0 conda-forge
openjpeg 2.4.0 h6e7aa92_1 conda-forge
openmatrix 0.3.5.0 pyhd8ed1ab_0 conda-forge
openssl 1.1.1o hfe4f2af_0 conda-forge
orc 1.7.3 h84518c8_0 conda-forge
orca 1.6 pyhd8ed1ab_0 conda-forge
packaging 21.3 pyhd8ed1ab_0 conda-forge
pandas 1.4.2 py39hbd61c47_1 conda-forge
pandoc 2.18 h694c41f_0 conda-forge
pandocfilters 1.5.0 pyhd8ed1ab_0 conda-forge
parquet-cpp 1.5.1 2 conda-forge
parso 0.8.3 pyhd8ed1ab_0 conda-forge
pcre 8.45 he49afe7_0 conda-forge
pcre2 10.37 ha16e1b2_0 conda-forge
perl 5.32.1 2_h0d85af4_perl5 conda-forge
pexpect 4.8.0 pyh9f0ad1d_2 conda-forge
pickleshare 0.7.5 py_1003 conda-forge
pillow 9.1.0 py39hd2c7aa1_2 conda-forge
pip 22.1 pyhd8ed1ab_0 conda-forge
pixman 0.40.0 hbcb3906_0 conda-forge
pluggy 1.0.0 py39h6e9494a_3 conda-forge
poppler 22.04.0 h39497b0_0 conda-forge
poppler-data 0.4.11 hd8ed1ab_0 conda-forge
postgresql 14.2 he8fe76e_0 conda-forge
proj 9.0.0 h2364a93_1 conda-forge
prometheus_client 0.14.1 pyhd8ed1ab_0 conda-forge
prompt-toolkit 3.0.29 pyha770c72_0 conda-forge
prompt_toolkit 3.0.29 hd8ed1ab_0 conda-forge
psutil 5.9.0 py39h63b48b0_1 conda-forge
pthread-stubs 0.4 hc929b4f_1001 conda-forge
ptyprocess 0.7.0 pyhd3deb0d_0 conda-forge
pure_eval 0.2.2 pyhd8ed1ab_0 conda-forge
py 1.11.0 pyh6c4a22f_0 conda-forge
pyarrow 8.0.0 py39hb9688c1_0_cpu conda-forge
pycodestyle 2.8.0 pyhd8ed1ab_0 conda-forge
pycparser 2.21 pyhd8ed1ab_0 conda-forge
pygments 2.12.0 pyhd8ed1ab_0 conda-forge
pyopenssl 22.0.0 pyhd8ed1ab_0 conda-forge
pyparsing 3.0.9 pyhd8ed1ab_0 conda-forge
pyproj 3.3.1 py39hfe197cf_0 conda-forge
pyqt 5.12.3 py39h9d385e7_4 conda-forge
pyqt5-sip 4.19.18 pypi_0 pypi
pyqtchart 5.12 pypi_0 pypi
pyqtwebengine 5.12.1 pypi_0 pypi
pyrsistent 0.18.1 py39h63b48b0_1 conda-forge
pysocks 1.7.1 py39h6e9494a_5 conda-forge
pytest 7.1.2 py39h6e9494a_0 conda-forge
pytest-cov 3.0.0 pyhd8ed1ab_0 conda-forge
pytest-datadir 1.3.1 py_0 conda-forge
pytest-regressions 2.3.1 pyhd8ed1ab_0 conda-forge
python 3.9.12 h8b4d769_1_cpython conda-forge
python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge
python-fastjsonschema 2.15.3 pyhd8ed1ab_0 conda-forge
python_abi 3.9 2_cp39 conda-forge
pytz 2022.1 pyhd8ed1ab_0 conda-forge
pyyaml 6.0 py39h63b48b0_4 conda-forge
pyzmq 22.3.0 py39hc2dc7ec_2 conda-forge
qt 5.12.9 h2a607e2_5 conda-forge
qtconsole 5.3.0 pyhd8ed1ab_0 conda-forge
qtconsole-base 5.3.0 pyhd8ed1ab_0 conda-forge
qtpy 2.1.0 pyhd8ed1ab_0 conda-forge
re2 2022.02.01 he49afe7_0 conda-forge
readline 8.1 h05e3726_0 conda-forge
requests 2.27.1 pyhd8ed1ab_0 conda-forge
rtree 1.0.0 py39h7d0d40a_1 conda-forge
scikit-learn 1.0.2 py39hd4eea88_0 conda-forge
scipy 1.8.0 py39h056f1c0_1 conda-forge
send2trash 1.8.0 pyhd8ed1ab_0 conda-forge
setuptools 62.2.0 py39h6e9494a_0 conda-forge
shapely 1.8.2 py39hd471b09_1 conda-forge
six 1.16.0 pyh6c4a22f_0 conda-forge
snappy 1.1.9 h6e38e02_0 conda-forge
soupsieve 2.3.1 pyhd8ed1ab_0 conda-forge
sqlite 3.38.5 hd9f0692_0 conda-forge
stack_data 0.2.0 pyhd8ed1ab_0 conda-forge
tables 3.6.1 pypi_0 pypi
terminado 0.13.3 py39h6e9494a_1 conda-forge
threadpoolctl 3.1.0 pyh8a188c0_0 conda-forge
tiledb 2.8.2 hf17dc58_0 conda-forge
tinycss2 1.1.1 pyhd8ed1ab_0 conda-forge
tk 8.6.12 h5dbffcc_0 conda-forge
toml 0.10.2 pyhd8ed1ab_0 conda-forge
tomli 2.0.1 pyhd8ed1ab_0 conda-forge
toolz 0.11.2 pyhd8ed1ab_0 conda-forge
tornado 6.1 py39h63b48b0_3 conda-forge
traitlets 5.2.0 pyhd8ed1ab_0 conda-forge
tzcode 2022a h5eb16cf_0 conda-forge
tzdata 2022a h191b570_0 conda-forge
unicodedata2 14.0.0 py39h63b48b0_1 conda-forge
urllib3 1.26.9 pyhd8ed1ab_0 conda-forge
wcwidth 0.2.5 pyh9f0ad1d_2 conda-forge
webencodings 0.5.1 py_1 conda-forge
werkzeug 2.1.2 pyhd8ed1ab_1 conda-forge
wheel 0.37.1 pyhd8ed1ab_0 conda-forge
widgetsnbextension 3.6.0 py39h6e9494a_0 conda-forge
xerces-c 3.2.3 h6564042_4 conda-forge
xorg-libxau 1.0.9 h35c211d_0 conda-forge
xorg-libxdmcp 1.1.3 h35c211d_0 conda-forge
xyzservices 2022.4.0 pyhd8ed1ab_0 conda-forge
xz 5.2.5 haf1e3a3_1 conda-forge
yaml 0.2.5 h0d85af4_2 conda-forge
zeromq 4.3.4 he49afe7_1 conda-forge
zipp 3.8.0 pyhd8ed1ab_0 conda-forge
zlib 1.2.11 h6c3fc93_1014 conda-forge
zstd 1.5.2 h582d3a0_0 conda-forge

@dhensle

Copy link
Copy Markdown
Contributor

I'm getting a numpy comparison error when running test_mtc_extended.py (note that test_mtc.py seems to run just find)

Sorry about that, the setup I had was pointing to some other configs. This test should be passing now.

@dhensle

Copy link
Copy Markdown
Contributor

@e-lo I believe I have addressed all of your comments. I left a couple conversations open for you to sign off on. Thanks for your helpful comments and please let me know if there's anything else I missed.

Comment threadactivitysim/examples/example_mtc/configs/annotate_households.csv Outdated
@jfdman

Copy link
Copy Markdown

Have all comments been addressed? Please advise, we have several regions waiting to pull this model into their implementation. Thanks!

@guyrousseau

Copy link
Copy Markdown

@jfdman Since all vehicle make/model coding for the NHTS (since inception) maps to NHTSA’s FARS vehicle make/mode coding scheme [https://www.nhtsa.gov/research-data/fatality-analysis-reporting-system-fars], can you confirm that our vehicle type model conforms with NHTSA’s FARS?

@i-am-sijia

i-am-sijia commented Jun 6, 2022

Copy link
Copy Markdown
Member

Have all comments been addressed? Please advise, we have several regions waiting to pull this model into their implementation. Thanks!

Confirmed all previous comments are addressed. Guy's question is the only one left. Thanks.

@jpn--
jpn-- merged commit 367cbac into ActivitySim:developJun 6, 2022
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FeatureNew feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

create vehicle type model and add vehicle table to pipeline

10 participants

@mxndrwgrdnr@bstabler@coveralls@e-lo@dhensle@jfdman@guyrousseau@i-am-sijia@toliwaga@jpn--
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

🚀 [feat] vehicle type model - #486

Merged
jpn-- merged 44 commits into
ActivitySim:developfrom
mxndrwgrdnr:vehicle
Jun 6, 2022
Merged

🚀 [feat] vehicle type model#486
jpn-- merged 44 commits into
ActivitySim:developfrom
mxndrwgrdnr:vehicle

Conversation

@mxndrwgrdnr

@mxndrwgrdnrmxndrwgrdnr commented Sep 21, 2021

Copy link
Copy Markdown
Contributor

User Story

As a planner, I would like to understand the effects of vehicle type choice on travel behavior in order to support more detailed emissions analysis and more refined travel costs.

Requirements

Per https://github.com/ActivitySim/activitysim/wiki/Phase-6b-Scope-of-Work#task-2-vehicle-type-model

After applying this submodel, household vehicles should have the following properties:

  • vehicle type (e.g. auto, light-truck, etc)
  • capacity (# of people it can carry)
  • power train (ICE, hybrid, phev, etc)
  • range
  • age

In addition, each auto tour should be assigned the most likely household vehicles based on:

  • household
  • tour-characteristics
  • household vehicle attributes

*Note: For this task, vehicle allocation to auto tours should not consider the availability of each individual vehicles. *

The implementation should have the following usability features:

  • ability to read an input vehicle table, as opposed to create one during a model run, an initialize_vehicles submodel will be added that can read a vehicle table from CSV file, annotate it with custom expressions, ensure table keys are consistent with household IDs, and add it to the pipeline.
  • detailed technical documentation of all vehicle type and allocation models or methods.
  • updated users guide
  • tests covering the new methods
  • examples covering new methods

Approach

Model Estimation

  • estimate vehicle type model based on 5,000 household Bay Area TNC survey data
  • run the submodel with the existing example model
  • reasonably verify goodness-of-fit across key dimensions such as:
    • socio-demographics and
    • geography

Implementation

  • integrate method into the ActivitySim run stream.
  • develop method for allocating household-generated VMT to household vehicles
  • sensitivity tests

Issues

Fixes#438

@mxndrwgrdnr
mxndrwgrdnr marked this pull request as draft September 21, 2021 05:24
@bstabler

Copy link
Copy Markdown
Contributor

#438

@coveralls

coveralls commented Sep 21, 2021

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.5%) to 53.603% when pulling d556239 on mxndrwgrdnr:vehicle into 91930b5 on ActivitySim:develop.

@bstabler

Copy link
Copy Markdown
Contributor

@mxndrwgrdnr - can you adjust this PR to merge to develop? Thanks.

@mxndrwgrdnr
mxndrwgrdnr changed the base branch from master to developNovember 9, 2021 00:05
@mxndrwgrdnr
mxndrwgrdnr marked this pull request as ready for review November 12, 2021 22:52
@e-loe-lo added the Feature New feature or request label Dec 7, 2021
@e-loe-lo changed the title vehicle type model🚀 [feat] vehicle type modelDec 7, 2021
@e-loe-lo linked an issue Dec 7, 2021 that may be closed by this pull request

@e-loe-lo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally I found the code easy to read and it flowed well. There is a general lack of documentation including:

  • docstrings appropriately formatted for autodoc-ing
  • typehints
  • origin of model coefficients, what estimation are they from, etc
  • general documentation about capabilities
  • intra-activity sim links to documentation about general activitysim "things" (i.e. various formats, etc)

There is also a lack of tests for the specific unit of the vehicle type choice.

I also found it odd when running the MTC test example locally, that it didn't pick up the config? I suspect I'm doing something wrong but if I'm doing it wrong others might too (maybe?)

Comment threadactivitysim/abm/models/vehicle_type_choice.py
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/tables/vehicles.py
Comment threadactivitysim/abm/tables/vehicles.py
Comment threadactivitysim/abm/tables/vehicles.py
Comment threadactivitysim/examples/example_mtc/configs/free_parking.csv Outdated
Comment threadactivitysim/examples/example_mtc/configs/settings.yaml Outdated
@e-lo

e-lo commented Dec 8, 2021

Copy link
Copy Markdown
Collaborator

BTW I'll probably have more questions once I get the MTC example working on my local machine - i.e. is it annotating tours etc.

@jpn--
jpn-- requested a review from i-am-sijiaMay 5, 2022 13:53
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Car_8,.9541,0.0096,0.0355,0.0007,0.0000
Car_9,.9548,0.0037,0.0409,0.0004,0.0001
Car_10,0.9530,0.0015,0.0451,0.0003,0.0001
Car_11,0.9676,0.0096,0.0225,0.0003,0.0000

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems as though some amount of "smoothing" would make sense here between the years. Many of the numbers for the lower-probability options go back and forth between 0 and >0 several times.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, these probabilities are "lumpy". This is due to the fact that they came directly from the National Household Travel Survey data. A comment about the "lumpy-ness" was added to the models.rst vehicle type choice documentation encouraging the user to change the probabilities to their region and smooth them as they see fit. Additional links in the documentation point to the presented results and sensitivity studies.

So, I suggest we leave the probabilities as is in the context of this pull request for the purpose of simplicity and transparency.

config.config_file_path(vehicle_type_data_file), comment='#')
fleet_year = model_settings.get('FLEET_YEAR')

vehicle_type_data['age'] = (1 + fleet_year - vehicle_type_data['vehicle_year']).astype(str)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to make sense that we would be able to imply a variation in fuel type based on vehicle age. However, in this case age isn't necessarily relative. A 10 year old car in a 2030 scenario should be equal to a 2 year old car in 2022.

I'm trying to figure out how this is accommodated within the probabilities but can't seem to find anywhere that this is done?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this wasn't done very consistently... I changed the probabilities file to include this same calculation -- the probabilities file now includes body_type and vehicle_year columns just like the vehicle_type_data.csv file and age is explicitly calculated based on the user input fleet_year.

Comment threadactivitysim/abm/models/vehicle_allocation.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_allocation.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py
Comment threadactivitysim/abm/models/vehicle_type_choice.py
logger = logging.getLogger(__name__)


def get_combinatorial_vehicle_alternatives(alts_cats_dict, model_settings):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest adding a unit test for this function.

@dhensledhensleMay 24, 2022

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done. See the abm/test/test_misc/test_vehicle_type_alternatives.py script. Also cleaned up the function to remove model settings and make it better for a stand-alone unit test.

Comment threadactivitysim/abm/models/vehicle_type_choice.py
choosers=choosers,
alternatives=alts_wide,
spec=model_spec,
log_alt_losers=log_alt_losers,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something to consider more holistically in activitysim: most of these function calls seem to require 5-10 parameters.

Many best practices call for <= 3.

All the parameters which relate to run settings (e.g. chunk size, trace label, trace choice name) and not "substance" (e.g. alternatives, estimator, chooser) get in the way of legibility of what is happening.

Don't get me wrong - I love being explicit about things - but I would consider bundling some of these things in a config class that gets passed around or something similar.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is something we have been actively discussing as a consortium. I think making changes to this affect is outside the scope of this pull request though.

Comment threadactivitysim/abm/tables/vehicles.py Outdated
vehicles['vehicle_id'] = vehicles.household_id * 10 + vehicles.vehicle_num
vehicles.set_index('vehicle_id', inplace = True)

# I do not understand why this line is necessary, it seems circular

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should figure this out before merging

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the purpose of this line is to replace the "table" function with the dataframe. Added comment to reflect this just like in persons and households. This is just a consequence of how the inject table decorator and add_table functions were constructed.

@e-lo

e-lo commented May 13, 2022

Copy link
Copy Markdown
Collaborator

I'm getting a numpy comparison error when running test_mtc_extended.py (note that test_mtc.py seems to run just find)

Erroring at:

File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line286, inassign_variablesexpr_values=to_series(eval(expression, globals_dict, _locals_dict))
File"<string>", line1, in<module>FutureWarning: elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparison

Numpy version: v1.21

Note I scanned the code where it seems like somebody was trying to get this to just warn not error - but it doesn't seem to be working as run for some reason. I haven't troubleshot too much yet - thought I'd post in case it is a known issue.

Full Trace

---------------------------------------------------------------Capturedstdoutcall----------------------------------------------------------------ConfiguredloggingusingbasicConfigINFO:activitysim:ConfiguredloggingusingbasicConfigINFO-Readloggingconfigurationfrom: /Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/configs/logging.yamlINFO-SETTINGconfigs_dir: ['/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/test/configs', '/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/configs', '/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/configs']
INFO-SETTINGsettings_file_name: settings.yamlINFO-SETTINGdata_dir: ['/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data']
INFO-SETTINGoutput_dir: /Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/test/outputINFO-SETTINGhouseholds_sample_size: 10INFO-SETTINGchunk_size: 0INFO-SETTINGchunk_method: hybrid_ussINFO-SETTINGchunk_training_mode: disabledINFO-SETTINGmultiprocess: NoneINFO-SETTINGnum_processes: NoneINFO-SETTINGresume_after: NoneINFO-SETTINGtrace_hh_id: NoneINFO-ENVMKL_NUM_THREADS: NoneINFO-ENVOMP_NUM_THREADS: NoneINFO-ENVOPENBLAS_NUM_THREADS: NoneINFO-NUMPYblas_infolibraries: ['cblas', 'blas', 'cblas', 'blas']
INFO-NUMPYblas_opt_infolibraries: ['cblas', 'blas', 'cblas', 'blas']
INFO-NUMPYlapack_infolibraries: ['lapack', 'blas', 'lapack', 'blas']
INFO-NUMPYlapack_opt_infolibraries: ['lapack', 'blas', 'lapack', 'blas', 'cblas', 'blas', 'cblas', 'blas']
INFO-runsingleprocesssimulationINFO-Timetoexecuteopen_pipeline : 0.062seconds (0.0minutes)
INFO-preload_injectablesINFO-Timetoexecutepreload_injectables : 0.014seconds (0.0minutes)
INFO-#run_model running step initialize_landuseRunningstep'initialize_landuse'INFO-ReadingCSVfile/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/land_use.csvINFO-loadedland_use (25, 24)
INFO-initialize_landuse.annotate_tables-annotatingland_useSPECannotate_landuseINFO-Network_LOSusingskim_dict_factory: NumpyArraySkimFactoryINFO-allocate_skim_buffersharedFalsetazshape (826, 25, 25) totalsize: 2_065_000 (2.1MB)
INFO-_read_skims_from_omx/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/skims.omxINFO-_read_skims_from_omxloaded826skimsfrom/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/skims.omxINFO-writingskimcachetaz (826, 25, 25) to/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/test/output/cache/cached_taz.mmapINFO-load_skims_to_buffertazshape (826, 25, 25)
INFO-get_skim_datatazSkimDatashape (826, 25, 25)
INFO-SkimDictinittazINFO-SkimDict.build_3d_skim_block_offset_tableregistered1673dkeysTimetoexecutestep'initialize_landuse': 1.82sTotaltimetoexecuteiteration1withiterationvalueNone: 1.82sINFO-#run_model running step initialize_householdsRunningstep'initialize_households'INFO-ReadingCSVfile/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/households.csvINFO-fullhouseholdlistcontains5000householdsINFO-sampling10of5000householdsINFO-loadedhouseholds (10, 7)
INFO-ReadingCSVfile/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/persons.csvINFO-loadedpersons (28, 7)
INFO-initialize_households.annotate_tables-annotatingpersonsSPECannotate_personsINFO-initialize_households.annotate_tables-annotatinghouseholdsSPECannotate_householdsINFO-initialize_households.annotate_tables-annotatingpersonsSPECannotate_persons_after_hhTimetoexecutestep'initialize_households': 0.37sTotaltimetoexecuteiteration1withiterationvalueNone: 0.37sINFO-#run_model running step compute_accessibilityRunningstep'compute_accessibility'INFO-Runningcompute_accessibilitywith25origzones25destzonesINFO-compute_accessibilityRunningadaptive_chunked_chooserswith25choosersINFO-Runningchunk1of1with25of25choosersINFO-Runningcompute_accessibilitywith25origzones25destzonesINFO-compute_accessibilitycomputedaccessibilities (25, 10)
Timetoexecutestep'compute_accessibility': 0.06sTotaltimetoexecuteiteration1withiterationvalueNone: 0.06sINFO-#run_model running step school_locationRunningstep'school_location'INFO-Runningschool_location.i1.sample.universitywith4personsINFO-school_location.i1.sample.university.interaction_sampleRunningadaptive_chunked_chooserswith4choosersINFO-Runningchunk1of1with4of4choosersINFO-Runningeval_interaction_utilitieson24rowsINFO-Runningschool_location.i1.logsums.universitywith11rowsERROR-assign_variables-FutureWarning (elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparison) evaluating: np.where(sov_auto_op_cost.isna() | (sov_veh_option=='non_hh_veh'), costPerMile, sov_auto_op_cost)
numpy.core._exceptions._UFuncInputCastingError: Cannotcastufunc'equal'input1fromdtype('<U10') todtype('float64') withcastingrule'same_kind'Theaboveexceptionwasthedirectcauseofthefollowingexception:
Traceback (mostrecentcalllast):
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line286, inassign_variablesexpr_values=to_series(eval(expression, globals_dict, _locals_dict))
File"<string>", line1, in<module>FutureWarning: elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparisonINFO-Timetoexecuteallmodelsuntilthiserror : 2.814seconds (0.0minutes)
ERROR-activitysimrunencounteredanunrecoverableerrornumpy.core._exceptions._UFuncInputCastingError: Cannotcastufunc'equal'input1fromdtype('<U10') todtype('float64') withcastingrule'same_kind'Theaboveexceptionwasthedirectcauseofthefollowingexception:
Traceback (mostrecentcalllast):
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/cli/run.py", line260, inrunpipeline.run(models=config.setting('models'), resume_after=resume_after)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/pipeline.py", line617, inrunrun_model(model)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/pipeline.py", line476, inrun_modelorca.run([step_name])
File"/Users/elizabeth/opt/miniconda3/envs/asim/lib/python3.9/site-packages/orca/orca.py", line2168, inrunstep()
File"/Users/elizabeth/opt/miniconda3/envs/asim/lib/python3.9/site-packages/orca/orca.py", line973, in__call__returnself._func(**kwargs)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line920, inschool_locationiterate_location_choice(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line774, initerate_location_choicechoices_df, save_sample_df=run_location_choice(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line619, inrun_location_choicerun_location_logsums(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line438, inrun_location_logsumslogsums=logsum.compute_logsums(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/util/logsums.py", line142, incompute_logsumsexpressions.assign_columns(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/expressions.py", line124, inassign_columnsresults=compute_columns(df, model_settings, locals_dict, trace_label)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/expressions.py", line95, incompute_columns=assign.assign_variables(expressions_spec,
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line298, inassign_variablesraiseerrFile"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line286, inassign_variablesexpr_values=to_series(eval(expression, globals_dict, _locals_dict))
File"<string>", line1, in<module>FutureWarning: elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparison---------------------------------------------------------------Capturedstderrcall----------------------------------------------------------------numpy.core._exceptions._UFuncInputCastingError: Cannotcastufunc'equal'input1fromdtype('<U10') todtype('float64') withcastingrule'same_kind'Theaboveexceptionwasthedirectcauseofthefollowingexception:
Traceback (mostrecentcalllast):
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/test/simulation.py", line15, in<module>sys.exit(run(args))
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/cli/run.py", line260, inrunpipeline.run(models=config.setting('models'), resume_after=resume_after)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/pipeline.py", line617, inrunrun_model(model)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/pipeline.py", line476, inrun_modelorca.run([step_name])
File"/Users/elizabeth/opt/miniconda3/envs/asim/lib/python3.9/site-packages/orca/orca.py", line2168, inrunstep()
File"/Users/elizabeth/opt/miniconda3/envs/asim/lib/python3.9/site-packages/orca/orca.py", line973, in__call__returnself._func(**kwargs)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line920, inschool_locationiterate_location_choice(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line774, initerate_location_choicechoices_df, save_sample_df=run_location_choice(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line619, inrun_location_choicerun_location_logsums(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line438, inrun_location_logsumslogsums=logsum.compute_logsums(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/util/logsums.py", line142, incompute_logsumsexpressions.assign_columns(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/expressions.py", line124, inassign_columnsresults=compute_columns(df, model_settings, locals_dict, trace_label)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/expressions.py", line95, incompute_columns=assign.assign_variables(expressions_spec,
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line298, inassign_variablesraiseerrFile"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line286, inassign_variablesexpr_values=to_series(eval(expression, globals_dict, _locals_dict))
File"<string>", line1, in<module>FutureWarning: elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparison

Conda List

# packages in environment at /Users/elizabeth/opt/miniconda3/envs/asim:
#
# Name Version Build Channel
abseil-cpp 20210324.2 he49afe7_0 conda-forge
activitysim 1.0.3 dev_0 <develop>
appnope 0.1.3 pyhd8ed1ab_0 conda-forge
argon2-cffi 21.3.0 pyhd8ed1ab_0 conda-forge
argon2-cffi-bindings 21.2.0 py39h63b48b0_2 conda-forge
arrow-cpp 8.0.0 py39hfe23411_0_cpu conda-forge
asttokens 2.0.5 pyhd8ed1ab_0 conda-forge
attrs 21.4.0 pyhd8ed1ab_0 conda-forge
aws-c-cal 0.5.11 hd2e2f4b_0 conda-forge
aws-c-common 0.6.2 h0d85af4_0 conda-forge
aws-c-event-stream 0.2.7 hb9330a7_13 conda-forge
aws-c-io 0.10.5 h35aa462_0 conda-forge
aws-checksums 0.1.11 h0010a65_7 conda-forge
aws-sdk-cpp 1.8.186 h766a74d_3 conda-forge
backcall 0.2.0 pyh9f0ad1d_0 conda-forge
backports 1.0 py_2 conda-forge
backports.functools_lru_cache 1.6.4 pyhd8ed1ab_0 conda-forge
beautifulsoup4 4.11.1 pyha770c72_0 conda-forge
bleach 5.0.0 pyhd8ed1ab_0 conda-forge
blosc 1.21.1 h97e831e_2 conda-forge
boost-cpp 1.74.0 hdbf7018_7 conda-forge
branca 0.5.0 pyhd8ed1ab_0 conda-forge
brotli 1.0.9 h5eb16cf_7 conda-forge
brotli-bin 1.0.9 h5eb16cf_7 conda-forge
brotlipy 0.7.0 py39h63b48b0_1004 conda-forge
bump2version 1.0.1 pyh9f0ad1d_0 conda-forge
bzip2 1.0.8 h0d85af4_4 conda-forge
c-ares 1.18.1 h0d85af4_0 conda-forge
ca-certificates 2021.10.8 h033912b_0 conda-forge
cairo 1.16.0 h9e0e54b_1010 conda-forge
certifi 2021.10.8 py39h6e9494a_2 conda-forge
cffi 1.15.0 py39he338e87_0 conda-forge
cfitsio 4.1.0 h2c97ad1_0 conda-forge
charset-normalizer 2.0.12 pyhd8ed1ab_0 conda-forge
click 8.1.3 py39h6e9494a_0 conda-forge
click-plugins 1.1.1 py_0 conda-forge
cligj 0.7.2 pyhd8ed1ab_1 conda-forge
coverage 6.3.2 py39h63b48b0_2 conda-forge
coveralls 3.3.1 pyhd8ed1ab_0 conda-forge
cryptography 36.0.2 py39h1644bb1_1 conda-forge
curl 7.83.1 h372c54d_0 conda-forge
cycler 0.11.0 pyhd8ed1ab_0 conda-forge
cytoolz 0.11.2 py39h63b48b0_2 conda-forge
dbus 1.13.6 h811a1a6_3 conda-forge
debugpy 1.6.0 py39hfd1d529_0 conda-forge
decorator 5.1.1 pyhd8ed1ab_0 conda-forge
defusedxml 0.7.1 pyhd8ed1ab_0 conda-forge
descartes 1.1.0 py_4 conda-forge
docopt 0.6.2 py_1 conda-forge
entrypoints 0.4 pyhd8ed1ab_0 conda-forge
executing 0.8.3 pyhd8ed1ab_0 conda-forge
expat 2.4.8 h96cf925_0 conda-forge
fiona 1.8.21 py39h6d65ddd_1 conda-forge
flask 2.1.2 pyhd8ed1ab_1 conda-forge
flit-core 3.7.1 pyhd8ed1ab_0 conda-forge
folium 0.12.1.post1 pyhd8ed1ab_1 conda-forge
font-ttf-dejavu-sans-mono 2.37 hab24e00_0 conda-forge
font-ttf-inconsolata 3.000 h77eed37_0 conda-forge
font-ttf-source-code-pro 2.038 h77eed37_0 conda-forge
font-ttf-ubuntu 0.83 hab24e00_0 conda-forge
fontconfig 2.14.0 h676cef8_0 conda-forge
fonts-conda-ecosystem 1 0 conda-forge
fonts-conda-forge 1 0 conda-forge
fonttools 4.33.3 py39h701faf5_0 conda-forge
freetype 2.10.4 h4cff582_1 conda-forge
freexl 1.0.6 h0d85af4_0 conda-forge
gdal 3.4.2 py39h97b4846_7 conda-forge
geopandas 0.10.2 pyhd8ed1ab_1 conda-forge
geopandas-base 0.10.2 pyha770c72_1 conda-forge
geos 3.10.2 he49afe7_0 conda-forge
geotiff 1.7.1 had63758_1 conda-forge
gettext 0.19.8.1 hd1a6beb_1008 conda-forge
gflags 2.2.2 hb1e8313_1004 conda-forge
gh 2.10.1 h990441c_0 conda-forge
giflib 5.2.1 hbcb3906_2 conda-forge
git 2.35.3 pl5321h33a4a8a_0 conda-forge
glog 0.6.0 h8ac2a54_0 conda-forge
grpc-cpp 1.43.2 ha04666b_3 conda-forge
hdf4 4.2.15 hefd3b78_3 conda-forge
hdf5 1.12.1 nompi_ha60fbc9_104 conda-forge
icu 69.1 he49afe7_0 conda-forge
idna 3.3 pyhd8ed1ab_0 conda-forge
importlib-metadata 4.11.3 py39h6e9494a_1 conda-forge
importlib_resources 5.7.1 pyhd8ed1ab_0 conda-forge
iniconfig 1.1.1 pyh9f0ad1d_0 conda-forge
ipykernel 6.13.0 py39h71a6800_0 conda-forge
ipython 8.3.0 py39h6e9494a_0 conda-forge
ipython_genutils 0.2.0 py_1 conda-forge
ipywidgets 7.7.0 pyhd8ed1ab_0 conda-forge
itsdangerous 2.1.2 pyhd8ed1ab_0 conda-forge
jbig 2.1 h0d85af4_2003 conda-forge
jedi 0.18.1 py39h6e9494a_1 conda-forge
jinja2 3.1.2 pyhd8ed1ab_0 conda-forge
joblib 1.1.0 pyhd8ed1ab_0 conda-forge
jpeg 9e h5eb16cf_1 conda-forge
json-c 0.16 h01d06f9_0 conda-forge
jsonschema 4.5.1 pyhd8ed1ab_0 conda-forge
jupyter 1.0.0 py39h6e9494a_7 conda-forge
jupyter_client 7.3.1 pyhd8ed1ab_0 conda-forge
jupyter_console 6.4.3 pyhd8ed1ab_0 conda-forge
jupyter_core 4.10.0 py39h6e9494a_0 conda-forge
jupyterlab_pygments 0.2.2 pyhd8ed1ab_0 conda-forge
jupyterlab_widgets 1.1.0 pyhd8ed1ab_0 conda-forge
kealib 1.4.14 ha22a8b1_3 conda-forge
kiwisolver 1.4.2 py39h7248d28_1 conda-forge
krb5 1.19.3 hb49756b_0 conda-forge
lcms2 2.12 h577c468_0 conda-forge
lerc 3.0 he49afe7_0 conda-forge
libblas 3.9.0 14_osx64_openblas conda-forge
libbrotlicommon 1.0.9 h5eb16cf_7 conda-forge
libbrotlidec 1.0.9 h5eb16cf_7 conda-forge
libbrotlienc 1.0.9 h5eb16cf_7 conda-forge
libcblas 3.9.0 14_osx64_openblas conda-forge
libclang 13.0.1 default_he082bbe_0 conda-forge
libcrc32c 1.1.2 he49afe7_0 conda-forge
libcurl 7.83.1 h372c54d_0 conda-forge
libcxx 14.0.3 hc203e6f_0 conda-forge
libdap4 3.20.6 h3e144a0_2 conda-forge
libdeflate 1.10 h0d85af4_0 conda-forge
libedit 3.1.20191231 h0678c8f_2 conda-forge
libev 4.33 haf1e3a3_1 conda-forge
libevent 2.1.10 h815e4d9_4 conda-forge
libffi 3.4.2 h0d85af4_5 conda-forge
libgdal 3.4.2 h6474519_7 conda-forge
libgfortran 5.0.0 9_3_0_h6c81a4c_23 conda-forge
libgfortran5 9.3.0 h6c81a4c_23 conda-forge
libglib 2.70.2 hf1fb8c0_4 conda-forge
libgoogle-cloud 1.36.0 h52a585b_0 conda-forge
libiconv 1.16 haf1e3a3_0 conda-forge
libkml 1.3.0 h8fd9edb_1014 conda-forge
liblapack 3.9.0 14_osx64_openblas conda-forge
libllvm11 11.1.0 hd011deb_3 conda-forge
libllvm13 13.0.1 h64f94b2_2 conda-forge
libnetcdf 4.8.1 nompi_h6609ca0_102 conda-forge
libnghttp2 1.47.0 h942079c_0 conda-forge
libopenblas 0.3.20 openmp_hb3cd9ec_0 conda-forge
libpng 1.6.37 h7cec526_2 conda-forge
libpq 14.2 hea3049e_0 conda-forge
libprotobuf 3.19.4 hcf210ce_0 conda-forge
librttopo 1.1.0 hec60dd8_9 conda-forge
libsodium 1.0.18 hbcb3906_1 conda-forge
libspatialindex 1.9.3 he49afe7_4 conda-forge
libspatialite 5.0.1 hadde3e2_15 conda-forge
libssh2 1.10.0 h52ee1ee_2 conda-forge
libthrift 0.16.0 h9702cd6_1 conda-forge
libtiff 4.3.0 h17f2ce3_3 conda-forge
libutf8proc 2.7.0 h0d85af4_0 conda-forge
libwebp 1.2.2 h28dabe5_0 conda-forge
libwebp-base 1.2.2 h0d85af4_1 conda-forge
libxcb 1.13 h0d85af4_1004 conda-forge
libxml2 2.9.12 h7e28ab6_1 conda-forge
libzip 1.8.0 h8b0c345_1 conda-forge
libzlib 1.2.11 h6c3fc93_1014 conda-forge
llvm-openmp 14.0.3 ha654fa7_0 conda-forge
llvmlite 0.38.0 py39ha9d9895_1 conda-forge
lz4-c 1.9.3 he49afe7_1 conda-forge
mapclassify 2.4.3 pyhd8ed1ab_0 conda-forge
markupsafe 2.1.1 py39h63b48b0_1 conda-forge
matplotlib 3.5.2 py39h6e9494a_0 conda-forge
matplotlib-base 3.5.2 py39h64a0072_0 conda-forge
matplotlib-inline 0.1.3 pyhd8ed1ab_0 conda-forge
mistune 0.8.4 py39h89e85a6_1005 conda-forge
munch 2.5.0 py_0 conda-forge
munkres 1.1.4 pyh9f0ad1d_0 conda-forge
mysql-common 8.0.29 h924029e_0 conda-forge
mysql-libs 8.0.29 h3cab752_0 conda-forge
nbclient 0.6.3 pyhd8ed1ab_0 conda-forge
nbconvert 6.5.0 pyhd8ed1ab_0 conda-forge
nbconvert-core 6.5.0 pyhd8ed1ab_0 conda-forge
nbconvert-pandoc 6.5.0 pyhd8ed1ab_0 conda-forge
nbformat 5.4.0 pyhd8ed1ab_0 conda-forge
ncurses 6.3 h96cf925_1 conda-forge
nest-asyncio 1.5.5 pyhd8ed1ab_0 conda-forge
networkx 2.8 pyhd8ed1ab_0 conda-forge
notebook 6.4.11 pyha770c72_0 conda-forge
nspr 4.32 hcd9eead_1 conda-forge
nss 3.77 hfce436b_0 conda-forge
numba 0.55.1 py39hc37845d_1 conda-forge
numexpr 2.8.0 py39hbd61c47_2 conda-forge
numpy 1.21.6 py39hf56e92f_0 conda-forge
openjpeg 2.4.0 h6e7aa92_1 conda-forge
openmatrix 0.3.5.0 pyhd8ed1ab_0 conda-forge
openssl 1.1.1o hfe4f2af_0 conda-forge
orc 1.7.3 h84518c8_0 conda-forge
orca 1.6 pyhd8ed1ab_0 conda-forge
packaging 21.3 pyhd8ed1ab_0 conda-forge
pandas 1.4.2 py39hbd61c47_1 conda-forge
pandoc 2.18 h694c41f_0 conda-forge
pandocfilters 1.5.0 pyhd8ed1ab_0 conda-forge
parquet-cpp 1.5.1 2 conda-forge
parso 0.8.3 pyhd8ed1ab_0 conda-forge
pcre 8.45 he49afe7_0 conda-forge
pcre2 10.37 ha16e1b2_0 conda-forge
perl 5.32.1 2_h0d85af4_perl5 conda-forge
pexpect 4.8.0 pyh9f0ad1d_2 conda-forge
pickleshare 0.7.5 py_1003 conda-forge
pillow 9.1.0 py39hd2c7aa1_2 conda-forge
pip 22.1 pyhd8ed1ab_0 conda-forge
pixman 0.40.0 hbcb3906_0 conda-forge
pluggy 1.0.0 py39h6e9494a_3 conda-forge
poppler 22.04.0 h39497b0_0 conda-forge
poppler-data 0.4.11 hd8ed1ab_0 conda-forge
postgresql 14.2 he8fe76e_0 conda-forge
proj 9.0.0 h2364a93_1 conda-forge
prometheus_client 0.14.1 pyhd8ed1ab_0 conda-forge
prompt-toolkit 3.0.29 pyha770c72_0 conda-forge
prompt_toolkit 3.0.29 hd8ed1ab_0 conda-forge
psutil 5.9.0 py39h63b48b0_1 conda-forge
pthread-stubs 0.4 hc929b4f_1001 conda-forge
ptyprocess 0.7.0 pyhd3deb0d_0 conda-forge
pure_eval 0.2.2 pyhd8ed1ab_0 conda-forge
py 1.11.0 pyh6c4a22f_0 conda-forge
pyarrow 8.0.0 py39hb9688c1_0_cpu conda-forge
pycodestyle 2.8.0 pyhd8ed1ab_0 conda-forge
pycparser 2.21 pyhd8ed1ab_0 conda-forge
pygments 2.12.0 pyhd8ed1ab_0 conda-forge
pyopenssl 22.0.0 pyhd8ed1ab_0 conda-forge
pyparsing 3.0.9 pyhd8ed1ab_0 conda-forge
pyproj 3.3.1 py39hfe197cf_0 conda-forge
pyqt 5.12.3 py39h9d385e7_4 conda-forge
pyqt5-sip 4.19.18 pypi_0 pypi
pyqtchart 5.12 pypi_0 pypi
pyqtwebengine 5.12.1 pypi_0 pypi
pyrsistent 0.18.1 py39h63b48b0_1 conda-forge
pysocks 1.7.1 py39h6e9494a_5 conda-forge
pytest 7.1.2 py39h6e9494a_0 conda-forge
pytest-cov 3.0.0 pyhd8ed1ab_0 conda-forge
pytest-datadir 1.3.1 py_0 conda-forge
pytest-regressions 2.3.1 pyhd8ed1ab_0 conda-forge
python 3.9.12 h8b4d769_1_cpython conda-forge
python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge
python-fastjsonschema 2.15.3 pyhd8ed1ab_0 conda-forge
python_abi 3.9 2_cp39 conda-forge
pytz 2022.1 pyhd8ed1ab_0 conda-forge
pyyaml 6.0 py39h63b48b0_4 conda-forge
pyzmq 22.3.0 py39hc2dc7ec_2 conda-forge
qt 5.12.9 h2a607e2_5 conda-forge
qtconsole 5.3.0 pyhd8ed1ab_0 conda-forge
qtconsole-base 5.3.0 pyhd8ed1ab_0 conda-forge
qtpy 2.1.0 pyhd8ed1ab_0 conda-forge
re2 2022.02.01 he49afe7_0 conda-forge
readline 8.1 h05e3726_0 conda-forge
requests 2.27.1 pyhd8ed1ab_0 conda-forge
rtree 1.0.0 py39h7d0d40a_1 conda-forge
scikit-learn 1.0.2 py39hd4eea88_0 conda-forge
scipy 1.8.0 py39h056f1c0_1 conda-forge
send2trash 1.8.0 pyhd8ed1ab_0 conda-forge
setuptools 62.2.0 py39h6e9494a_0 conda-forge
shapely 1.8.2 py39hd471b09_1 conda-forge
six 1.16.0 pyh6c4a22f_0 conda-forge
snappy 1.1.9 h6e38e02_0 conda-forge
soupsieve 2.3.1 pyhd8ed1ab_0 conda-forge
sqlite 3.38.5 hd9f0692_0 conda-forge
stack_data 0.2.0 pyhd8ed1ab_0 conda-forge
tables 3.6.1 pypi_0 pypi
terminado 0.13.3 py39h6e9494a_1 conda-forge
threadpoolctl 3.1.0 pyh8a188c0_0 conda-forge
tiledb 2.8.2 hf17dc58_0 conda-forge
tinycss2 1.1.1 pyhd8ed1ab_0 conda-forge
tk 8.6.12 h5dbffcc_0 conda-forge
toml 0.10.2 pyhd8ed1ab_0 conda-forge
tomli 2.0.1 pyhd8ed1ab_0 conda-forge
toolz 0.11.2 pyhd8ed1ab_0 conda-forge
tornado 6.1 py39h63b48b0_3 conda-forge
traitlets 5.2.0 pyhd8ed1ab_0 conda-forge
tzcode 2022a h5eb16cf_0 conda-forge
tzdata 2022a h191b570_0 conda-forge
unicodedata2 14.0.0 py39h63b48b0_1 conda-forge
urllib3 1.26.9 pyhd8ed1ab_0 conda-forge
wcwidth 0.2.5 pyh9f0ad1d_2 conda-forge
webencodings 0.5.1 py_1 conda-forge
werkzeug 2.1.2 pyhd8ed1ab_1 conda-forge
wheel 0.37.1 pyhd8ed1ab_0 conda-forge
widgetsnbextension 3.6.0 py39h6e9494a_0 conda-forge
xerces-c 3.2.3 h6564042_4 conda-forge
xorg-libxau 1.0.9 h35c211d_0 conda-forge
xorg-libxdmcp 1.1.3 h35c211d_0 conda-forge
xyzservices 2022.4.0 pyhd8ed1ab_0 conda-forge
xz 5.2.5 haf1e3a3_1 conda-forge
yaml 0.2.5 h0d85af4_2 conda-forge
zeromq 4.3.4 he49afe7_1 conda-forge
zipp 3.8.0 pyhd8ed1ab_0 conda-forge
zlib 1.2.11 h6c3fc93_1014 conda-forge
zstd 1.5.2 h582d3a0_0 conda-forge

@dhensle

Copy link
Copy Markdown
Contributor

I'm getting a numpy comparison error when running test_mtc_extended.py (note that test_mtc.py seems to run just find)

Sorry about that, the setup I had was pointing to some other configs. This test should be passing now.

@dhensle

Copy link
Copy Markdown
Contributor

@e-lo I believe I have addressed all of your comments. I left a couple conversations open for you to sign off on. Thanks for your helpful comments and please let me know if there's anything else I missed.

Comment threadactivitysim/examples/example_mtc/configs/annotate_households.csv Outdated
@jfdman

Copy link
Copy Markdown

Have all comments been addressed? Please advise, we have several regions waiting to pull this model into their implementation. Thanks!

@guyrousseau

Copy link
Copy Markdown

@jfdman Since all vehicle make/model coding for the NHTS (since inception) maps to NHTSA’s FARS vehicle make/mode coding scheme [https://www.nhtsa.gov/research-data/fatality-analysis-reporting-system-fars], can you confirm that our vehicle type model conforms with NHTSA’s FARS?

@i-am-sijia

i-am-sijia commented Jun 6, 2022

Copy link
Copy Markdown
Member

Have all comments been addressed? Please advise, we have several regions waiting to pull this model into their implementation. Thanks!

Confirmed all previous comments are addressed. Guy's question is the only one left. Thanks.

@jpn--
jpn-- merged commit 367cbac into ActivitySim:developJun 6, 2022
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FeatureNew feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

create vehicle type model and add vehicle table to pipeline

10 participants

@mxndrwgrdnr@bstabler@coveralls@e-lo@dhensle@jfdman@guyrousseau@i-am-sijia@toliwaga@jpn--
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

🚀 [feat] vehicle type model - #486

Merged
jpn-- merged 44 commits into
ActivitySim:developfrom
mxndrwgrdnr:vehicle
Jun 6, 2022
Merged

🚀 [feat] vehicle type model#486
jpn-- merged 44 commits into
ActivitySim:developfrom
mxndrwgrdnr:vehicle

Conversation

@mxndrwgrdnr

@mxndrwgrdnrmxndrwgrdnr commented Sep 21, 2021

Copy link
Copy Markdown
Contributor

User Story

As a planner, I would like to understand the effects of vehicle type choice on travel behavior in order to support more detailed emissions analysis and more refined travel costs.

Requirements

Per https://github.com/ActivitySim/activitysim/wiki/Phase-6b-Scope-of-Work#task-2-vehicle-type-model

After applying this submodel, household vehicles should have the following properties:

  • vehicle type (e.g. auto, light-truck, etc)
  • capacity (# of people it can carry)
  • power train (ICE, hybrid, phev, etc)
  • range
  • age

In addition, each auto tour should be assigned the most likely household vehicles based on:

  • household
  • tour-characteristics
  • household vehicle attributes

*Note: For this task, vehicle allocation to auto tours should not consider the availability of each individual vehicles. *

The implementation should have the following usability features:

  • ability to read an input vehicle table, as opposed to create one during a model run, an initialize_vehicles submodel will be added that can read a vehicle table from CSV file, annotate it with custom expressions, ensure table keys are consistent with household IDs, and add it to the pipeline.
  • detailed technical documentation of all vehicle type and allocation models or methods.
  • updated users guide
  • tests covering the new methods
  • examples covering new methods

Approach

Model Estimation

  • estimate vehicle type model based on 5,000 household Bay Area TNC survey data
  • run the submodel with the existing example model
  • reasonably verify goodness-of-fit across key dimensions such as:
    • socio-demographics and
    • geography

Implementation

  • integrate method into the ActivitySim run stream.
  • develop method for allocating household-generated VMT to household vehicles
  • sensitivity tests

Issues

Fixes#438

@mxndrwgrdnr
mxndrwgrdnr marked this pull request as draft September 21, 2021 05:24
@bstabler

Copy link
Copy Markdown
Contributor

#438

@coveralls

coveralls commented Sep 21, 2021

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.5%) to 53.603% when pulling d556239 on mxndrwgrdnr:vehicle into 91930b5 on ActivitySim:develop.

@bstabler

Copy link
Copy Markdown
Contributor

@mxndrwgrdnr - can you adjust this PR to merge to develop? Thanks.

@mxndrwgrdnr
mxndrwgrdnr changed the base branch from master to developNovember 9, 2021 00:05
@mxndrwgrdnr
mxndrwgrdnr marked this pull request as ready for review November 12, 2021 22:52
@e-loe-lo added the Feature New feature or request label Dec 7, 2021
@e-loe-lo changed the title vehicle type model🚀 [feat] vehicle type modelDec 7, 2021
@e-loe-lo linked an issue Dec 7, 2021 that may be closed by this pull request

@e-loe-lo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally I found the code easy to read and it flowed well. There is a general lack of documentation including:

  • docstrings appropriately formatted for autodoc-ing
  • typehints
  • origin of model coefficients, what estimation are they from, etc
  • general documentation about capabilities
  • intra-activity sim links to documentation about general activitysim "things" (i.e. various formats, etc)

There is also a lack of tests for the specific unit of the vehicle type choice.

I also found it odd when running the MTC test example locally, that it didn't pick up the config? I suspect I'm doing something wrong but if I'm doing it wrong others might too (maybe?)

Comment threadactivitysim/abm/models/vehicle_type_choice.py
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/tables/vehicles.py
Comment threadactivitysim/abm/tables/vehicles.py
Comment threadactivitysim/abm/tables/vehicles.py
Comment threadactivitysim/examples/example_mtc/configs/free_parking.csv Outdated
Comment threadactivitysim/examples/example_mtc/configs/settings.yaml Outdated
@e-lo

e-lo commented Dec 8, 2021

Copy link
Copy Markdown
Collaborator

BTW I'll probably have more questions once I get the MTC example working on my local machine - i.e. is it annotating tours etc.

@jpn--
jpn-- requested a review from i-am-sijiaMay 5, 2022 13:53
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Car_8,.9541,0.0096,0.0355,0.0007,0.0000
Car_9,.9548,0.0037,0.0409,0.0004,0.0001
Car_10,0.9530,0.0015,0.0451,0.0003,0.0001
Car_11,0.9676,0.0096,0.0225,0.0003,0.0000

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems as though some amount of "smoothing" would make sense here between the years. Many of the numbers for the lower-probability options go back and forth between 0 and >0 several times.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, these probabilities are "lumpy". This is due to the fact that they came directly from the National Household Travel Survey data. A comment about the "lumpy-ness" was added to the models.rst vehicle type choice documentation encouraging the user to change the probabilities to their region and smooth them as they see fit. Additional links in the documentation point to the presented results and sensitivity studies.

So, I suggest we leave the probabilities as is in the context of this pull request for the purpose of simplicity and transparency.

config.config_file_path(vehicle_type_data_file), comment='#')
fleet_year = model_settings.get('FLEET_YEAR')

vehicle_type_data['age'] = (1 + fleet_year - vehicle_type_data['vehicle_year']).astype(str)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to make sense that we would be able to imply a variation in fuel type based on vehicle age. However, in this case age isn't necessarily relative. A 10 year old car in a 2030 scenario should be equal to a 2 year old car in 2022.

I'm trying to figure out how this is accommodated within the probabilities but can't seem to find anywhere that this is done?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this wasn't done very consistently... I changed the probabilities file to include this same calculation -- the probabilities file now includes body_type and vehicle_year columns just like the vehicle_type_data.csv file and age is explicitly calculated based on the user input fleet_year.

Comment threadactivitysim/abm/models/vehicle_allocation.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_allocation.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py
Comment threadactivitysim/abm/models/vehicle_type_choice.py
logger = logging.getLogger(__name__)


def get_combinatorial_vehicle_alternatives(alts_cats_dict, model_settings):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest adding a unit test for this function.

@dhensledhensleMay 24, 2022

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done. See the abm/test/test_misc/test_vehicle_type_alternatives.py script. Also cleaned up the function to remove model settings and make it better for a stand-alone unit test.

Comment threadactivitysim/abm/models/vehicle_type_choice.py
choosers=choosers,
alternatives=alts_wide,
spec=model_spec,
log_alt_losers=log_alt_losers,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something to consider more holistically in activitysim: most of these function calls seem to require 5-10 parameters.

Many best practices call for <= 3.

All the parameters which relate to run settings (e.g. chunk size, trace label, trace choice name) and not "substance" (e.g. alternatives, estimator, chooser) get in the way of legibility of what is happening.

Don't get me wrong - I love being explicit about things - but I would consider bundling some of these things in a config class that gets passed around or something similar.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is something we have been actively discussing as a consortium. I think making changes to this affect is outside the scope of this pull request though.

Comment threadactivitysim/abm/tables/vehicles.py Outdated
vehicles['vehicle_id'] = vehicles.household_id * 10 + vehicles.vehicle_num
vehicles.set_index('vehicle_id', inplace = True)

# I do not understand why this line is necessary, it seems circular

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should figure this out before merging

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the purpose of this line is to replace the "table" function with the dataframe. Added comment to reflect this just like in persons and households. This is just a consequence of how the inject table decorator and add_table functions were constructed.

@e-lo

e-lo commented May 13, 2022

Copy link
Copy Markdown
Collaborator

I'm getting a numpy comparison error when running test_mtc_extended.py (note that test_mtc.py seems to run just find)

Erroring at:

File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line286, inassign_variablesexpr_values=to_series(eval(expression, globals_dict, _locals_dict))
File"<string>", line1, in<module>FutureWarning: elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparison

Numpy version: v1.21

Note I scanned the code where it seems like somebody was trying to get this to just warn not error - but it doesn't seem to be working as run for some reason. I haven't troubleshot too much yet - thought I'd post in case it is a known issue.

Full Trace

---------------------------------------------------------------Capturedstdoutcall----------------------------------------------------------------ConfiguredloggingusingbasicConfigINFO:activitysim:ConfiguredloggingusingbasicConfigINFO-Readloggingconfigurationfrom: /Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/configs/logging.yamlINFO-SETTINGconfigs_dir: ['/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/test/configs', '/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/configs', '/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/configs']
INFO-SETTINGsettings_file_name: settings.yamlINFO-SETTINGdata_dir: ['/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data']
INFO-SETTINGoutput_dir: /Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/test/outputINFO-SETTINGhouseholds_sample_size: 10INFO-SETTINGchunk_size: 0INFO-SETTINGchunk_method: hybrid_ussINFO-SETTINGchunk_training_mode: disabledINFO-SETTINGmultiprocess: NoneINFO-SETTINGnum_processes: NoneINFO-SETTINGresume_after: NoneINFO-SETTINGtrace_hh_id: NoneINFO-ENVMKL_NUM_THREADS: NoneINFO-ENVOMP_NUM_THREADS: NoneINFO-ENVOPENBLAS_NUM_THREADS: NoneINFO-NUMPYblas_infolibraries: ['cblas', 'blas', 'cblas', 'blas']
INFO-NUMPYblas_opt_infolibraries: ['cblas', 'blas', 'cblas', 'blas']
INFO-NUMPYlapack_infolibraries: ['lapack', 'blas', 'lapack', 'blas']
INFO-NUMPYlapack_opt_infolibraries: ['lapack', 'blas', 'lapack', 'blas', 'cblas', 'blas', 'cblas', 'blas']
INFO-runsingleprocesssimulationINFO-Timetoexecuteopen_pipeline : 0.062seconds (0.0minutes)
INFO-preload_injectablesINFO-Timetoexecutepreload_injectables : 0.014seconds (0.0minutes)
INFO-#run_model running step initialize_landuseRunningstep'initialize_landuse'INFO-ReadingCSVfile/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/land_use.csvINFO-loadedland_use (25, 24)
INFO-initialize_landuse.annotate_tables-annotatingland_useSPECannotate_landuseINFO-Network_LOSusingskim_dict_factory: NumpyArraySkimFactoryINFO-allocate_skim_buffersharedFalsetazshape (826, 25, 25) totalsize: 2_065_000 (2.1MB)
INFO-_read_skims_from_omx/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/skims.omxINFO-_read_skims_from_omxloaded826skimsfrom/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/skims.omxINFO-writingskimcachetaz (826, 25, 25) to/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/test/output/cache/cached_taz.mmapINFO-load_skims_to_buffertazshape (826, 25, 25)
INFO-get_skim_datatazSkimDatashape (826, 25, 25)
INFO-SkimDictinittazINFO-SkimDict.build_3d_skim_block_offset_tableregistered1673dkeysTimetoexecutestep'initialize_landuse': 1.82sTotaltimetoexecuteiteration1withiterationvalueNone: 1.82sINFO-#run_model running step initialize_householdsRunningstep'initialize_households'INFO-ReadingCSVfile/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/households.csvINFO-fullhouseholdlistcontains5000householdsINFO-sampling10of5000householdsINFO-loadedhouseholds (10, 7)
INFO-ReadingCSVfile/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/persons.csvINFO-loadedpersons (28, 7)
INFO-initialize_households.annotate_tables-annotatingpersonsSPECannotate_personsINFO-initialize_households.annotate_tables-annotatinghouseholdsSPECannotate_householdsINFO-initialize_households.annotate_tables-annotatingpersonsSPECannotate_persons_after_hhTimetoexecutestep'initialize_households': 0.37sTotaltimetoexecuteiteration1withiterationvalueNone: 0.37sINFO-#run_model running step compute_accessibilityRunningstep'compute_accessibility'INFO-Runningcompute_accessibilitywith25origzones25destzonesINFO-compute_accessibilityRunningadaptive_chunked_chooserswith25choosersINFO-Runningchunk1of1with25of25choosersINFO-Runningcompute_accessibilitywith25origzones25destzonesINFO-compute_accessibilitycomputedaccessibilities (25, 10)
Timetoexecutestep'compute_accessibility': 0.06sTotaltimetoexecuteiteration1withiterationvalueNone: 0.06sINFO-#run_model running step school_locationRunningstep'school_location'INFO-Runningschool_location.i1.sample.universitywith4personsINFO-school_location.i1.sample.university.interaction_sampleRunningadaptive_chunked_chooserswith4choosersINFO-Runningchunk1of1with4of4choosersINFO-Runningeval_interaction_utilitieson24rowsINFO-Runningschool_location.i1.logsums.universitywith11rowsERROR-assign_variables-FutureWarning (elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparison) evaluating: np.where(sov_auto_op_cost.isna() | (sov_veh_option=='non_hh_veh'), costPerMile, sov_auto_op_cost)
numpy.core._exceptions._UFuncInputCastingError: Cannotcastufunc'equal'input1fromdtype('<U10') todtype('float64') withcastingrule'same_kind'Theaboveexceptionwasthedirectcauseofthefollowingexception:
Traceback (mostrecentcalllast):
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line286, inassign_variablesexpr_values=to_series(eval(expression, globals_dict, _locals_dict))
File"<string>", line1, in<module>FutureWarning: elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparisonINFO-Timetoexecuteallmodelsuntilthiserror : 2.814seconds (0.0minutes)
ERROR-activitysimrunencounteredanunrecoverableerrornumpy.core._exceptions._UFuncInputCastingError: Cannotcastufunc'equal'input1fromdtype('<U10') todtype('float64') withcastingrule'same_kind'Theaboveexceptionwasthedirectcauseofthefollowingexception:
Traceback (mostrecentcalllast):
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/cli/run.py", line260, inrunpipeline.run(models=config.setting('models'), resume_after=resume_after)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/pipeline.py", line617, inrunrun_model(model)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/pipeline.py", line476, inrun_modelorca.run([step_name])
File"/Users/elizabeth/opt/miniconda3/envs/asim/lib/python3.9/site-packages/orca/orca.py", line2168, inrunstep()
File"/Users/elizabeth/opt/miniconda3/envs/asim/lib/python3.9/site-packages/orca/orca.py", line973, in__call__returnself._func(**kwargs)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line920, inschool_locationiterate_location_choice(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line774, initerate_location_choicechoices_df, save_sample_df=run_location_choice(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line619, inrun_location_choicerun_location_logsums(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line438, inrun_location_logsumslogsums=logsum.compute_logsums(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/util/logsums.py", line142, incompute_logsumsexpressions.assign_columns(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/expressions.py", line124, inassign_columnsresults=compute_columns(df, model_settings, locals_dict, trace_label)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/expressions.py", line95, incompute_columns=assign.assign_variables(expressions_spec,
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line298, inassign_variablesraiseerrFile"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line286, inassign_variablesexpr_values=to_series(eval(expression, globals_dict, _locals_dict))
File"<string>", line1, in<module>FutureWarning: elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparison---------------------------------------------------------------Capturedstderrcall----------------------------------------------------------------numpy.core._exceptions._UFuncInputCastingError: Cannotcastufunc'equal'input1fromdtype('<U10') todtype('float64') withcastingrule'same_kind'Theaboveexceptionwasthedirectcauseofthefollowingexception:
Traceback (mostrecentcalllast):
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/test/simulation.py", line15, in<module>sys.exit(run(args))
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/cli/run.py", line260, inrunpipeline.run(models=config.setting('models'), resume_after=resume_after)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/pipeline.py", line617, inrunrun_model(model)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/pipeline.py", line476, inrun_modelorca.run([step_name])
File"/Users/elizabeth/opt/miniconda3/envs/asim/lib/python3.9/site-packages/orca/orca.py", line2168, inrunstep()
File"/Users/elizabeth/opt/miniconda3/envs/asim/lib/python3.9/site-packages/orca/orca.py", line973, in__call__returnself._func(**kwargs)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line920, inschool_locationiterate_location_choice(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line774, initerate_location_choicechoices_df, save_sample_df=run_location_choice(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line619, inrun_location_choicerun_location_logsums(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line438, inrun_location_logsumslogsums=logsum.compute_logsums(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/util/logsums.py", line142, incompute_logsumsexpressions.assign_columns(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/expressions.py", line124, inassign_columnsresults=compute_columns(df, model_settings, locals_dict, trace_label)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/expressions.py", line95, incompute_columns=assign.assign_variables(expressions_spec,
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line298, inassign_variablesraiseerrFile"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line286, inassign_variablesexpr_values=to_series(eval(expression, globals_dict, _locals_dict))
File"<string>", line1, in<module>FutureWarning: elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparison

Conda List

# packages in environment at /Users/elizabeth/opt/miniconda3/envs/asim:
#
# Name Version Build Channel
abseil-cpp 20210324.2 he49afe7_0 conda-forge
activitysim 1.0.3 dev_0 <develop>
appnope 0.1.3 pyhd8ed1ab_0 conda-forge
argon2-cffi 21.3.0 pyhd8ed1ab_0 conda-forge
argon2-cffi-bindings 21.2.0 py39h63b48b0_2 conda-forge
arrow-cpp 8.0.0 py39hfe23411_0_cpu conda-forge
asttokens 2.0.5 pyhd8ed1ab_0 conda-forge
attrs 21.4.0 pyhd8ed1ab_0 conda-forge
aws-c-cal 0.5.11 hd2e2f4b_0 conda-forge
aws-c-common 0.6.2 h0d85af4_0 conda-forge
aws-c-event-stream 0.2.7 hb9330a7_13 conda-forge
aws-c-io 0.10.5 h35aa462_0 conda-forge
aws-checksums 0.1.11 h0010a65_7 conda-forge
aws-sdk-cpp 1.8.186 h766a74d_3 conda-forge
backcall 0.2.0 pyh9f0ad1d_0 conda-forge
backports 1.0 py_2 conda-forge
backports.functools_lru_cache 1.6.4 pyhd8ed1ab_0 conda-forge
beautifulsoup4 4.11.1 pyha770c72_0 conda-forge
bleach 5.0.0 pyhd8ed1ab_0 conda-forge
blosc 1.21.1 h97e831e_2 conda-forge
boost-cpp 1.74.0 hdbf7018_7 conda-forge
branca 0.5.0 pyhd8ed1ab_0 conda-forge
brotli 1.0.9 h5eb16cf_7 conda-forge
brotli-bin 1.0.9 h5eb16cf_7 conda-forge
brotlipy 0.7.0 py39h63b48b0_1004 conda-forge
bump2version 1.0.1 pyh9f0ad1d_0 conda-forge
bzip2 1.0.8 h0d85af4_4 conda-forge
c-ares 1.18.1 h0d85af4_0 conda-forge
ca-certificates 2021.10.8 h033912b_0 conda-forge
cairo 1.16.0 h9e0e54b_1010 conda-forge
certifi 2021.10.8 py39h6e9494a_2 conda-forge
cffi 1.15.0 py39he338e87_0 conda-forge
cfitsio 4.1.0 h2c97ad1_0 conda-forge
charset-normalizer 2.0.12 pyhd8ed1ab_0 conda-forge
click 8.1.3 py39h6e9494a_0 conda-forge
click-plugins 1.1.1 py_0 conda-forge
cligj 0.7.2 pyhd8ed1ab_1 conda-forge
coverage 6.3.2 py39h63b48b0_2 conda-forge
coveralls 3.3.1 pyhd8ed1ab_0 conda-forge
cryptography 36.0.2 py39h1644bb1_1 conda-forge
curl 7.83.1 h372c54d_0 conda-forge
cycler 0.11.0 pyhd8ed1ab_0 conda-forge
cytoolz 0.11.2 py39h63b48b0_2 conda-forge
dbus 1.13.6 h811a1a6_3 conda-forge
debugpy 1.6.0 py39hfd1d529_0 conda-forge
decorator 5.1.1 pyhd8ed1ab_0 conda-forge
defusedxml 0.7.1 pyhd8ed1ab_0 conda-forge
descartes 1.1.0 py_4 conda-forge
docopt 0.6.2 py_1 conda-forge
entrypoints 0.4 pyhd8ed1ab_0 conda-forge
executing 0.8.3 pyhd8ed1ab_0 conda-forge
expat 2.4.8 h96cf925_0 conda-forge
fiona 1.8.21 py39h6d65ddd_1 conda-forge
flask 2.1.2 pyhd8ed1ab_1 conda-forge
flit-core 3.7.1 pyhd8ed1ab_0 conda-forge
folium 0.12.1.post1 pyhd8ed1ab_1 conda-forge
font-ttf-dejavu-sans-mono 2.37 hab24e00_0 conda-forge
font-ttf-inconsolata 3.000 h77eed37_0 conda-forge
font-ttf-source-code-pro 2.038 h77eed37_0 conda-forge
font-ttf-ubuntu 0.83 hab24e00_0 conda-forge
fontconfig 2.14.0 h676cef8_0 conda-forge
fonts-conda-ecosystem 1 0 conda-forge
fonts-conda-forge 1 0 conda-forge
fonttools 4.33.3 py39h701faf5_0 conda-forge
freetype 2.10.4 h4cff582_1 conda-forge
freexl 1.0.6 h0d85af4_0 conda-forge
gdal 3.4.2 py39h97b4846_7 conda-forge
geopandas 0.10.2 pyhd8ed1ab_1 conda-forge
geopandas-base 0.10.2 pyha770c72_1 conda-forge
geos 3.10.2 he49afe7_0 conda-forge
geotiff 1.7.1 had63758_1 conda-forge
gettext 0.19.8.1 hd1a6beb_1008 conda-forge
gflags 2.2.2 hb1e8313_1004 conda-forge
gh 2.10.1 h990441c_0 conda-forge
giflib 5.2.1 hbcb3906_2 conda-forge
git 2.35.3 pl5321h33a4a8a_0 conda-forge
glog 0.6.0 h8ac2a54_0 conda-forge
grpc-cpp 1.43.2 ha04666b_3 conda-forge
hdf4 4.2.15 hefd3b78_3 conda-forge
hdf5 1.12.1 nompi_ha60fbc9_104 conda-forge
icu 69.1 he49afe7_0 conda-forge
idna 3.3 pyhd8ed1ab_0 conda-forge
importlib-metadata 4.11.3 py39h6e9494a_1 conda-forge
importlib_resources 5.7.1 pyhd8ed1ab_0 conda-forge
iniconfig 1.1.1 pyh9f0ad1d_0 conda-forge
ipykernel 6.13.0 py39h71a6800_0 conda-forge
ipython 8.3.0 py39h6e9494a_0 conda-forge
ipython_genutils 0.2.0 py_1 conda-forge
ipywidgets 7.7.0 pyhd8ed1ab_0 conda-forge
itsdangerous 2.1.2 pyhd8ed1ab_0 conda-forge
jbig 2.1 h0d85af4_2003 conda-forge
jedi 0.18.1 py39h6e9494a_1 conda-forge
jinja2 3.1.2 pyhd8ed1ab_0 conda-forge
joblib 1.1.0 pyhd8ed1ab_0 conda-forge
jpeg 9e h5eb16cf_1 conda-forge
json-c 0.16 h01d06f9_0 conda-forge
jsonschema 4.5.1 pyhd8ed1ab_0 conda-forge
jupyter 1.0.0 py39h6e9494a_7 conda-forge
jupyter_client 7.3.1 pyhd8ed1ab_0 conda-forge
jupyter_console 6.4.3 pyhd8ed1ab_0 conda-forge
jupyter_core 4.10.0 py39h6e9494a_0 conda-forge
jupyterlab_pygments 0.2.2 pyhd8ed1ab_0 conda-forge
jupyterlab_widgets 1.1.0 pyhd8ed1ab_0 conda-forge
kealib 1.4.14 ha22a8b1_3 conda-forge
kiwisolver 1.4.2 py39h7248d28_1 conda-forge
krb5 1.19.3 hb49756b_0 conda-forge
lcms2 2.12 h577c468_0 conda-forge
lerc 3.0 he49afe7_0 conda-forge
libblas 3.9.0 14_osx64_openblas conda-forge
libbrotlicommon 1.0.9 h5eb16cf_7 conda-forge
libbrotlidec 1.0.9 h5eb16cf_7 conda-forge
libbrotlienc 1.0.9 h5eb16cf_7 conda-forge
libcblas 3.9.0 14_osx64_openblas conda-forge
libclang 13.0.1 default_he082bbe_0 conda-forge
libcrc32c 1.1.2 he49afe7_0 conda-forge
libcurl 7.83.1 h372c54d_0 conda-forge
libcxx 14.0.3 hc203e6f_0 conda-forge
libdap4 3.20.6 h3e144a0_2 conda-forge
libdeflate 1.10 h0d85af4_0 conda-forge
libedit 3.1.20191231 h0678c8f_2 conda-forge
libev 4.33 haf1e3a3_1 conda-forge
libevent 2.1.10 h815e4d9_4 conda-forge
libffi 3.4.2 h0d85af4_5 conda-forge
libgdal 3.4.2 h6474519_7 conda-forge
libgfortran 5.0.0 9_3_0_h6c81a4c_23 conda-forge
libgfortran5 9.3.0 h6c81a4c_23 conda-forge
libglib 2.70.2 hf1fb8c0_4 conda-forge
libgoogle-cloud 1.36.0 h52a585b_0 conda-forge
libiconv 1.16 haf1e3a3_0 conda-forge
libkml 1.3.0 h8fd9edb_1014 conda-forge
liblapack 3.9.0 14_osx64_openblas conda-forge
libllvm11 11.1.0 hd011deb_3 conda-forge
libllvm13 13.0.1 h64f94b2_2 conda-forge
libnetcdf 4.8.1 nompi_h6609ca0_102 conda-forge
libnghttp2 1.47.0 h942079c_0 conda-forge
libopenblas 0.3.20 openmp_hb3cd9ec_0 conda-forge
libpng 1.6.37 h7cec526_2 conda-forge
libpq 14.2 hea3049e_0 conda-forge
libprotobuf 3.19.4 hcf210ce_0 conda-forge
librttopo 1.1.0 hec60dd8_9 conda-forge
libsodium 1.0.18 hbcb3906_1 conda-forge
libspatialindex 1.9.3 he49afe7_4 conda-forge
libspatialite 5.0.1 hadde3e2_15 conda-forge
libssh2 1.10.0 h52ee1ee_2 conda-forge
libthrift 0.16.0 h9702cd6_1 conda-forge
libtiff 4.3.0 h17f2ce3_3 conda-forge
libutf8proc 2.7.0 h0d85af4_0 conda-forge
libwebp 1.2.2 h28dabe5_0 conda-forge
libwebp-base 1.2.2 h0d85af4_1 conda-forge
libxcb 1.13 h0d85af4_1004 conda-forge
libxml2 2.9.12 h7e28ab6_1 conda-forge
libzip 1.8.0 h8b0c345_1 conda-forge
libzlib 1.2.11 h6c3fc93_1014 conda-forge
llvm-openmp 14.0.3 ha654fa7_0 conda-forge
llvmlite 0.38.0 py39ha9d9895_1 conda-forge
lz4-c 1.9.3 he49afe7_1 conda-forge
mapclassify 2.4.3 pyhd8ed1ab_0 conda-forge
markupsafe 2.1.1 py39h63b48b0_1 conda-forge
matplotlib 3.5.2 py39h6e9494a_0 conda-forge
matplotlib-base 3.5.2 py39h64a0072_0 conda-forge
matplotlib-inline 0.1.3 pyhd8ed1ab_0 conda-forge
mistune 0.8.4 py39h89e85a6_1005 conda-forge
munch 2.5.0 py_0 conda-forge
munkres 1.1.4 pyh9f0ad1d_0 conda-forge
mysql-common 8.0.29 h924029e_0 conda-forge
mysql-libs 8.0.29 h3cab752_0 conda-forge
nbclient 0.6.3 pyhd8ed1ab_0 conda-forge
nbconvert 6.5.0 pyhd8ed1ab_0 conda-forge
nbconvert-core 6.5.0 pyhd8ed1ab_0 conda-forge
nbconvert-pandoc 6.5.0 pyhd8ed1ab_0 conda-forge
nbformat 5.4.0 pyhd8ed1ab_0 conda-forge
ncurses 6.3 h96cf925_1 conda-forge
nest-asyncio 1.5.5 pyhd8ed1ab_0 conda-forge
networkx 2.8 pyhd8ed1ab_0 conda-forge
notebook 6.4.11 pyha770c72_0 conda-forge
nspr 4.32 hcd9eead_1 conda-forge
nss 3.77 hfce436b_0 conda-forge
numba 0.55.1 py39hc37845d_1 conda-forge
numexpr 2.8.0 py39hbd61c47_2 conda-forge
numpy 1.21.6 py39hf56e92f_0 conda-forge
openjpeg 2.4.0 h6e7aa92_1 conda-forge
openmatrix 0.3.5.0 pyhd8ed1ab_0 conda-forge
openssl 1.1.1o hfe4f2af_0 conda-forge
orc 1.7.3 h84518c8_0 conda-forge
orca 1.6 pyhd8ed1ab_0 conda-forge
packaging 21.3 pyhd8ed1ab_0 conda-forge
pandas 1.4.2 py39hbd61c47_1 conda-forge
pandoc 2.18 h694c41f_0 conda-forge
pandocfilters 1.5.0 pyhd8ed1ab_0 conda-forge
parquet-cpp 1.5.1 2 conda-forge
parso 0.8.3 pyhd8ed1ab_0 conda-forge
pcre 8.45 he49afe7_0 conda-forge
pcre2 10.37 ha16e1b2_0 conda-forge
perl 5.32.1 2_h0d85af4_perl5 conda-forge
pexpect 4.8.0 pyh9f0ad1d_2 conda-forge
pickleshare 0.7.5 py_1003 conda-forge
pillow 9.1.0 py39hd2c7aa1_2 conda-forge
pip 22.1 pyhd8ed1ab_0 conda-forge
pixman 0.40.0 hbcb3906_0 conda-forge
pluggy 1.0.0 py39h6e9494a_3 conda-forge
poppler 22.04.0 h39497b0_0 conda-forge
poppler-data 0.4.11 hd8ed1ab_0 conda-forge
postgresql 14.2 he8fe76e_0 conda-forge
proj 9.0.0 h2364a93_1 conda-forge
prometheus_client 0.14.1 pyhd8ed1ab_0 conda-forge
prompt-toolkit 3.0.29 pyha770c72_0 conda-forge
prompt_toolkit 3.0.29 hd8ed1ab_0 conda-forge
psutil 5.9.0 py39h63b48b0_1 conda-forge
pthread-stubs 0.4 hc929b4f_1001 conda-forge
ptyprocess 0.7.0 pyhd3deb0d_0 conda-forge
pure_eval 0.2.2 pyhd8ed1ab_0 conda-forge
py 1.11.0 pyh6c4a22f_0 conda-forge
pyarrow 8.0.0 py39hb9688c1_0_cpu conda-forge
pycodestyle 2.8.0 pyhd8ed1ab_0 conda-forge
pycparser 2.21 pyhd8ed1ab_0 conda-forge
pygments 2.12.0 pyhd8ed1ab_0 conda-forge
pyopenssl 22.0.0 pyhd8ed1ab_0 conda-forge
pyparsing 3.0.9 pyhd8ed1ab_0 conda-forge
pyproj 3.3.1 py39hfe197cf_0 conda-forge
pyqt 5.12.3 py39h9d385e7_4 conda-forge
pyqt5-sip 4.19.18 pypi_0 pypi
pyqtchart 5.12 pypi_0 pypi
pyqtwebengine 5.12.1 pypi_0 pypi
pyrsistent 0.18.1 py39h63b48b0_1 conda-forge
pysocks 1.7.1 py39h6e9494a_5 conda-forge
pytest 7.1.2 py39h6e9494a_0 conda-forge
pytest-cov 3.0.0 pyhd8ed1ab_0 conda-forge
pytest-datadir 1.3.1 py_0 conda-forge
pytest-regressions 2.3.1 pyhd8ed1ab_0 conda-forge
python 3.9.12 h8b4d769_1_cpython conda-forge
python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge
python-fastjsonschema 2.15.3 pyhd8ed1ab_0 conda-forge
python_abi 3.9 2_cp39 conda-forge
pytz 2022.1 pyhd8ed1ab_0 conda-forge
pyyaml 6.0 py39h63b48b0_4 conda-forge
pyzmq 22.3.0 py39hc2dc7ec_2 conda-forge
qt 5.12.9 h2a607e2_5 conda-forge
qtconsole 5.3.0 pyhd8ed1ab_0 conda-forge
qtconsole-base 5.3.0 pyhd8ed1ab_0 conda-forge
qtpy 2.1.0 pyhd8ed1ab_0 conda-forge
re2 2022.02.01 he49afe7_0 conda-forge
readline 8.1 h05e3726_0 conda-forge
requests 2.27.1 pyhd8ed1ab_0 conda-forge
rtree 1.0.0 py39h7d0d40a_1 conda-forge
scikit-learn 1.0.2 py39hd4eea88_0 conda-forge
scipy 1.8.0 py39h056f1c0_1 conda-forge
send2trash 1.8.0 pyhd8ed1ab_0 conda-forge
setuptools 62.2.0 py39h6e9494a_0 conda-forge
shapely 1.8.2 py39hd471b09_1 conda-forge
six 1.16.0 pyh6c4a22f_0 conda-forge
snappy 1.1.9 h6e38e02_0 conda-forge
soupsieve 2.3.1 pyhd8ed1ab_0 conda-forge
sqlite 3.38.5 hd9f0692_0 conda-forge
stack_data 0.2.0 pyhd8ed1ab_0 conda-forge
tables 3.6.1 pypi_0 pypi
terminado 0.13.3 py39h6e9494a_1 conda-forge
threadpoolctl 3.1.0 pyh8a188c0_0 conda-forge
tiledb 2.8.2 hf17dc58_0 conda-forge
tinycss2 1.1.1 pyhd8ed1ab_0 conda-forge
tk 8.6.12 h5dbffcc_0 conda-forge
toml 0.10.2 pyhd8ed1ab_0 conda-forge
tomli 2.0.1 pyhd8ed1ab_0 conda-forge
toolz 0.11.2 pyhd8ed1ab_0 conda-forge
tornado 6.1 py39h63b48b0_3 conda-forge
traitlets 5.2.0 pyhd8ed1ab_0 conda-forge
tzcode 2022a h5eb16cf_0 conda-forge
tzdata 2022a h191b570_0 conda-forge
unicodedata2 14.0.0 py39h63b48b0_1 conda-forge
urllib3 1.26.9 pyhd8ed1ab_0 conda-forge
wcwidth 0.2.5 pyh9f0ad1d_2 conda-forge
webencodings 0.5.1 py_1 conda-forge
werkzeug 2.1.2 pyhd8ed1ab_1 conda-forge
wheel 0.37.1 pyhd8ed1ab_0 conda-forge
widgetsnbextension 3.6.0 py39h6e9494a_0 conda-forge
xerces-c 3.2.3 h6564042_4 conda-forge
xorg-libxau 1.0.9 h35c211d_0 conda-forge
xorg-libxdmcp 1.1.3 h35c211d_0 conda-forge
xyzservices 2022.4.0 pyhd8ed1ab_0 conda-forge
xz 5.2.5 haf1e3a3_1 conda-forge
yaml 0.2.5 h0d85af4_2 conda-forge
zeromq 4.3.4 he49afe7_1 conda-forge
zipp 3.8.0 pyhd8ed1ab_0 conda-forge
zlib 1.2.11 h6c3fc93_1014 conda-forge
zstd 1.5.2 h582d3a0_0 conda-forge

@dhensle

Copy link
Copy Markdown
Contributor

I'm getting a numpy comparison error when running test_mtc_extended.py (note that test_mtc.py seems to run just find)

Sorry about that, the setup I had was pointing to some other configs. This test should be passing now.

@dhensle

Copy link
Copy Markdown
Contributor

@e-lo I believe I have addressed all of your comments. I left a couple conversations open for you to sign off on. Thanks for your helpful comments and please let me know if there's anything else I missed.

Comment threadactivitysim/examples/example_mtc/configs/annotate_households.csv Outdated
@jfdman

Copy link
Copy Markdown

Have all comments been addressed? Please advise, we have several regions waiting to pull this model into their implementation. Thanks!

@guyrousseau

Copy link
Copy Markdown

@jfdman Since all vehicle make/model coding for the NHTS (since inception) maps to NHTSA’s FARS vehicle make/mode coding scheme [https://www.nhtsa.gov/research-data/fatality-analysis-reporting-system-fars], can you confirm that our vehicle type model conforms with NHTSA’s FARS?

@i-am-sijia

i-am-sijia commented Jun 6, 2022

Copy link
Copy Markdown
Member

Have all comments been addressed? Please advise, we have several regions waiting to pull this model into their implementation. Thanks!

Confirmed all previous comments are addressed. Guy's question is the only one left. Thanks.

@jpn--
jpn-- merged commit 367cbac into ActivitySim:developJun 6, 2022
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FeatureNew feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

create vehicle type model and add vehicle table to pipeline

10 participants

@mxndrwgrdnr@bstabler@coveralls@e-lo@dhensle@jfdman@guyrousseau@i-am-sijia@toliwaga@jpn--
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

🚀 [feat] vehicle type model - #486

Merged
jpn-- merged 44 commits into
ActivitySim:developfrom
mxndrwgrdnr:vehicle
Jun 6, 2022
Merged

🚀 [feat] vehicle type model#486
jpn-- merged 44 commits into
ActivitySim:developfrom
mxndrwgrdnr:vehicle

Conversation

@mxndrwgrdnr

@mxndrwgrdnrmxndrwgrdnr commented Sep 21, 2021

Copy link
Copy Markdown
Contributor

User Story

As a planner, I would like to understand the effects of vehicle type choice on travel behavior in order to support more detailed emissions analysis and more refined travel costs.

Requirements

Per https://github.com/ActivitySim/activitysim/wiki/Phase-6b-Scope-of-Work#task-2-vehicle-type-model

After applying this submodel, household vehicles should have the following properties:

  • vehicle type (e.g. auto, light-truck, etc)
  • capacity (# of people it can carry)
  • power train (ICE, hybrid, phev, etc)
  • range
  • age

In addition, each auto tour should be assigned the most likely household vehicles based on:

  • household
  • tour-characteristics
  • household vehicle attributes

*Note: For this task, vehicle allocation to auto tours should not consider the availability of each individual vehicles. *

The implementation should have the following usability features:

  • ability to read an input vehicle table, as opposed to create one during a model run, an initialize_vehicles submodel will be added that can read a vehicle table from CSV file, annotate it with custom expressions, ensure table keys are consistent with household IDs, and add it to the pipeline.
  • detailed technical documentation of all vehicle type and allocation models or methods.
  • updated users guide
  • tests covering the new methods
  • examples covering new methods

Approach

Model Estimation

  • estimate vehicle type model based on 5,000 household Bay Area TNC survey data
  • run the submodel with the existing example model
  • reasonably verify goodness-of-fit across key dimensions such as:
    • socio-demographics and
    • geography

Implementation

  • integrate method into the ActivitySim run stream.
  • develop method for allocating household-generated VMT to household vehicles
  • sensitivity tests

Issues

Fixes#438

@mxndrwgrdnr
mxndrwgrdnr marked this pull request as draft September 21, 2021 05:24
@bstabler

Copy link
Copy Markdown
Contributor

#438

@coveralls

coveralls commented Sep 21, 2021

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.5%) to 53.603% when pulling d556239 on mxndrwgrdnr:vehicle into 91930b5 on ActivitySim:develop.

@bstabler

Copy link
Copy Markdown
Contributor

@mxndrwgrdnr - can you adjust this PR to merge to develop? Thanks.

@mxndrwgrdnr
mxndrwgrdnr changed the base branch from master to developNovember 9, 2021 00:05
@mxndrwgrdnr
mxndrwgrdnr marked this pull request as ready for review November 12, 2021 22:52
@e-loe-lo added the Feature New feature or request label Dec 7, 2021
@e-loe-lo changed the title vehicle type model🚀 [feat] vehicle type modelDec 7, 2021
@e-loe-lo linked an issue Dec 7, 2021 that may be closed by this pull request

@e-loe-lo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally I found the code easy to read and it flowed well. There is a general lack of documentation including:

  • docstrings appropriately formatted for autodoc-ing
  • typehints
  • origin of model coefficients, what estimation are they from, etc
  • general documentation about capabilities
  • intra-activity sim links to documentation about general activitysim "things" (i.e. various formats, etc)

There is also a lack of tests for the specific unit of the vehicle type choice.

I also found it odd when running the MTC test example locally, that it didn't pick up the config? I suspect I'm doing something wrong but if I'm doing it wrong others might too (maybe?)

Comment threadactivitysim/abm/models/vehicle_type_choice.py
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/tables/vehicles.py
Comment threadactivitysim/abm/tables/vehicles.py
Comment threadactivitysim/abm/tables/vehicles.py
Comment threadactivitysim/examples/example_mtc/configs/free_parking.csv Outdated
Comment threadactivitysim/examples/example_mtc/configs/settings.yaml Outdated
@e-lo

e-lo commented Dec 8, 2021

Copy link
Copy Markdown
Collaborator

BTW I'll probably have more questions once I get the MTC example working on my local machine - i.e. is it annotating tours etc.

@jpn--
jpn-- requested a review from i-am-sijiaMay 5, 2022 13:53
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Car_8,.9541,0.0096,0.0355,0.0007,0.0000
Car_9,.9548,0.0037,0.0409,0.0004,0.0001
Car_10,0.9530,0.0015,0.0451,0.0003,0.0001
Car_11,0.9676,0.0096,0.0225,0.0003,0.0000

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems as though some amount of "smoothing" would make sense here between the years. Many of the numbers for the lower-probability options go back and forth between 0 and >0 several times.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, these probabilities are "lumpy". This is due to the fact that they came directly from the National Household Travel Survey data. A comment about the "lumpy-ness" was added to the models.rst vehicle type choice documentation encouraging the user to change the probabilities to their region and smooth them as they see fit. Additional links in the documentation point to the presented results and sensitivity studies.

So, I suggest we leave the probabilities as is in the context of this pull request for the purpose of simplicity and transparency.

config.config_file_path(vehicle_type_data_file), comment='#')
fleet_year = model_settings.get('FLEET_YEAR')

vehicle_type_data['age'] = (1 + fleet_year - vehicle_type_data['vehicle_year']).astype(str)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to make sense that we would be able to imply a variation in fuel type based on vehicle age. However, in this case age isn't necessarily relative. A 10 year old car in a 2030 scenario should be equal to a 2 year old car in 2022.

I'm trying to figure out how this is accommodated within the probabilities but can't seem to find anywhere that this is done?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this wasn't done very consistently... I changed the probabilities file to include this same calculation -- the probabilities file now includes body_type and vehicle_year columns just like the vehicle_type_data.csv file and age is explicitly calculated based on the user input fleet_year.

Comment threadactivitysim/abm/models/vehicle_allocation.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_allocation.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py
Comment threadactivitysim/abm/models/vehicle_type_choice.py
logger = logging.getLogger(__name__)


def get_combinatorial_vehicle_alternatives(alts_cats_dict, model_settings):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest adding a unit test for this function.

@dhensledhensleMay 24, 2022

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done. See the abm/test/test_misc/test_vehicle_type_alternatives.py script. Also cleaned up the function to remove model settings and make it better for a stand-alone unit test.

Comment threadactivitysim/abm/models/vehicle_type_choice.py
choosers=choosers,
alternatives=alts_wide,
spec=model_spec,
log_alt_losers=log_alt_losers,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something to consider more holistically in activitysim: most of these function calls seem to require 5-10 parameters.

Many best practices call for <= 3.

All the parameters which relate to run settings (e.g. chunk size, trace label, trace choice name) and not "substance" (e.g. alternatives, estimator, chooser) get in the way of legibility of what is happening.

Don't get me wrong - I love being explicit about things - but I would consider bundling some of these things in a config class that gets passed around or something similar.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is something we have been actively discussing as a consortium. I think making changes to this affect is outside the scope of this pull request though.

Comment threadactivitysim/abm/tables/vehicles.py Outdated
vehicles['vehicle_id'] = vehicles.household_id * 10 + vehicles.vehicle_num
vehicles.set_index('vehicle_id', inplace = True)

# I do not understand why this line is necessary, it seems circular

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should figure this out before merging

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the purpose of this line is to replace the "table" function with the dataframe. Added comment to reflect this just like in persons and households. This is just a consequence of how the inject table decorator and add_table functions were constructed.

@e-lo

e-lo commented May 13, 2022

Copy link
Copy Markdown
Collaborator

I'm getting a numpy comparison error when running test_mtc_extended.py (note that test_mtc.py seems to run just find)

Erroring at:

File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line286, inassign_variablesexpr_values=to_series(eval(expression, globals_dict, _locals_dict))
File"<string>", line1, in<module>FutureWarning: elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparison

Numpy version: v1.21

Note I scanned the code where it seems like somebody was trying to get this to just warn not error - but it doesn't seem to be working as run for some reason. I haven't troubleshot too much yet - thought I'd post in case it is a known issue.

Full Trace

---------------------------------------------------------------Capturedstdoutcall----------------------------------------------------------------ConfiguredloggingusingbasicConfigINFO:activitysim:ConfiguredloggingusingbasicConfigINFO-Readloggingconfigurationfrom: /Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/configs/logging.yamlINFO-SETTINGconfigs_dir: ['/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/test/configs', '/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/configs', '/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/configs']
INFO-SETTINGsettings_file_name: settings.yamlINFO-SETTINGdata_dir: ['/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data']
INFO-SETTINGoutput_dir: /Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/test/outputINFO-SETTINGhouseholds_sample_size: 10INFO-SETTINGchunk_size: 0INFO-SETTINGchunk_method: hybrid_ussINFO-SETTINGchunk_training_mode: disabledINFO-SETTINGmultiprocess: NoneINFO-SETTINGnum_processes: NoneINFO-SETTINGresume_after: NoneINFO-SETTINGtrace_hh_id: NoneINFO-ENVMKL_NUM_THREADS: NoneINFO-ENVOMP_NUM_THREADS: NoneINFO-ENVOPENBLAS_NUM_THREADS: NoneINFO-NUMPYblas_infolibraries: ['cblas', 'blas', 'cblas', 'blas']
INFO-NUMPYblas_opt_infolibraries: ['cblas', 'blas', 'cblas', 'blas']
INFO-NUMPYlapack_infolibraries: ['lapack', 'blas', 'lapack', 'blas']
INFO-NUMPYlapack_opt_infolibraries: ['lapack', 'blas', 'lapack', 'blas', 'cblas', 'blas', 'cblas', 'blas']
INFO-runsingleprocesssimulationINFO-Timetoexecuteopen_pipeline : 0.062seconds (0.0minutes)
INFO-preload_injectablesINFO-Timetoexecutepreload_injectables : 0.014seconds (0.0minutes)
INFO-#run_model running step initialize_landuseRunningstep'initialize_landuse'INFO-ReadingCSVfile/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/land_use.csvINFO-loadedland_use (25, 24)
INFO-initialize_landuse.annotate_tables-annotatingland_useSPECannotate_landuseINFO-Network_LOSusingskim_dict_factory: NumpyArraySkimFactoryINFO-allocate_skim_buffersharedFalsetazshape (826, 25, 25) totalsize: 2_065_000 (2.1MB)
INFO-_read_skims_from_omx/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/skims.omxINFO-_read_skims_from_omxloaded826skimsfrom/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/skims.omxINFO-writingskimcachetaz (826, 25, 25) to/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/test/output/cache/cached_taz.mmapINFO-load_skims_to_buffertazshape (826, 25, 25)
INFO-get_skim_datatazSkimDatashape (826, 25, 25)
INFO-SkimDictinittazINFO-SkimDict.build_3d_skim_block_offset_tableregistered1673dkeysTimetoexecutestep'initialize_landuse': 1.82sTotaltimetoexecuteiteration1withiterationvalueNone: 1.82sINFO-#run_model running step initialize_householdsRunningstep'initialize_households'INFO-ReadingCSVfile/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/households.csvINFO-fullhouseholdlistcontains5000householdsINFO-sampling10of5000householdsINFO-loadedhouseholds (10, 7)
INFO-ReadingCSVfile/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/persons.csvINFO-loadedpersons (28, 7)
INFO-initialize_households.annotate_tables-annotatingpersonsSPECannotate_personsINFO-initialize_households.annotate_tables-annotatinghouseholdsSPECannotate_householdsINFO-initialize_households.annotate_tables-annotatingpersonsSPECannotate_persons_after_hhTimetoexecutestep'initialize_households': 0.37sTotaltimetoexecuteiteration1withiterationvalueNone: 0.37sINFO-#run_model running step compute_accessibilityRunningstep'compute_accessibility'INFO-Runningcompute_accessibilitywith25origzones25destzonesINFO-compute_accessibilityRunningadaptive_chunked_chooserswith25choosersINFO-Runningchunk1of1with25of25choosersINFO-Runningcompute_accessibilitywith25origzones25destzonesINFO-compute_accessibilitycomputedaccessibilities (25, 10)
Timetoexecutestep'compute_accessibility': 0.06sTotaltimetoexecuteiteration1withiterationvalueNone: 0.06sINFO-#run_model running step school_locationRunningstep'school_location'INFO-Runningschool_location.i1.sample.universitywith4personsINFO-school_location.i1.sample.university.interaction_sampleRunningadaptive_chunked_chooserswith4choosersINFO-Runningchunk1of1with4of4choosersINFO-Runningeval_interaction_utilitieson24rowsINFO-Runningschool_location.i1.logsums.universitywith11rowsERROR-assign_variables-FutureWarning (elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparison) evaluating: np.where(sov_auto_op_cost.isna() | (sov_veh_option=='non_hh_veh'), costPerMile, sov_auto_op_cost)
numpy.core._exceptions._UFuncInputCastingError: Cannotcastufunc'equal'input1fromdtype('<U10') todtype('float64') withcastingrule'same_kind'Theaboveexceptionwasthedirectcauseofthefollowingexception:
Traceback (mostrecentcalllast):
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line286, inassign_variablesexpr_values=to_series(eval(expression, globals_dict, _locals_dict))
File"<string>", line1, in<module>FutureWarning: elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparisonINFO-Timetoexecuteallmodelsuntilthiserror : 2.814seconds (0.0minutes)
ERROR-activitysimrunencounteredanunrecoverableerrornumpy.core._exceptions._UFuncInputCastingError: Cannotcastufunc'equal'input1fromdtype('<U10') todtype('float64') withcastingrule'same_kind'Theaboveexceptionwasthedirectcauseofthefollowingexception:
Traceback (mostrecentcalllast):
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/cli/run.py", line260, inrunpipeline.run(models=config.setting('models'), resume_after=resume_after)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/pipeline.py", line617, inrunrun_model(model)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/pipeline.py", line476, inrun_modelorca.run([step_name])
File"/Users/elizabeth/opt/miniconda3/envs/asim/lib/python3.9/site-packages/orca/orca.py", line2168, inrunstep()
File"/Users/elizabeth/opt/miniconda3/envs/asim/lib/python3.9/site-packages/orca/orca.py", line973, in__call__returnself._func(**kwargs)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line920, inschool_locationiterate_location_choice(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line774, initerate_location_choicechoices_df, save_sample_df=run_location_choice(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line619, inrun_location_choicerun_location_logsums(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line438, inrun_location_logsumslogsums=logsum.compute_logsums(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/util/logsums.py", line142, incompute_logsumsexpressions.assign_columns(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/expressions.py", line124, inassign_columnsresults=compute_columns(df, model_settings, locals_dict, trace_label)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/expressions.py", line95, incompute_columns=assign.assign_variables(expressions_spec,
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line298, inassign_variablesraiseerrFile"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line286, inassign_variablesexpr_values=to_series(eval(expression, globals_dict, _locals_dict))
File"<string>", line1, in<module>FutureWarning: elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparison---------------------------------------------------------------Capturedstderrcall----------------------------------------------------------------numpy.core._exceptions._UFuncInputCastingError: Cannotcastufunc'equal'input1fromdtype('<U10') todtype('float64') withcastingrule'same_kind'Theaboveexceptionwasthedirectcauseofthefollowingexception:
Traceback (mostrecentcalllast):
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/test/simulation.py", line15, in<module>sys.exit(run(args))
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/cli/run.py", line260, inrunpipeline.run(models=config.setting('models'), resume_after=resume_after)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/pipeline.py", line617, inrunrun_model(model)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/pipeline.py", line476, inrun_modelorca.run([step_name])
File"/Users/elizabeth/opt/miniconda3/envs/asim/lib/python3.9/site-packages/orca/orca.py", line2168, inrunstep()
File"/Users/elizabeth/opt/miniconda3/envs/asim/lib/python3.9/site-packages/orca/orca.py", line973, in__call__returnself._func(**kwargs)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line920, inschool_locationiterate_location_choice(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line774, initerate_location_choicechoices_df, save_sample_df=run_location_choice(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line619, inrun_location_choicerun_location_logsums(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line438, inrun_location_logsumslogsums=logsum.compute_logsums(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/util/logsums.py", line142, incompute_logsumsexpressions.assign_columns(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/expressions.py", line124, inassign_columnsresults=compute_columns(df, model_settings, locals_dict, trace_label)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/expressions.py", line95, incompute_columns=assign.assign_variables(expressions_spec,
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line298, inassign_variablesraiseerrFile"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line286, inassign_variablesexpr_values=to_series(eval(expression, globals_dict, _locals_dict))
File"<string>", line1, in<module>FutureWarning: elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparison

Conda List

# packages in environment at /Users/elizabeth/opt/miniconda3/envs/asim:
#
# Name Version Build Channel
abseil-cpp 20210324.2 he49afe7_0 conda-forge
activitysim 1.0.3 dev_0 <develop>
appnope 0.1.3 pyhd8ed1ab_0 conda-forge
argon2-cffi 21.3.0 pyhd8ed1ab_0 conda-forge
argon2-cffi-bindings 21.2.0 py39h63b48b0_2 conda-forge
arrow-cpp 8.0.0 py39hfe23411_0_cpu conda-forge
asttokens 2.0.5 pyhd8ed1ab_0 conda-forge
attrs 21.4.0 pyhd8ed1ab_0 conda-forge
aws-c-cal 0.5.11 hd2e2f4b_0 conda-forge
aws-c-common 0.6.2 h0d85af4_0 conda-forge
aws-c-event-stream 0.2.7 hb9330a7_13 conda-forge
aws-c-io 0.10.5 h35aa462_0 conda-forge
aws-checksums 0.1.11 h0010a65_7 conda-forge
aws-sdk-cpp 1.8.186 h766a74d_3 conda-forge
backcall 0.2.0 pyh9f0ad1d_0 conda-forge
backports 1.0 py_2 conda-forge
backports.functools_lru_cache 1.6.4 pyhd8ed1ab_0 conda-forge
beautifulsoup4 4.11.1 pyha770c72_0 conda-forge
bleach 5.0.0 pyhd8ed1ab_0 conda-forge
blosc 1.21.1 h97e831e_2 conda-forge
boost-cpp 1.74.0 hdbf7018_7 conda-forge
branca 0.5.0 pyhd8ed1ab_0 conda-forge
brotli 1.0.9 h5eb16cf_7 conda-forge
brotli-bin 1.0.9 h5eb16cf_7 conda-forge
brotlipy 0.7.0 py39h63b48b0_1004 conda-forge
bump2version 1.0.1 pyh9f0ad1d_0 conda-forge
bzip2 1.0.8 h0d85af4_4 conda-forge
c-ares 1.18.1 h0d85af4_0 conda-forge
ca-certificates 2021.10.8 h033912b_0 conda-forge
cairo 1.16.0 h9e0e54b_1010 conda-forge
certifi 2021.10.8 py39h6e9494a_2 conda-forge
cffi 1.15.0 py39he338e87_0 conda-forge
cfitsio 4.1.0 h2c97ad1_0 conda-forge
charset-normalizer 2.0.12 pyhd8ed1ab_0 conda-forge
click 8.1.3 py39h6e9494a_0 conda-forge
click-plugins 1.1.1 py_0 conda-forge
cligj 0.7.2 pyhd8ed1ab_1 conda-forge
coverage 6.3.2 py39h63b48b0_2 conda-forge
coveralls 3.3.1 pyhd8ed1ab_0 conda-forge
cryptography 36.0.2 py39h1644bb1_1 conda-forge
curl 7.83.1 h372c54d_0 conda-forge
cycler 0.11.0 pyhd8ed1ab_0 conda-forge
cytoolz 0.11.2 py39h63b48b0_2 conda-forge
dbus 1.13.6 h811a1a6_3 conda-forge
debugpy 1.6.0 py39hfd1d529_0 conda-forge
decorator 5.1.1 pyhd8ed1ab_0 conda-forge
defusedxml 0.7.1 pyhd8ed1ab_0 conda-forge
descartes 1.1.0 py_4 conda-forge
docopt 0.6.2 py_1 conda-forge
entrypoints 0.4 pyhd8ed1ab_0 conda-forge
executing 0.8.3 pyhd8ed1ab_0 conda-forge
expat 2.4.8 h96cf925_0 conda-forge
fiona 1.8.21 py39h6d65ddd_1 conda-forge
flask 2.1.2 pyhd8ed1ab_1 conda-forge
flit-core 3.7.1 pyhd8ed1ab_0 conda-forge
folium 0.12.1.post1 pyhd8ed1ab_1 conda-forge
font-ttf-dejavu-sans-mono 2.37 hab24e00_0 conda-forge
font-ttf-inconsolata 3.000 h77eed37_0 conda-forge
font-ttf-source-code-pro 2.038 h77eed37_0 conda-forge
font-ttf-ubuntu 0.83 hab24e00_0 conda-forge
fontconfig 2.14.0 h676cef8_0 conda-forge
fonts-conda-ecosystem 1 0 conda-forge
fonts-conda-forge 1 0 conda-forge
fonttools 4.33.3 py39h701faf5_0 conda-forge
freetype 2.10.4 h4cff582_1 conda-forge
freexl 1.0.6 h0d85af4_0 conda-forge
gdal 3.4.2 py39h97b4846_7 conda-forge
geopandas 0.10.2 pyhd8ed1ab_1 conda-forge
geopandas-base 0.10.2 pyha770c72_1 conda-forge
geos 3.10.2 he49afe7_0 conda-forge
geotiff 1.7.1 had63758_1 conda-forge
gettext 0.19.8.1 hd1a6beb_1008 conda-forge
gflags 2.2.2 hb1e8313_1004 conda-forge
gh 2.10.1 h990441c_0 conda-forge
giflib 5.2.1 hbcb3906_2 conda-forge
git 2.35.3 pl5321h33a4a8a_0 conda-forge
glog 0.6.0 h8ac2a54_0 conda-forge
grpc-cpp 1.43.2 ha04666b_3 conda-forge
hdf4 4.2.15 hefd3b78_3 conda-forge
hdf5 1.12.1 nompi_ha60fbc9_104 conda-forge
icu 69.1 he49afe7_0 conda-forge
idna 3.3 pyhd8ed1ab_0 conda-forge
importlib-metadata 4.11.3 py39h6e9494a_1 conda-forge
importlib_resources 5.7.1 pyhd8ed1ab_0 conda-forge
iniconfig 1.1.1 pyh9f0ad1d_0 conda-forge
ipykernel 6.13.0 py39h71a6800_0 conda-forge
ipython 8.3.0 py39h6e9494a_0 conda-forge
ipython_genutils 0.2.0 py_1 conda-forge
ipywidgets 7.7.0 pyhd8ed1ab_0 conda-forge
itsdangerous 2.1.2 pyhd8ed1ab_0 conda-forge
jbig 2.1 h0d85af4_2003 conda-forge
jedi 0.18.1 py39h6e9494a_1 conda-forge
jinja2 3.1.2 pyhd8ed1ab_0 conda-forge
joblib 1.1.0 pyhd8ed1ab_0 conda-forge
jpeg 9e h5eb16cf_1 conda-forge
json-c 0.16 h01d06f9_0 conda-forge
jsonschema 4.5.1 pyhd8ed1ab_0 conda-forge
jupyter 1.0.0 py39h6e9494a_7 conda-forge
jupyter_client 7.3.1 pyhd8ed1ab_0 conda-forge
jupyter_console 6.4.3 pyhd8ed1ab_0 conda-forge
jupyter_core 4.10.0 py39h6e9494a_0 conda-forge
jupyterlab_pygments 0.2.2 pyhd8ed1ab_0 conda-forge
jupyterlab_widgets 1.1.0 pyhd8ed1ab_0 conda-forge
kealib 1.4.14 ha22a8b1_3 conda-forge
kiwisolver 1.4.2 py39h7248d28_1 conda-forge
krb5 1.19.3 hb49756b_0 conda-forge
lcms2 2.12 h577c468_0 conda-forge
lerc 3.0 he49afe7_0 conda-forge
libblas 3.9.0 14_osx64_openblas conda-forge
libbrotlicommon 1.0.9 h5eb16cf_7 conda-forge
libbrotlidec 1.0.9 h5eb16cf_7 conda-forge
libbrotlienc 1.0.9 h5eb16cf_7 conda-forge
libcblas 3.9.0 14_osx64_openblas conda-forge
libclang 13.0.1 default_he082bbe_0 conda-forge
libcrc32c 1.1.2 he49afe7_0 conda-forge
libcurl 7.83.1 h372c54d_0 conda-forge
libcxx 14.0.3 hc203e6f_0 conda-forge
libdap4 3.20.6 h3e144a0_2 conda-forge
libdeflate 1.10 h0d85af4_0 conda-forge
libedit 3.1.20191231 h0678c8f_2 conda-forge
libev 4.33 haf1e3a3_1 conda-forge
libevent 2.1.10 h815e4d9_4 conda-forge
libffi 3.4.2 h0d85af4_5 conda-forge
libgdal 3.4.2 h6474519_7 conda-forge
libgfortran 5.0.0 9_3_0_h6c81a4c_23 conda-forge
libgfortran5 9.3.0 h6c81a4c_23 conda-forge
libglib 2.70.2 hf1fb8c0_4 conda-forge
libgoogle-cloud 1.36.0 h52a585b_0 conda-forge
libiconv 1.16 haf1e3a3_0 conda-forge
libkml 1.3.0 h8fd9edb_1014 conda-forge
liblapack 3.9.0 14_osx64_openblas conda-forge
libllvm11 11.1.0 hd011deb_3 conda-forge
libllvm13 13.0.1 h64f94b2_2 conda-forge
libnetcdf 4.8.1 nompi_h6609ca0_102 conda-forge
libnghttp2 1.47.0 h942079c_0 conda-forge
libopenblas 0.3.20 openmp_hb3cd9ec_0 conda-forge
libpng 1.6.37 h7cec526_2 conda-forge
libpq 14.2 hea3049e_0 conda-forge
libprotobuf 3.19.4 hcf210ce_0 conda-forge
librttopo 1.1.0 hec60dd8_9 conda-forge
libsodium 1.0.18 hbcb3906_1 conda-forge
libspatialindex 1.9.3 he49afe7_4 conda-forge
libspatialite 5.0.1 hadde3e2_15 conda-forge
libssh2 1.10.0 h52ee1ee_2 conda-forge
libthrift 0.16.0 h9702cd6_1 conda-forge
libtiff 4.3.0 h17f2ce3_3 conda-forge
libutf8proc 2.7.0 h0d85af4_0 conda-forge
libwebp 1.2.2 h28dabe5_0 conda-forge
libwebp-base 1.2.2 h0d85af4_1 conda-forge
libxcb 1.13 h0d85af4_1004 conda-forge
libxml2 2.9.12 h7e28ab6_1 conda-forge
libzip 1.8.0 h8b0c345_1 conda-forge
libzlib 1.2.11 h6c3fc93_1014 conda-forge
llvm-openmp 14.0.3 ha654fa7_0 conda-forge
llvmlite 0.38.0 py39ha9d9895_1 conda-forge
lz4-c 1.9.3 he49afe7_1 conda-forge
mapclassify 2.4.3 pyhd8ed1ab_0 conda-forge
markupsafe 2.1.1 py39h63b48b0_1 conda-forge
matplotlib 3.5.2 py39h6e9494a_0 conda-forge
matplotlib-base 3.5.2 py39h64a0072_0 conda-forge
matplotlib-inline 0.1.3 pyhd8ed1ab_0 conda-forge
mistune 0.8.4 py39h89e85a6_1005 conda-forge
munch 2.5.0 py_0 conda-forge
munkres 1.1.4 pyh9f0ad1d_0 conda-forge
mysql-common 8.0.29 h924029e_0 conda-forge
mysql-libs 8.0.29 h3cab752_0 conda-forge
nbclient 0.6.3 pyhd8ed1ab_0 conda-forge
nbconvert 6.5.0 pyhd8ed1ab_0 conda-forge
nbconvert-core 6.5.0 pyhd8ed1ab_0 conda-forge
nbconvert-pandoc 6.5.0 pyhd8ed1ab_0 conda-forge
nbformat 5.4.0 pyhd8ed1ab_0 conda-forge
ncurses 6.3 h96cf925_1 conda-forge
nest-asyncio 1.5.5 pyhd8ed1ab_0 conda-forge
networkx 2.8 pyhd8ed1ab_0 conda-forge
notebook 6.4.11 pyha770c72_0 conda-forge
nspr 4.32 hcd9eead_1 conda-forge
nss 3.77 hfce436b_0 conda-forge
numba 0.55.1 py39hc37845d_1 conda-forge
numexpr 2.8.0 py39hbd61c47_2 conda-forge
numpy 1.21.6 py39hf56e92f_0 conda-forge
openjpeg 2.4.0 h6e7aa92_1 conda-forge
openmatrix 0.3.5.0 pyhd8ed1ab_0 conda-forge
openssl 1.1.1o hfe4f2af_0 conda-forge
orc 1.7.3 h84518c8_0 conda-forge
orca 1.6 pyhd8ed1ab_0 conda-forge
packaging 21.3 pyhd8ed1ab_0 conda-forge
pandas 1.4.2 py39hbd61c47_1 conda-forge
pandoc 2.18 h694c41f_0 conda-forge
pandocfilters 1.5.0 pyhd8ed1ab_0 conda-forge
parquet-cpp 1.5.1 2 conda-forge
parso 0.8.3 pyhd8ed1ab_0 conda-forge
pcre 8.45 he49afe7_0 conda-forge
pcre2 10.37 ha16e1b2_0 conda-forge
perl 5.32.1 2_h0d85af4_perl5 conda-forge
pexpect 4.8.0 pyh9f0ad1d_2 conda-forge
pickleshare 0.7.5 py_1003 conda-forge
pillow 9.1.0 py39hd2c7aa1_2 conda-forge
pip 22.1 pyhd8ed1ab_0 conda-forge
pixman 0.40.0 hbcb3906_0 conda-forge
pluggy 1.0.0 py39h6e9494a_3 conda-forge
poppler 22.04.0 h39497b0_0 conda-forge
poppler-data 0.4.11 hd8ed1ab_0 conda-forge
postgresql 14.2 he8fe76e_0 conda-forge
proj 9.0.0 h2364a93_1 conda-forge
prometheus_client 0.14.1 pyhd8ed1ab_0 conda-forge
prompt-toolkit 3.0.29 pyha770c72_0 conda-forge
prompt_toolkit 3.0.29 hd8ed1ab_0 conda-forge
psutil 5.9.0 py39h63b48b0_1 conda-forge
pthread-stubs 0.4 hc929b4f_1001 conda-forge
ptyprocess 0.7.0 pyhd3deb0d_0 conda-forge
pure_eval 0.2.2 pyhd8ed1ab_0 conda-forge
py 1.11.0 pyh6c4a22f_0 conda-forge
pyarrow 8.0.0 py39hb9688c1_0_cpu conda-forge
pycodestyle 2.8.0 pyhd8ed1ab_0 conda-forge
pycparser 2.21 pyhd8ed1ab_0 conda-forge
pygments 2.12.0 pyhd8ed1ab_0 conda-forge
pyopenssl 22.0.0 pyhd8ed1ab_0 conda-forge
pyparsing 3.0.9 pyhd8ed1ab_0 conda-forge
pyproj 3.3.1 py39hfe197cf_0 conda-forge
pyqt 5.12.3 py39h9d385e7_4 conda-forge
pyqt5-sip 4.19.18 pypi_0 pypi
pyqtchart 5.12 pypi_0 pypi
pyqtwebengine 5.12.1 pypi_0 pypi
pyrsistent 0.18.1 py39h63b48b0_1 conda-forge
pysocks 1.7.1 py39h6e9494a_5 conda-forge
pytest 7.1.2 py39h6e9494a_0 conda-forge
pytest-cov 3.0.0 pyhd8ed1ab_0 conda-forge
pytest-datadir 1.3.1 py_0 conda-forge
pytest-regressions 2.3.1 pyhd8ed1ab_0 conda-forge
python 3.9.12 h8b4d769_1_cpython conda-forge
python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge
python-fastjsonschema 2.15.3 pyhd8ed1ab_0 conda-forge
python_abi 3.9 2_cp39 conda-forge
pytz 2022.1 pyhd8ed1ab_0 conda-forge
pyyaml 6.0 py39h63b48b0_4 conda-forge
pyzmq 22.3.0 py39hc2dc7ec_2 conda-forge
qt 5.12.9 h2a607e2_5 conda-forge
qtconsole 5.3.0 pyhd8ed1ab_0 conda-forge
qtconsole-base 5.3.0 pyhd8ed1ab_0 conda-forge
qtpy 2.1.0 pyhd8ed1ab_0 conda-forge
re2 2022.02.01 he49afe7_0 conda-forge
readline 8.1 h05e3726_0 conda-forge
requests 2.27.1 pyhd8ed1ab_0 conda-forge
rtree 1.0.0 py39h7d0d40a_1 conda-forge
scikit-learn 1.0.2 py39hd4eea88_0 conda-forge
scipy 1.8.0 py39h056f1c0_1 conda-forge
send2trash 1.8.0 pyhd8ed1ab_0 conda-forge
setuptools 62.2.0 py39h6e9494a_0 conda-forge
shapely 1.8.2 py39hd471b09_1 conda-forge
six 1.16.0 pyh6c4a22f_0 conda-forge
snappy 1.1.9 h6e38e02_0 conda-forge
soupsieve 2.3.1 pyhd8ed1ab_0 conda-forge
sqlite 3.38.5 hd9f0692_0 conda-forge
stack_data 0.2.0 pyhd8ed1ab_0 conda-forge
tables 3.6.1 pypi_0 pypi
terminado 0.13.3 py39h6e9494a_1 conda-forge
threadpoolctl 3.1.0 pyh8a188c0_0 conda-forge
tiledb 2.8.2 hf17dc58_0 conda-forge
tinycss2 1.1.1 pyhd8ed1ab_0 conda-forge
tk 8.6.12 h5dbffcc_0 conda-forge
toml 0.10.2 pyhd8ed1ab_0 conda-forge
tomli 2.0.1 pyhd8ed1ab_0 conda-forge
toolz 0.11.2 pyhd8ed1ab_0 conda-forge
tornado 6.1 py39h63b48b0_3 conda-forge
traitlets 5.2.0 pyhd8ed1ab_0 conda-forge
tzcode 2022a h5eb16cf_0 conda-forge
tzdata 2022a h191b570_0 conda-forge
unicodedata2 14.0.0 py39h63b48b0_1 conda-forge
urllib3 1.26.9 pyhd8ed1ab_0 conda-forge
wcwidth 0.2.5 pyh9f0ad1d_2 conda-forge
webencodings 0.5.1 py_1 conda-forge
werkzeug 2.1.2 pyhd8ed1ab_1 conda-forge
wheel 0.37.1 pyhd8ed1ab_0 conda-forge
widgetsnbextension 3.6.0 py39h6e9494a_0 conda-forge
xerces-c 3.2.3 h6564042_4 conda-forge
xorg-libxau 1.0.9 h35c211d_0 conda-forge
xorg-libxdmcp 1.1.3 h35c211d_0 conda-forge
xyzservices 2022.4.0 pyhd8ed1ab_0 conda-forge
xz 5.2.5 haf1e3a3_1 conda-forge
yaml 0.2.5 h0d85af4_2 conda-forge
zeromq 4.3.4 he49afe7_1 conda-forge
zipp 3.8.0 pyhd8ed1ab_0 conda-forge
zlib 1.2.11 h6c3fc93_1014 conda-forge
zstd 1.5.2 h582d3a0_0 conda-forge

@dhensle

Copy link
Copy Markdown
Contributor

I'm getting a numpy comparison error when running test_mtc_extended.py (note that test_mtc.py seems to run just find)

Sorry about that, the setup I had was pointing to some other configs. This test should be passing now.

@dhensle

Copy link
Copy Markdown
Contributor

@e-lo I believe I have addressed all of your comments. I left a couple conversations open for you to sign off on. Thanks for your helpful comments and please let me know if there's anything else I missed.

Comment threadactivitysim/examples/example_mtc/configs/annotate_households.csv Outdated
@jfdman

Copy link
Copy Markdown

Have all comments been addressed? Please advise, we have several regions waiting to pull this model into their implementation. Thanks!

@guyrousseau

Copy link
Copy Markdown

@jfdman Since all vehicle make/model coding for the NHTS (since inception) maps to NHTSA’s FARS vehicle make/mode coding scheme [https://www.nhtsa.gov/research-data/fatality-analysis-reporting-system-fars], can you confirm that our vehicle type model conforms with NHTSA’s FARS?

@i-am-sijia

i-am-sijia commented Jun 6, 2022

Copy link
Copy Markdown
Member

Have all comments been addressed? Please advise, we have several regions waiting to pull this model into their implementation. Thanks!

Confirmed all previous comments are addressed. Guy's question is the only one left. Thanks.

@jpn--
jpn-- merged commit 367cbac into ActivitySim:developJun 6, 2022
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FeatureNew feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

create vehicle type model and add vehicle table to pipeline

10 participants

@mxndrwgrdnr@bstabler@coveralls@e-lo@dhensle@jfdman@guyrousseau@i-am-sijia@toliwaga@jpn--
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

🚀 [feat] vehicle type model - #486

Merged
jpn-- merged 44 commits into
ActivitySim:developfrom
mxndrwgrdnr:vehicle
Jun 6, 2022
Merged

🚀 [feat] vehicle type model#486
jpn-- merged 44 commits into
ActivitySim:developfrom
mxndrwgrdnr:vehicle

Conversation

@mxndrwgrdnr

@mxndrwgrdnrmxndrwgrdnr commented Sep 21, 2021

Copy link
Copy Markdown
Contributor

User Story

As a planner, I would like to understand the effects of vehicle type choice on travel behavior in order to support more detailed emissions analysis and more refined travel costs.

Requirements

Per https://github.com/ActivitySim/activitysim/wiki/Phase-6b-Scope-of-Work#task-2-vehicle-type-model

After applying this submodel, household vehicles should have the following properties:

  • vehicle type (e.g. auto, light-truck, etc)
  • capacity (# of people it can carry)
  • power train (ICE, hybrid, phev, etc)
  • range
  • age

In addition, each auto tour should be assigned the most likely household vehicles based on:

  • household
  • tour-characteristics
  • household vehicle attributes

*Note: For this task, vehicle allocation to auto tours should not consider the availability of each individual vehicles. *

The implementation should have the following usability features:

  • ability to read an input vehicle table, as opposed to create one during a model run, an initialize_vehicles submodel will be added that can read a vehicle table from CSV file, annotate it with custom expressions, ensure table keys are consistent with household IDs, and add it to the pipeline.
  • detailed technical documentation of all vehicle type and allocation models or methods.
  • updated users guide
  • tests covering the new methods
  • examples covering new methods

Approach

Model Estimation

  • estimate vehicle type model based on 5,000 household Bay Area TNC survey data
  • run the submodel with the existing example model
  • reasonably verify goodness-of-fit across key dimensions such as:
    • socio-demographics and
    • geography

Implementation

  • integrate method into the ActivitySim run stream.
  • develop method for allocating household-generated VMT to household vehicles
  • sensitivity tests

Issues

Fixes#438

@mxndrwgrdnr
mxndrwgrdnr marked this pull request as draft September 21, 2021 05:24
@bstabler

Copy link
Copy Markdown
Contributor

#438

@coveralls

coveralls commented Sep 21, 2021

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.5%) to 53.603% when pulling d556239 on mxndrwgrdnr:vehicle into 91930b5 on ActivitySim:develop.

@bstabler

Copy link
Copy Markdown
Contributor

@mxndrwgrdnr - can you adjust this PR to merge to develop? Thanks.

@mxndrwgrdnr
mxndrwgrdnr changed the base branch from master to developNovember 9, 2021 00:05
@mxndrwgrdnr
mxndrwgrdnr marked this pull request as ready for review November 12, 2021 22:52
@e-loe-lo added the Feature New feature or request label Dec 7, 2021
@e-loe-lo changed the title vehicle type model🚀 [feat] vehicle type modelDec 7, 2021
@e-loe-lo linked an issue Dec 7, 2021 that may be closed by this pull request

@e-loe-lo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally I found the code easy to read and it flowed well. There is a general lack of documentation including:

  • docstrings appropriately formatted for autodoc-ing
  • typehints
  • origin of model coefficients, what estimation are they from, etc
  • general documentation about capabilities
  • intra-activity sim links to documentation about general activitysim "things" (i.e. various formats, etc)

There is also a lack of tests for the specific unit of the vehicle type choice.

I also found it odd when running the MTC test example locally, that it didn't pick up the config? I suspect I'm doing something wrong but if I'm doing it wrong others might too (maybe?)

Comment threadactivitysim/abm/models/vehicle_type_choice.py
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/tables/vehicles.py
Comment threadactivitysim/abm/tables/vehicles.py
Comment threadactivitysim/abm/tables/vehicles.py
Comment threadactivitysim/examples/example_mtc/configs/free_parking.csv Outdated
Comment threadactivitysim/examples/example_mtc/configs/settings.yaml Outdated
@e-lo

e-lo commented Dec 8, 2021

Copy link
Copy Markdown
Collaborator

BTW I'll probably have more questions once I get the MTC example working on my local machine - i.e. is it annotating tours etc.

@jpn--
jpn-- requested a review from i-am-sijiaMay 5, 2022 13:53
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Car_8,.9541,0.0096,0.0355,0.0007,0.0000
Car_9,.9548,0.0037,0.0409,0.0004,0.0001
Car_10,0.9530,0.0015,0.0451,0.0003,0.0001
Car_11,0.9676,0.0096,0.0225,0.0003,0.0000

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems as though some amount of "smoothing" would make sense here between the years. Many of the numbers for the lower-probability options go back and forth between 0 and >0 several times.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, these probabilities are "lumpy". This is due to the fact that they came directly from the National Household Travel Survey data. A comment about the "lumpy-ness" was added to the models.rst vehicle type choice documentation encouraging the user to change the probabilities to their region and smooth them as they see fit. Additional links in the documentation point to the presented results and sensitivity studies.

So, I suggest we leave the probabilities as is in the context of this pull request for the purpose of simplicity and transparency.

config.config_file_path(vehicle_type_data_file), comment='#')
fleet_year = model_settings.get('FLEET_YEAR')

vehicle_type_data['age'] = (1 + fleet_year - vehicle_type_data['vehicle_year']).astype(str)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to make sense that we would be able to imply a variation in fuel type based on vehicle age. However, in this case age isn't necessarily relative. A 10 year old car in a 2030 scenario should be equal to a 2 year old car in 2022.

I'm trying to figure out how this is accommodated within the probabilities but can't seem to find anywhere that this is done?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this wasn't done very consistently... I changed the probabilities file to include this same calculation -- the probabilities file now includes body_type and vehicle_year columns just like the vehicle_type_data.csv file and age is explicitly calculated based on the user input fleet_year.

Comment threadactivitysim/abm/models/vehicle_allocation.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_allocation.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py
Comment threadactivitysim/abm/models/vehicle_type_choice.py
logger = logging.getLogger(__name__)


def get_combinatorial_vehicle_alternatives(alts_cats_dict, model_settings):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest adding a unit test for this function.

@dhensledhensleMay 24, 2022

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done. See the abm/test/test_misc/test_vehicle_type_alternatives.py script. Also cleaned up the function to remove model settings and make it better for a stand-alone unit test.

Comment threadactivitysim/abm/models/vehicle_type_choice.py
choosers=choosers,
alternatives=alts_wide,
spec=model_spec,
log_alt_losers=log_alt_losers,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something to consider more holistically in activitysim: most of these function calls seem to require 5-10 parameters.

Many best practices call for <= 3.

All the parameters which relate to run settings (e.g. chunk size, trace label, trace choice name) and not "substance" (e.g. alternatives, estimator, chooser) get in the way of legibility of what is happening.

Don't get me wrong - I love being explicit about things - but I would consider bundling some of these things in a config class that gets passed around or something similar.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is something we have been actively discussing as a consortium. I think making changes to this affect is outside the scope of this pull request though.

Comment threadactivitysim/abm/tables/vehicles.py Outdated
vehicles['vehicle_id'] = vehicles.household_id * 10 + vehicles.vehicle_num
vehicles.set_index('vehicle_id', inplace = True)

# I do not understand why this line is necessary, it seems circular

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should figure this out before merging

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the purpose of this line is to replace the "table" function with the dataframe. Added comment to reflect this just like in persons and households. This is just a consequence of how the inject table decorator and add_table functions were constructed.

@e-lo

e-lo commented May 13, 2022

Copy link
Copy Markdown
Collaborator

I'm getting a numpy comparison error when running test_mtc_extended.py (note that test_mtc.py seems to run just find)

Erroring at:

File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line286, inassign_variablesexpr_values=to_series(eval(expression, globals_dict, _locals_dict))
File"<string>", line1, in<module>FutureWarning: elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparison

Numpy version: v1.21

Note I scanned the code where it seems like somebody was trying to get this to just warn not error - but it doesn't seem to be working as run for some reason. I haven't troubleshot too much yet - thought I'd post in case it is a known issue.

Full Trace

---------------------------------------------------------------Capturedstdoutcall----------------------------------------------------------------ConfiguredloggingusingbasicConfigINFO:activitysim:ConfiguredloggingusingbasicConfigINFO-Readloggingconfigurationfrom: /Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/configs/logging.yamlINFO-SETTINGconfigs_dir: ['/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/test/configs', '/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/configs', '/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/configs']
INFO-SETTINGsettings_file_name: settings.yamlINFO-SETTINGdata_dir: ['/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data']
INFO-SETTINGoutput_dir: /Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/test/outputINFO-SETTINGhouseholds_sample_size: 10INFO-SETTINGchunk_size: 0INFO-SETTINGchunk_method: hybrid_ussINFO-SETTINGchunk_training_mode: disabledINFO-SETTINGmultiprocess: NoneINFO-SETTINGnum_processes: NoneINFO-SETTINGresume_after: NoneINFO-SETTINGtrace_hh_id: NoneINFO-ENVMKL_NUM_THREADS: NoneINFO-ENVOMP_NUM_THREADS: NoneINFO-ENVOPENBLAS_NUM_THREADS: NoneINFO-NUMPYblas_infolibraries: ['cblas', 'blas', 'cblas', 'blas']
INFO-NUMPYblas_opt_infolibraries: ['cblas', 'blas', 'cblas', 'blas']
INFO-NUMPYlapack_infolibraries: ['lapack', 'blas', 'lapack', 'blas']
INFO-NUMPYlapack_opt_infolibraries: ['lapack', 'blas', 'lapack', 'blas', 'cblas', 'blas', 'cblas', 'blas']
INFO-runsingleprocesssimulationINFO-Timetoexecuteopen_pipeline : 0.062seconds (0.0minutes)
INFO-preload_injectablesINFO-Timetoexecutepreload_injectables : 0.014seconds (0.0minutes)
INFO-#run_model running step initialize_landuseRunningstep'initialize_landuse'INFO-ReadingCSVfile/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/land_use.csvINFO-loadedland_use (25, 24)
INFO-initialize_landuse.annotate_tables-annotatingland_useSPECannotate_landuseINFO-Network_LOSusingskim_dict_factory: NumpyArraySkimFactoryINFO-allocate_skim_buffersharedFalsetazshape (826, 25, 25) totalsize: 2_065_000 (2.1MB)
INFO-_read_skims_from_omx/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/skims.omxINFO-_read_skims_from_omxloaded826skimsfrom/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/skims.omxINFO-writingskimcachetaz (826, 25, 25) to/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/test/output/cache/cached_taz.mmapINFO-load_skims_to_buffertazshape (826, 25, 25)
INFO-get_skim_datatazSkimDatashape (826, 25, 25)
INFO-SkimDictinittazINFO-SkimDict.build_3d_skim_block_offset_tableregistered1673dkeysTimetoexecutestep'initialize_landuse': 1.82sTotaltimetoexecuteiteration1withiterationvalueNone: 1.82sINFO-#run_model running step initialize_householdsRunningstep'initialize_households'INFO-ReadingCSVfile/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/households.csvINFO-fullhouseholdlistcontains5000householdsINFO-sampling10of5000householdsINFO-loadedhouseholds (10, 7)
INFO-ReadingCSVfile/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/persons.csvINFO-loadedpersons (28, 7)
INFO-initialize_households.annotate_tables-annotatingpersonsSPECannotate_personsINFO-initialize_households.annotate_tables-annotatinghouseholdsSPECannotate_householdsINFO-initialize_households.annotate_tables-annotatingpersonsSPECannotate_persons_after_hhTimetoexecutestep'initialize_households': 0.37sTotaltimetoexecuteiteration1withiterationvalueNone: 0.37sINFO-#run_model running step compute_accessibilityRunningstep'compute_accessibility'INFO-Runningcompute_accessibilitywith25origzones25destzonesINFO-compute_accessibilityRunningadaptive_chunked_chooserswith25choosersINFO-Runningchunk1of1with25of25choosersINFO-Runningcompute_accessibilitywith25origzones25destzonesINFO-compute_accessibilitycomputedaccessibilities (25, 10)
Timetoexecutestep'compute_accessibility': 0.06sTotaltimetoexecuteiteration1withiterationvalueNone: 0.06sINFO-#run_model running step school_locationRunningstep'school_location'INFO-Runningschool_location.i1.sample.universitywith4personsINFO-school_location.i1.sample.university.interaction_sampleRunningadaptive_chunked_chooserswith4choosersINFO-Runningchunk1of1with4of4choosersINFO-Runningeval_interaction_utilitieson24rowsINFO-Runningschool_location.i1.logsums.universitywith11rowsERROR-assign_variables-FutureWarning (elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparison) evaluating: np.where(sov_auto_op_cost.isna() | (sov_veh_option=='non_hh_veh'), costPerMile, sov_auto_op_cost)
numpy.core._exceptions._UFuncInputCastingError: Cannotcastufunc'equal'input1fromdtype('<U10') todtype('float64') withcastingrule'same_kind'Theaboveexceptionwasthedirectcauseofthefollowingexception:
Traceback (mostrecentcalllast):
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line286, inassign_variablesexpr_values=to_series(eval(expression, globals_dict, _locals_dict))
File"<string>", line1, in<module>FutureWarning: elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparisonINFO-Timetoexecuteallmodelsuntilthiserror : 2.814seconds (0.0minutes)
ERROR-activitysimrunencounteredanunrecoverableerrornumpy.core._exceptions._UFuncInputCastingError: Cannotcastufunc'equal'input1fromdtype('<U10') todtype('float64') withcastingrule'same_kind'Theaboveexceptionwasthedirectcauseofthefollowingexception:
Traceback (mostrecentcalllast):
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/cli/run.py", line260, inrunpipeline.run(models=config.setting('models'), resume_after=resume_after)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/pipeline.py", line617, inrunrun_model(model)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/pipeline.py", line476, inrun_modelorca.run([step_name])
File"/Users/elizabeth/opt/miniconda3/envs/asim/lib/python3.9/site-packages/orca/orca.py", line2168, inrunstep()
File"/Users/elizabeth/opt/miniconda3/envs/asim/lib/python3.9/site-packages/orca/orca.py", line973, in__call__returnself._func(**kwargs)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line920, inschool_locationiterate_location_choice(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line774, initerate_location_choicechoices_df, save_sample_df=run_location_choice(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line619, inrun_location_choicerun_location_logsums(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line438, inrun_location_logsumslogsums=logsum.compute_logsums(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/util/logsums.py", line142, incompute_logsumsexpressions.assign_columns(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/expressions.py", line124, inassign_columnsresults=compute_columns(df, model_settings, locals_dict, trace_label)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/expressions.py", line95, incompute_columns=assign.assign_variables(expressions_spec,
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line298, inassign_variablesraiseerrFile"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line286, inassign_variablesexpr_values=to_series(eval(expression, globals_dict, _locals_dict))
File"<string>", line1, in<module>FutureWarning: elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparison---------------------------------------------------------------Capturedstderrcall----------------------------------------------------------------numpy.core._exceptions._UFuncInputCastingError: Cannotcastufunc'equal'input1fromdtype('<U10') todtype('float64') withcastingrule'same_kind'Theaboveexceptionwasthedirectcauseofthefollowingexception:
Traceback (mostrecentcalllast):
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/test/simulation.py", line15, in<module>sys.exit(run(args))
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/cli/run.py", line260, inrunpipeline.run(models=config.setting('models'), resume_after=resume_after)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/pipeline.py", line617, inrunrun_model(model)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/pipeline.py", line476, inrun_modelorca.run([step_name])
File"/Users/elizabeth/opt/miniconda3/envs/asim/lib/python3.9/site-packages/orca/orca.py", line2168, inrunstep()
File"/Users/elizabeth/opt/miniconda3/envs/asim/lib/python3.9/site-packages/orca/orca.py", line973, in__call__returnself._func(**kwargs)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line920, inschool_locationiterate_location_choice(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line774, initerate_location_choicechoices_df, save_sample_df=run_location_choice(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line619, inrun_location_choicerun_location_logsums(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line438, inrun_location_logsumslogsums=logsum.compute_logsums(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/util/logsums.py", line142, incompute_logsumsexpressions.assign_columns(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/expressions.py", line124, inassign_columnsresults=compute_columns(df, model_settings, locals_dict, trace_label)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/expressions.py", line95, incompute_columns=assign.assign_variables(expressions_spec,
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line298, inassign_variablesraiseerrFile"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line286, inassign_variablesexpr_values=to_series(eval(expression, globals_dict, _locals_dict))
File"<string>", line1, in<module>FutureWarning: elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparison

Conda List

# packages in environment at /Users/elizabeth/opt/miniconda3/envs/asim:
#
# Name Version Build Channel
abseil-cpp 20210324.2 he49afe7_0 conda-forge
activitysim 1.0.3 dev_0 <develop>
appnope 0.1.3 pyhd8ed1ab_0 conda-forge
argon2-cffi 21.3.0 pyhd8ed1ab_0 conda-forge
argon2-cffi-bindings 21.2.0 py39h63b48b0_2 conda-forge
arrow-cpp 8.0.0 py39hfe23411_0_cpu conda-forge
asttokens 2.0.5 pyhd8ed1ab_0 conda-forge
attrs 21.4.0 pyhd8ed1ab_0 conda-forge
aws-c-cal 0.5.11 hd2e2f4b_0 conda-forge
aws-c-common 0.6.2 h0d85af4_0 conda-forge
aws-c-event-stream 0.2.7 hb9330a7_13 conda-forge
aws-c-io 0.10.5 h35aa462_0 conda-forge
aws-checksums 0.1.11 h0010a65_7 conda-forge
aws-sdk-cpp 1.8.186 h766a74d_3 conda-forge
backcall 0.2.0 pyh9f0ad1d_0 conda-forge
backports 1.0 py_2 conda-forge
backports.functools_lru_cache 1.6.4 pyhd8ed1ab_0 conda-forge
beautifulsoup4 4.11.1 pyha770c72_0 conda-forge
bleach 5.0.0 pyhd8ed1ab_0 conda-forge
blosc 1.21.1 h97e831e_2 conda-forge
boost-cpp 1.74.0 hdbf7018_7 conda-forge
branca 0.5.0 pyhd8ed1ab_0 conda-forge
brotli 1.0.9 h5eb16cf_7 conda-forge
brotli-bin 1.0.9 h5eb16cf_7 conda-forge
brotlipy 0.7.0 py39h63b48b0_1004 conda-forge
bump2version 1.0.1 pyh9f0ad1d_0 conda-forge
bzip2 1.0.8 h0d85af4_4 conda-forge
c-ares 1.18.1 h0d85af4_0 conda-forge
ca-certificates 2021.10.8 h033912b_0 conda-forge
cairo 1.16.0 h9e0e54b_1010 conda-forge
certifi 2021.10.8 py39h6e9494a_2 conda-forge
cffi 1.15.0 py39he338e87_0 conda-forge
cfitsio 4.1.0 h2c97ad1_0 conda-forge
charset-normalizer 2.0.12 pyhd8ed1ab_0 conda-forge
click 8.1.3 py39h6e9494a_0 conda-forge
click-plugins 1.1.1 py_0 conda-forge
cligj 0.7.2 pyhd8ed1ab_1 conda-forge
coverage 6.3.2 py39h63b48b0_2 conda-forge
coveralls 3.3.1 pyhd8ed1ab_0 conda-forge
cryptography 36.0.2 py39h1644bb1_1 conda-forge
curl 7.83.1 h372c54d_0 conda-forge
cycler 0.11.0 pyhd8ed1ab_0 conda-forge
cytoolz 0.11.2 py39h63b48b0_2 conda-forge
dbus 1.13.6 h811a1a6_3 conda-forge
debugpy 1.6.0 py39hfd1d529_0 conda-forge
decorator 5.1.1 pyhd8ed1ab_0 conda-forge
defusedxml 0.7.1 pyhd8ed1ab_0 conda-forge
descartes 1.1.0 py_4 conda-forge
docopt 0.6.2 py_1 conda-forge
entrypoints 0.4 pyhd8ed1ab_0 conda-forge
executing 0.8.3 pyhd8ed1ab_0 conda-forge
expat 2.4.8 h96cf925_0 conda-forge
fiona 1.8.21 py39h6d65ddd_1 conda-forge
flask 2.1.2 pyhd8ed1ab_1 conda-forge
flit-core 3.7.1 pyhd8ed1ab_0 conda-forge
folium 0.12.1.post1 pyhd8ed1ab_1 conda-forge
font-ttf-dejavu-sans-mono 2.37 hab24e00_0 conda-forge
font-ttf-inconsolata 3.000 h77eed37_0 conda-forge
font-ttf-source-code-pro 2.038 h77eed37_0 conda-forge
font-ttf-ubuntu 0.83 hab24e00_0 conda-forge
fontconfig 2.14.0 h676cef8_0 conda-forge
fonts-conda-ecosystem 1 0 conda-forge
fonts-conda-forge 1 0 conda-forge
fonttools 4.33.3 py39h701faf5_0 conda-forge
freetype 2.10.4 h4cff582_1 conda-forge
freexl 1.0.6 h0d85af4_0 conda-forge
gdal 3.4.2 py39h97b4846_7 conda-forge
geopandas 0.10.2 pyhd8ed1ab_1 conda-forge
geopandas-base 0.10.2 pyha770c72_1 conda-forge
geos 3.10.2 he49afe7_0 conda-forge
geotiff 1.7.1 had63758_1 conda-forge
gettext 0.19.8.1 hd1a6beb_1008 conda-forge
gflags 2.2.2 hb1e8313_1004 conda-forge
gh 2.10.1 h990441c_0 conda-forge
giflib 5.2.1 hbcb3906_2 conda-forge
git 2.35.3 pl5321h33a4a8a_0 conda-forge
glog 0.6.0 h8ac2a54_0 conda-forge
grpc-cpp 1.43.2 ha04666b_3 conda-forge
hdf4 4.2.15 hefd3b78_3 conda-forge
hdf5 1.12.1 nompi_ha60fbc9_104 conda-forge
icu 69.1 he49afe7_0 conda-forge
idna 3.3 pyhd8ed1ab_0 conda-forge
importlib-metadata 4.11.3 py39h6e9494a_1 conda-forge
importlib_resources 5.7.1 pyhd8ed1ab_0 conda-forge
iniconfig 1.1.1 pyh9f0ad1d_0 conda-forge
ipykernel 6.13.0 py39h71a6800_0 conda-forge
ipython 8.3.0 py39h6e9494a_0 conda-forge
ipython_genutils 0.2.0 py_1 conda-forge
ipywidgets 7.7.0 pyhd8ed1ab_0 conda-forge
itsdangerous 2.1.2 pyhd8ed1ab_0 conda-forge
jbig 2.1 h0d85af4_2003 conda-forge
jedi 0.18.1 py39h6e9494a_1 conda-forge
jinja2 3.1.2 pyhd8ed1ab_0 conda-forge
joblib 1.1.0 pyhd8ed1ab_0 conda-forge
jpeg 9e h5eb16cf_1 conda-forge
json-c 0.16 h01d06f9_0 conda-forge
jsonschema 4.5.1 pyhd8ed1ab_0 conda-forge
jupyter 1.0.0 py39h6e9494a_7 conda-forge
jupyter_client 7.3.1 pyhd8ed1ab_0 conda-forge
jupyter_console 6.4.3 pyhd8ed1ab_0 conda-forge
jupyter_core 4.10.0 py39h6e9494a_0 conda-forge
jupyterlab_pygments 0.2.2 pyhd8ed1ab_0 conda-forge
jupyterlab_widgets 1.1.0 pyhd8ed1ab_0 conda-forge
kealib 1.4.14 ha22a8b1_3 conda-forge
kiwisolver 1.4.2 py39h7248d28_1 conda-forge
krb5 1.19.3 hb49756b_0 conda-forge
lcms2 2.12 h577c468_0 conda-forge
lerc 3.0 he49afe7_0 conda-forge
libblas 3.9.0 14_osx64_openblas conda-forge
libbrotlicommon 1.0.9 h5eb16cf_7 conda-forge
libbrotlidec 1.0.9 h5eb16cf_7 conda-forge
libbrotlienc 1.0.9 h5eb16cf_7 conda-forge
libcblas 3.9.0 14_osx64_openblas conda-forge
libclang 13.0.1 default_he082bbe_0 conda-forge
libcrc32c 1.1.2 he49afe7_0 conda-forge
libcurl 7.83.1 h372c54d_0 conda-forge
libcxx 14.0.3 hc203e6f_0 conda-forge
libdap4 3.20.6 h3e144a0_2 conda-forge
libdeflate 1.10 h0d85af4_0 conda-forge
libedit 3.1.20191231 h0678c8f_2 conda-forge
libev 4.33 haf1e3a3_1 conda-forge
libevent 2.1.10 h815e4d9_4 conda-forge
libffi 3.4.2 h0d85af4_5 conda-forge
libgdal 3.4.2 h6474519_7 conda-forge
libgfortran 5.0.0 9_3_0_h6c81a4c_23 conda-forge
libgfortran5 9.3.0 h6c81a4c_23 conda-forge
libglib 2.70.2 hf1fb8c0_4 conda-forge
libgoogle-cloud 1.36.0 h52a585b_0 conda-forge
libiconv 1.16 haf1e3a3_0 conda-forge
libkml 1.3.0 h8fd9edb_1014 conda-forge
liblapack 3.9.0 14_osx64_openblas conda-forge
libllvm11 11.1.0 hd011deb_3 conda-forge
libllvm13 13.0.1 h64f94b2_2 conda-forge
libnetcdf 4.8.1 nompi_h6609ca0_102 conda-forge
libnghttp2 1.47.0 h942079c_0 conda-forge
libopenblas 0.3.20 openmp_hb3cd9ec_0 conda-forge
libpng 1.6.37 h7cec526_2 conda-forge
libpq 14.2 hea3049e_0 conda-forge
libprotobuf 3.19.4 hcf210ce_0 conda-forge
librttopo 1.1.0 hec60dd8_9 conda-forge
libsodium 1.0.18 hbcb3906_1 conda-forge
libspatialindex 1.9.3 he49afe7_4 conda-forge
libspatialite 5.0.1 hadde3e2_15 conda-forge
libssh2 1.10.0 h52ee1ee_2 conda-forge
libthrift 0.16.0 h9702cd6_1 conda-forge
libtiff 4.3.0 h17f2ce3_3 conda-forge
libutf8proc 2.7.0 h0d85af4_0 conda-forge
libwebp 1.2.2 h28dabe5_0 conda-forge
libwebp-base 1.2.2 h0d85af4_1 conda-forge
libxcb 1.13 h0d85af4_1004 conda-forge
libxml2 2.9.12 h7e28ab6_1 conda-forge
libzip 1.8.0 h8b0c345_1 conda-forge
libzlib 1.2.11 h6c3fc93_1014 conda-forge
llvm-openmp 14.0.3 ha654fa7_0 conda-forge
llvmlite 0.38.0 py39ha9d9895_1 conda-forge
lz4-c 1.9.3 he49afe7_1 conda-forge
mapclassify 2.4.3 pyhd8ed1ab_0 conda-forge
markupsafe 2.1.1 py39h63b48b0_1 conda-forge
matplotlib 3.5.2 py39h6e9494a_0 conda-forge
matplotlib-base 3.5.2 py39h64a0072_0 conda-forge
matplotlib-inline 0.1.3 pyhd8ed1ab_0 conda-forge
mistune 0.8.4 py39h89e85a6_1005 conda-forge
munch 2.5.0 py_0 conda-forge
munkres 1.1.4 pyh9f0ad1d_0 conda-forge
mysql-common 8.0.29 h924029e_0 conda-forge
mysql-libs 8.0.29 h3cab752_0 conda-forge
nbclient 0.6.3 pyhd8ed1ab_0 conda-forge
nbconvert 6.5.0 pyhd8ed1ab_0 conda-forge
nbconvert-core 6.5.0 pyhd8ed1ab_0 conda-forge
nbconvert-pandoc 6.5.0 pyhd8ed1ab_0 conda-forge
nbformat 5.4.0 pyhd8ed1ab_0 conda-forge
ncurses 6.3 h96cf925_1 conda-forge
nest-asyncio 1.5.5 pyhd8ed1ab_0 conda-forge
networkx 2.8 pyhd8ed1ab_0 conda-forge
notebook 6.4.11 pyha770c72_0 conda-forge
nspr 4.32 hcd9eead_1 conda-forge
nss 3.77 hfce436b_0 conda-forge
numba 0.55.1 py39hc37845d_1 conda-forge
numexpr 2.8.0 py39hbd61c47_2 conda-forge
numpy 1.21.6 py39hf56e92f_0 conda-forge
openjpeg 2.4.0 h6e7aa92_1 conda-forge
openmatrix 0.3.5.0 pyhd8ed1ab_0 conda-forge
openssl 1.1.1o hfe4f2af_0 conda-forge
orc 1.7.3 h84518c8_0 conda-forge
orca 1.6 pyhd8ed1ab_0 conda-forge
packaging 21.3 pyhd8ed1ab_0 conda-forge
pandas 1.4.2 py39hbd61c47_1 conda-forge
pandoc 2.18 h694c41f_0 conda-forge
pandocfilters 1.5.0 pyhd8ed1ab_0 conda-forge
parquet-cpp 1.5.1 2 conda-forge
parso 0.8.3 pyhd8ed1ab_0 conda-forge
pcre 8.45 he49afe7_0 conda-forge
pcre2 10.37 ha16e1b2_0 conda-forge
perl 5.32.1 2_h0d85af4_perl5 conda-forge
pexpect 4.8.0 pyh9f0ad1d_2 conda-forge
pickleshare 0.7.5 py_1003 conda-forge
pillow 9.1.0 py39hd2c7aa1_2 conda-forge
pip 22.1 pyhd8ed1ab_0 conda-forge
pixman 0.40.0 hbcb3906_0 conda-forge
pluggy 1.0.0 py39h6e9494a_3 conda-forge
poppler 22.04.0 h39497b0_0 conda-forge
poppler-data 0.4.11 hd8ed1ab_0 conda-forge
postgresql 14.2 he8fe76e_0 conda-forge
proj 9.0.0 h2364a93_1 conda-forge
prometheus_client 0.14.1 pyhd8ed1ab_0 conda-forge
prompt-toolkit 3.0.29 pyha770c72_0 conda-forge
prompt_toolkit 3.0.29 hd8ed1ab_0 conda-forge
psutil 5.9.0 py39h63b48b0_1 conda-forge
pthread-stubs 0.4 hc929b4f_1001 conda-forge
ptyprocess 0.7.0 pyhd3deb0d_0 conda-forge
pure_eval 0.2.2 pyhd8ed1ab_0 conda-forge
py 1.11.0 pyh6c4a22f_0 conda-forge
pyarrow 8.0.0 py39hb9688c1_0_cpu conda-forge
pycodestyle 2.8.0 pyhd8ed1ab_0 conda-forge
pycparser 2.21 pyhd8ed1ab_0 conda-forge
pygments 2.12.0 pyhd8ed1ab_0 conda-forge
pyopenssl 22.0.0 pyhd8ed1ab_0 conda-forge
pyparsing 3.0.9 pyhd8ed1ab_0 conda-forge
pyproj 3.3.1 py39hfe197cf_0 conda-forge
pyqt 5.12.3 py39h9d385e7_4 conda-forge
pyqt5-sip 4.19.18 pypi_0 pypi
pyqtchart 5.12 pypi_0 pypi
pyqtwebengine 5.12.1 pypi_0 pypi
pyrsistent 0.18.1 py39h63b48b0_1 conda-forge
pysocks 1.7.1 py39h6e9494a_5 conda-forge
pytest 7.1.2 py39h6e9494a_0 conda-forge
pytest-cov 3.0.0 pyhd8ed1ab_0 conda-forge
pytest-datadir 1.3.1 py_0 conda-forge
pytest-regressions 2.3.1 pyhd8ed1ab_0 conda-forge
python 3.9.12 h8b4d769_1_cpython conda-forge
python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge
python-fastjsonschema 2.15.3 pyhd8ed1ab_0 conda-forge
python_abi 3.9 2_cp39 conda-forge
pytz 2022.1 pyhd8ed1ab_0 conda-forge
pyyaml 6.0 py39h63b48b0_4 conda-forge
pyzmq 22.3.0 py39hc2dc7ec_2 conda-forge
qt 5.12.9 h2a607e2_5 conda-forge
qtconsole 5.3.0 pyhd8ed1ab_0 conda-forge
qtconsole-base 5.3.0 pyhd8ed1ab_0 conda-forge
qtpy 2.1.0 pyhd8ed1ab_0 conda-forge
re2 2022.02.01 he49afe7_0 conda-forge
readline 8.1 h05e3726_0 conda-forge
requests 2.27.1 pyhd8ed1ab_0 conda-forge
rtree 1.0.0 py39h7d0d40a_1 conda-forge
scikit-learn 1.0.2 py39hd4eea88_0 conda-forge
scipy 1.8.0 py39h056f1c0_1 conda-forge
send2trash 1.8.0 pyhd8ed1ab_0 conda-forge
setuptools 62.2.0 py39h6e9494a_0 conda-forge
shapely 1.8.2 py39hd471b09_1 conda-forge
six 1.16.0 pyh6c4a22f_0 conda-forge
snappy 1.1.9 h6e38e02_0 conda-forge
soupsieve 2.3.1 pyhd8ed1ab_0 conda-forge
sqlite 3.38.5 hd9f0692_0 conda-forge
stack_data 0.2.0 pyhd8ed1ab_0 conda-forge
tables 3.6.1 pypi_0 pypi
terminado 0.13.3 py39h6e9494a_1 conda-forge
threadpoolctl 3.1.0 pyh8a188c0_0 conda-forge
tiledb 2.8.2 hf17dc58_0 conda-forge
tinycss2 1.1.1 pyhd8ed1ab_0 conda-forge
tk 8.6.12 h5dbffcc_0 conda-forge
toml 0.10.2 pyhd8ed1ab_0 conda-forge
tomli 2.0.1 pyhd8ed1ab_0 conda-forge
toolz 0.11.2 pyhd8ed1ab_0 conda-forge
tornado 6.1 py39h63b48b0_3 conda-forge
traitlets 5.2.0 pyhd8ed1ab_0 conda-forge
tzcode 2022a h5eb16cf_0 conda-forge
tzdata 2022a h191b570_0 conda-forge
unicodedata2 14.0.0 py39h63b48b0_1 conda-forge
urllib3 1.26.9 pyhd8ed1ab_0 conda-forge
wcwidth 0.2.5 pyh9f0ad1d_2 conda-forge
webencodings 0.5.1 py_1 conda-forge
werkzeug 2.1.2 pyhd8ed1ab_1 conda-forge
wheel 0.37.1 pyhd8ed1ab_0 conda-forge
widgetsnbextension 3.6.0 py39h6e9494a_0 conda-forge
xerces-c 3.2.3 h6564042_4 conda-forge
xorg-libxau 1.0.9 h35c211d_0 conda-forge
xorg-libxdmcp 1.1.3 h35c211d_0 conda-forge
xyzservices 2022.4.0 pyhd8ed1ab_0 conda-forge
xz 5.2.5 haf1e3a3_1 conda-forge
yaml 0.2.5 h0d85af4_2 conda-forge
zeromq 4.3.4 he49afe7_1 conda-forge
zipp 3.8.0 pyhd8ed1ab_0 conda-forge
zlib 1.2.11 h6c3fc93_1014 conda-forge
zstd 1.5.2 h582d3a0_0 conda-forge

@dhensle

Copy link
Copy Markdown
Contributor

I'm getting a numpy comparison error when running test_mtc_extended.py (note that test_mtc.py seems to run just find)

Sorry about that, the setup I had was pointing to some other configs. This test should be passing now.

@dhensle

Copy link
Copy Markdown
Contributor

@e-lo I believe I have addressed all of your comments. I left a couple conversations open for you to sign off on. Thanks for your helpful comments and please let me know if there's anything else I missed.

Comment threadactivitysim/examples/example_mtc/configs/annotate_households.csv Outdated
@jfdman

Copy link
Copy Markdown

Have all comments been addressed? Please advise, we have several regions waiting to pull this model into their implementation. Thanks!

@guyrousseau

Copy link
Copy Markdown

@jfdman Since all vehicle make/model coding for the NHTS (since inception) maps to NHTSA’s FARS vehicle make/mode coding scheme [https://www.nhtsa.gov/research-data/fatality-analysis-reporting-system-fars], can you confirm that our vehicle type model conforms with NHTSA’s FARS?

@i-am-sijia

i-am-sijia commented Jun 6, 2022

Copy link
Copy Markdown
Member

Have all comments been addressed? Please advise, we have several regions waiting to pull this model into their implementation. Thanks!

Confirmed all previous comments are addressed. Guy's question is the only one left. Thanks.

@jpn--
jpn-- merged commit 367cbac into ActivitySim:developJun 6, 2022
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FeatureNew feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

create vehicle type model and add vehicle table to pipeline

10 participants

@mxndrwgrdnr@bstabler@coveralls@e-lo@dhensle@jfdman@guyrousseau@i-am-sijia@toliwaga@jpn--
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

🚀 [feat] vehicle type model - #486

Merged
jpn-- merged 44 commits into
ActivitySim:developfrom
mxndrwgrdnr:vehicle
Jun 6, 2022
Merged

🚀 [feat] vehicle type model#486
jpn-- merged 44 commits into
ActivitySim:developfrom
mxndrwgrdnr:vehicle

Conversation

@mxndrwgrdnr

@mxndrwgrdnrmxndrwgrdnr commented Sep 21, 2021

Copy link
Copy Markdown
Contributor

User Story

As a planner, I would like to understand the effects of vehicle type choice on travel behavior in order to support more detailed emissions analysis and more refined travel costs.

Requirements

Per https://github.com/ActivitySim/activitysim/wiki/Phase-6b-Scope-of-Work#task-2-vehicle-type-model

After applying this submodel, household vehicles should have the following properties:

  • vehicle type (e.g. auto, light-truck, etc)
  • capacity (# of people it can carry)
  • power train (ICE, hybrid, phev, etc)
  • range
  • age

In addition, each auto tour should be assigned the most likely household vehicles based on:

  • household
  • tour-characteristics
  • household vehicle attributes

*Note: For this task, vehicle allocation to auto tours should not consider the availability of each individual vehicles. *

The implementation should have the following usability features:

  • ability to read an input vehicle table, as opposed to create one during a model run, an initialize_vehicles submodel will be added that can read a vehicle table from CSV file, annotate it with custom expressions, ensure table keys are consistent with household IDs, and add it to the pipeline.
  • detailed technical documentation of all vehicle type and allocation models or methods.
  • updated users guide
  • tests covering the new methods
  • examples covering new methods

Approach

Model Estimation

  • estimate vehicle type model based on 5,000 household Bay Area TNC survey data
  • run the submodel with the existing example model
  • reasonably verify goodness-of-fit across key dimensions such as:
    • socio-demographics and
    • geography

Implementation

  • integrate method into the ActivitySim run stream.
  • develop method for allocating household-generated VMT to household vehicles
  • sensitivity tests

Issues

Fixes#438

@mxndrwgrdnr
mxndrwgrdnr marked this pull request as draft September 21, 2021 05:24
@bstabler

Copy link
Copy Markdown
Contributor

#438

@coveralls

coveralls commented Sep 21, 2021

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.5%) to 53.603% when pulling d556239 on mxndrwgrdnr:vehicle into 91930b5 on ActivitySim:develop.

@bstabler

Copy link
Copy Markdown
Contributor

@mxndrwgrdnr - can you adjust this PR to merge to develop? Thanks.

@mxndrwgrdnr
mxndrwgrdnr changed the base branch from master to developNovember 9, 2021 00:05
@mxndrwgrdnr
mxndrwgrdnr marked this pull request as ready for review November 12, 2021 22:52
@e-loe-lo added the Feature New feature or request label Dec 7, 2021
@e-loe-lo changed the title vehicle type model🚀 [feat] vehicle type modelDec 7, 2021
@e-loe-lo linked an issue Dec 7, 2021 that may be closed by this pull request

@e-loe-lo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally I found the code easy to read and it flowed well. There is a general lack of documentation including:

  • docstrings appropriately formatted for autodoc-ing
  • typehints
  • origin of model coefficients, what estimation are they from, etc
  • general documentation about capabilities
  • intra-activity sim links to documentation about general activitysim "things" (i.e. various formats, etc)

There is also a lack of tests for the specific unit of the vehicle type choice.

I also found it odd when running the MTC test example locally, that it didn't pick up the config? I suspect I'm doing something wrong but if I'm doing it wrong others might too (maybe?)

Comment threadactivitysim/abm/models/vehicle_type_choice.py
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/tables/vehicles.py
Comment threadactivitysim/abm/tables/vehicles.py
Comment threadactivitysim/abm/tables/vehicles.py
Comment threadactivitysim/examples/example_mtc/configs/free_parking.csv Outdated
Comment threadactivitysim/examples/example_mtc/configs/settings.yaml Outdated
@e-lo

e-lo commented Dec 8, 2021

Copy link
Copy Markdown
Collaborator

BTW I'll probably have more questions once I get the MTC example working on my local machine - i.e. is it annotating tours etc.

@jpn--
jpn-- requested a review from i-am-sijiaMay 5, 2022 13:53
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Car_8,.9541,0.0096,0.0355,0.0007,0.0000
Car_9,.9548,0.0037,0.0409,0.0004,0.0001
Car_10,0.9530,0.0015,0.0451,0.0003,0.0001
Car_11,0.9676,0.0096,0.0225,0.0003,0.0000

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems as though some amount of "smoothing" would make sense here between the years. Many of the numbers for the lower-probability options go back and forth between 0 and >0 several times.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, these probabilities are "lumpy". This is due to the fact that they came directly from the National Household Travel Survey data. A comment about the "lumpy-ness" was added to the models.rst vehicle type choice documentation encouraging the user to change the probabilities to their region and smooth them as they see fit. Additional links in the documentation point to the presented results and sensitivity studies.

So, I suggest we leave the probabilities as is in the context of this pull request for the purpose of simplicity and transparency.

config.config_file_path(vehicle_type_data_file), comment='#')
fleet_year = model_settings.get('FLEET_YEAR')

vehicle_type_data['age'] = (1 + fleet_year - vehicle_type_data['vehicle_year']).astype(str)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to make sense that we would be able to imply a variation in fuel type based on vehicle age. However, in this case age isn't necessarily relative. A 10 year old car in a 2030 scenario should be equal to a 2 year old car in 2022.

I'm trying to figure out how this is accommodated within the probabilities but can't seem to find anywhere that this is done?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this wasn't done very consistently... I changed the probabilities file to include this same calculation -- the probabilities file now includes body_type and vehicle_year columns just like the vehicle_type_data.csv file and age is explicitly calculated based on the user input fleet_year.

Comment threadactivitysim/abm/models/vehicle_allocation.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_allocation.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py Outdated
Comment threadactivitysim/abm/models/vehicle_type_choice.py
Comment threadactivitysim/abm/models/vehicle_type_choice.py
logger = logging.getLogger(__name__)


def get_combinatorial_vehicle_alternatives(alts_cats_dict, model_settings):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest adding a unit test for this function.

@dhensledhensleMay 24, 2022

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done. See the abm/test/test_misc/test_vehicle_type_alternatives.py script. Also cleaned up the function to remove model settings and make it better for a stand-alone unit test.

Comment threadactivitysim/abm/models/vehicle_type_choice.py
choosers=choosers,
alternatives=alts_wide,
spec=model_spec,
log_alt_losers=log_alt_losers,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something to consider more holistically in activitysim: most of these function calls seem to require 5-10 parameters.

Many best practices call for <= 3.

All the parameters which relate to run settings (e.g. chunk size, trace label, trace choice name) and not "substance" (e.g. alternatives, estimator, chooser) get in the way of legibility of what is happening.

Don't get me wrong - I love being explicit about things - but I would consider bundling some of these things in a config class that gets passed around or something similar.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is something we have been actively discussing as a consortium. I think making changes to this affect is outside the scope of this pull request though.

Comment threadactivitysim/abm/tables/vehicles.py Outdated
vehicles['vehicle_id'] = vehicles.household_id * 10 + vehicles.vehicle_num
vehicles.set_index('vehicle_id', inplace = True)

# I do not understand why this line is necessary, it seems circular

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should figure this out before merging

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the purpose of this line is to replace the "table" function with the dataframe. Added comment to reflect this just like in persons and households. This is just a consequence of how the inject table decorator and add_table functions were constructed.

@e-lo

e-lo commented May 13, 2022

Copy link
Copy Markdown
Collaborator

I'm getting a numpy comparison error when running test_mtc_extended.py (note that test_mtc.py seems to run just find)

Erroring at:

File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line286, inassign_variablesexpr_values=to_series(eval(expression, globals_dict, _locals_dict))
File"<string>", line1, in<module>FutureWarning: elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparison

Numpy version: v1.21

Note I scanned the code where it seems like somebody was trying to get this to just warn not error - but it doesn't seem to be working as run for some reason. I haven't troubleshot too much yet - thought I'd post in case it is a known issue.

Full Trace

---------------------------------------------------------------Capturedstdoutcall----------------------------------------------------------------ConfiguredloggingusingbasicConfigINFO:activitysim:ConfiguredloggingusingbasicConfigINFO-Readloggingconfigurationfrom: /Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/configs/logging.yamlINFO-SETTINGconfigs_dir: ['/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/test/configs', '/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/configs', '/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/configs']
INFO-SETTINGsettings_file_name: settings.yamlINFO-SETTINGdata_dir: ['/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data']
INFO-SETTINGoutput_dir: /Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/test/outputINFO-SETTINGhouseholds_sample_size: 10INFO-SETTINGchunk_size: 0INFO-SETTINGchunk_method: hybrid_ussINFO-SETTINGchunk_training_mode: disabledINFO-SETTINGmultiprocess: NoneINFO-SETTINGnum_processes: NoneINFO-SETTINGresume_after: NoneINFO-SETTINGtrace_hh_id: NoneINFO-ENVMKL_NUM_THREADS: NoneINFO-ENVOMP_NUM_THREADS: NoneINFO-ENVOPENBLAS_NUM_THREADS: NoneINFO-NUMPYblas_infolibraries: ['cblas', 'blas', 'cblas', 'blas']
INFO-NUMPYblas_opt_infolibraries: ['cblas', 'blas', 'cblas', 'blas']
INFO-NUMPYlapack_infolibraries: ['lapack', 'blas', 'lapack', 'blas']
INFO-NUMPYlapack_opt_infolibraries: ['lapack', 'blas', 'lapack', 'blas', 'cblas', 'blas', 'cblas', 'blas']
INFO-runsingleprocesssimulationINFO-Timetoexecuteopen_pipeline : 0.062seconds (0.0minutes)
INFO-preload_injectablesINFO-Timetoexecutepreload_injectables : 0.014seconds (0.0minutes)
INFO-#run_model running step initialize_landuseRunningstep'initialize_landuse'INFO-ReadingCSVfile/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/land_use.csvINFO-loadedland_use (25, 24)
INFO-initialize_landuse.annotate_tables-annotatingland_useSPECannotate_landuseINFO-Network_LOSusingskim_dict_factory: NumpyArraySkimFactoryINFO-allocate_skim_buffersharedFalsetazshape (826, 25, 25) totalsize: 2_065_000 (2.1MB)
INFO-_read_skims_from_omx/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/skims.omxINFO-_read_skims_from_omxloaded826skimsfrom/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/skims.omxINFO-writingskimcachetaz (826, 25, 25) to/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/test/output/cache/cached_taz.mmapINFO-load_skims_to_buffertazshape (826, 25, 25)
INFO-get_skim_datatazSkimDatashape (826, 25, 25)
INFO-SkimDictinittazINFO-SkimDict.build_3d_skim_block_offset_tableregistered1673dkeysTimetoexecutestep'initialize_landuse': 1.82sTotaltimetoexecuteiteration1withiterationvalueNone: 1.82sINFO-#run_model running step initialize_householdsRunningstep'initialize_households'INFO-ReadingCSVfile/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/households.csvINFO-fullhouseholdlistcontains5000householdsINFO-sampling10of5000householdsINFO-loadedhouseholds (10, 7)
INFO-ReadingCSVfile/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc/data/persons.csvINFO-loadedpersons (28, 7)
INFO-initialize_households.annotate_tables-annotatingpersonsSPECannotate_personsINFO-initialize_households.annotate_tables-annotatinghouseholdsSPECannotate_householdsINFO-initialize_households.annotate_tables-annotatingpersonsSPECannotate_persons_after_hhTimetoexecutestep'initialize_households': 0.37sTotaltimetoexecuteiteration1withiterationvalueNone: 0.37sINFO-#run_model running step compute_accessibilityRunningstep'compute_accessibility'INFO-Runningcompute_accessibilitywith25origzones25destzonesINFO-compute_accessibilityRunningadaptive_chunked_chooserswith25choosersINFO-Runningchunk1of1with25of25choosersINFO-Runningcompute_accessibilitywith25origzones25destzonesINFO-compute_accessibilitycomputedaccessibilities (25, 10)
Timetoexecutestep'compute_accessibility': 0.06sTotaltimetoexecuteiteration1withiterationvalueNone: 0.06sINFO-#run_model running step school_locationRunningstep'school_location'INFO-Runningschool_location.i1.sample.universitywith4personsINFO-school_location.i1.sample.university.interaction_sampleRunningadaptive_chunked_chooserswith4choosersINFO-Runningchunk1of1with4of4choosersINFO-Runningeval_interaction_utilitieson24rowsINFO-Runningschool_location.i1.logsums.universitywith11rowsERROR-assign_variables-FutureWarning (elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparison) evaluating: np.where(sov_auto_op_cost.isna() | (sov_veh_option=='non_hh_veh'), costPerMile, sov_auto_op_cost)
numpy.core._exceptions._UFuncInputCastingError: Cannotcastufunc'equal'input1fromdtype('<U10') todtype('float64') withcastingrule'same_kind'Theaboveexceptionwasthedirectcauseofthefollowingexception:
Traceback (mostrecentcalllast):
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line286, inassign_variablesexpr_values=to_series(eval(expression, globals_dict, _locals_dict))
File"<string>", line1, in<module>FutureWarning: elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparisonINFO-Timetoexecuteallmodelsuntilthiserror : 2.814seconds (0.0minutes)
ERROR-activitysimrunencounteredanunrecoverableerrornumpy.core._exceptions._UFuncInputCastingError: Cannotcastufunc'equal'input1fromdtype('<U10') todtype('float64') withcastingrule'same_kind'Theaboveexceptionwasthedirectcauseofthefollowingexception:
Traceback (mostrecentcalllast):
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/cli/run.py", line260, inrunpipeline.run(models=config.setting('models'), resume_after=resume_after)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/pipeline.py", line617, inrunrun_model(model)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/pipeline.py", line476, inrun_modelorca.run([step_name])
File"/Users/elizabeth/opt/miniconda3/envs/asim/lib/python3.9/site-packages/orca/orca.py", line2168, inrunstep()
File"/Users/elizabeth/opt/miniconda3/envs/asim/lib/python3.9/site-packages/orca/orca.py", line973, in__call__returnself._func(**kwargs)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line920, inschool_locationiterate_location_choice(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line774, initerate_location_choicechoices_df, save_sample_df=run_location_choice(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line619, inrun_location_choicerun_location_logsums(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line438, inrun_location_logsumslogsums=logsum.compute_logsums(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/util/logsums.py", line142, incompute_logsumsexpressions.assign_columns(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/expressions.py", line124, inassign_columnsresults=compute_columns(df, model_settings, locals_dict, trace_label)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/expressions.py", line95, incompute_columns=assign.assign_variables(expressions_spec,
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line298, inassign_variablesraiseerrFile"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line286, inassign_variablesexpr_values=to_series(eval(expression, globals_dict, _locals_dict))
File"<string>", line1, in<module>FutureWarning: elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparison---------------------------------------------------------------Capturedstderrcall----------------------------------------------------------------numpy.core._exceptions._UFuncInputCastingError: Cannotcastufunc'equal'input1fromdtype('<U10') todtype('float64') withcastingrule'same_kind'Theaboveexceptionwasthedirectcauseofthefollowingexception:
Traceback (mostrecentcalllast):
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/examples/example_mtc_extended/test/simulation.py", line15, in<module>sys.exit(run(args))
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/cli/run.py", line260, inrunpipeline.run(models=config.setting('models'), resume_after=resume_after)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/pipeline.py", line617, inrunrun_model(model)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/pipeline.py", line476, inrun_modelorca.run([step_name])
File"/Users/elizabeth/opt/miniconda3/envs/asim/lib/python3.9/site-packages/orca/orca.py", line2168, inrunstep()
File"/Users/elizabeth/opt/miniconda3/envs/asim/lib/python3.9/site-packages/orca/orca.py", line973, in__call__returnself._func(**kwargs)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line920, inschool_locationiterate_location_choice(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line774, initerate_location_choicechoices_df, save_sample_df=run_location_choice(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line619, inrun_location_choicerun_location_logsums(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/location_choice.py", line438, inrun_location_logsumslogsums=logsum.compute_logsums(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/abm/models/util/logsums.py", line142, incompute_logsumsexpressions.assign_columns(
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/expressions.py", line124, inassign_columnsresults=compute_columns(df, model_settings, locals_dict, trace_label)
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/expressions.py", line95, incompute_columns=assign.assign_variables(expressions_spec,
File"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line298, inassign_variablesraiseerrFile"/Users/elizabeth/Documents/Websites/activitysim/activitysim/core/assign.py", line286, inassign_variablesexpr_values=to_series(eval(expression, globals_dict, _locals_dict))
File"<string>", line1, in<module>FutureWarning: elementwisecomparisonfailed; returningscalarinstead, butinthefuturewillperformelementwisecomparison

Conda List

# packages in environment at /Users/elizabeth/opt/miniconda3/envs/asim:
#
# Name Version Build Channel
abseil-cpp 20210324.2 he49afe7_0 conda-forge
activitysim 1.0.3 dev_0 <develop>
appnope 0.1.3 pyhd8ed1ab_0 conda-forge
argon2-cffi 21.3.0 pyhd8ed1ab_0 conda-forge
argon2-cffi-bindings 21.2.0 py39h63b48b0_2 conda-forge
arrow-cpp 8.0.0 py39hfe23411_0_cpu conda-forge
asttokens 2.0.5 pyhd8ed1ab_0 conda-forge
attrs 21.4.0 pyhd8ed1ab_0 conda-forge
aws-c-cal 0.5.11 hd2e2f4b_0 conda-forge
aws-c-common 0.6.2 h0d85af4_0 conda-forge
aws-c-event-stream 0.2.7 hb9330a7_13 conda-forge
aws-c-io 0.10.5 h35aa462_0 conda-forge
aws-checksums 0.1.11 h0010a65_7 conda-forge
aws-sdk-cpp 1.8.186 h766a74d_3 conda-forge
backcall 0.2.0 pyh9f0ad1d_0 conda-forge
backports 1.0 py_2 conda-forge
backports.functools_lru_cache 1.6.4 pyhd8ed1ab_0 conda-forge
beautifulsoup4 4.11.1 pyha770c72_0 conda-forge
bleach 5.0.0 pyhd8ed1ab_0 conda-forge
blosc 1.21.1 h97e831e_2 conda-forge
boost-cpp 1.74.0 hdbf7018_7 conda-forge
branca 0.5.0 pyhd8ed1ab_0 conda-forge
brotli 1.0.9 h5eb16cf_7 conda-forge
brotli-bin 1.0.9 h5eb16cf_7 conda-forge
brotlipy 0.7.0 py39h63b48b0_1004 conda-forge
bump2version 1.0.1 pyh9f0ad1d_0 conda-forge
bzip2 1.0.8 h0d85af4_4 conda-forge
c-ares 1.18.1 h0d85af4_0 conda-forge
ca-certificates 2021.10.8 h033912b_0 conda-forge
cairo 1.16.0 h9e0e54b_1010 conda-forge
certifi 2021.10.8 py39h6e9494a_2 conda-forge
cffi 1.15.0 py39he338e87_0 conda-forge
cfitsio 4.1.0 h2c97ad1_0 conda-forge
charset-normalizer 2.0.12 pyhd8ed1ab_0 conda-forge
click 8.1.3 py39h6e9494a_0 conda-forge
click-plugins 1.1.1 py_0 conda-forge
cligj 0.7.2 pyhd8ed1ab_1 conda-forge
coverage 6.3.2 py39h63b48b0_2 conda-forge
coveralls 3.3.1 pyhd8ed1ab_0 conda-forge
cryptography 36.0.2 py39h1644bb1_1 conda-forge
curl 7.83.1 h372c54d_0 conda-forge
cycler 0.11.0 pyhd8ed1ab_0 conda-forge
cytoolz 0.11.2 py39h63b48b0_2 conda-forge
dbus 1.13.6 h811a1a6_3 conda-forge
debugpy 1.6.0 py39hfd1d529_0 conda-forge
decorator 5.1.1 pyhd8ed1ab_0 conda-forge
defusedxml 0.7.1 pyhd8ed1ab_0 conda-forge
descartes 1.1.0 py_4 conda-forge
docopt 0.6.2 py_1 conda-forge
entrypoints 0.4 pyhd8ed1ab_0 conda-forge
executing 0.8.3 pyhd8ed1ab_0 conda-forge
expat 2.4.8 h96cf925_0 conda-forge
fiona 1.8.21 py39h6d65ddd_1 conda-forge
flask 2.1.2 pyhd8ed1ab_1 conda-forge
flit-core 3.7.1 pyhd8ed1ab_0 conda-forge
folium 0.12.1.post1 pyhd8ed1ab_1 conda-forge
font-ttf-dejavu-sans-mono 2.37 hab24e00_0 conda-forge
font-ttf-inconsolata 3.000 h77eed37_0 conda-forge
font-ttf-source-code-pro 2.038 h77eed37_0 conda-forge
font-ttf-ubuntu 0.83 hab24e00_0 conda-forge
fontconfig 2.14.0 h676cef8_0 conda-forge
fonts-conda-ecosystem 1 0 conda-forge
fonts-conda-forge 1 0 conda-forge
fonttools 4.33.3 py39h701faf5_0 conda-forge
freetype 2.10.4 h4cff582_1 conda-forge
freexl 1.0.6 h0d85af4_0 conda-forge
gdal 3.4.2 py39h97b4846_7 conda-forge
geopandas 0.10.2 pyhd8ed1ab_1 conda-forge
geopandas-base 0.10.2 pyha770c72_1 conda-forge
geos 3.10.2 he49afe7_0 conda-forge
geotiff 1.7.1 had63758_1 conda-forge
gettext 0.19.8.1 hd1a6beb_1008 conda-forge
gflags 2.2.2 hb1e8313_1004 conda-forge
gh 2.10.1 h990441c_0 conda-forge
giflib 5.2.1 hbcb3906_2 conda-forge
git 2.35.3 pl5321h33a4a8a_0 conda-forge
glog 0.6.0 h8ac2a54_0 conda-forge
grpc-cpp 1.43.2 ha04666b_3 conda-forge
hdf4 4.2.15 hefd3b78_3 conda-forge
hdf5 1.12.1 nompi_ha60fbc9_104 conda-forge
icu 69.1 he49afe7_0 conda-forge
idna 3.3 pyhd8ed1ab_0 conda-forge
importlib-metadata 4.11.3 py39h6e9494a_1 conda-forge
importlib_resources 5.7.1 pyhd8ed1ab_0 conda-forge
iniconfig 1.1.1 pyh9f0ad1d_0 conda-forge
ipykernel 6.13.0 py39h71a6800_0 conda-forge
ipython 8.3.0 py39h6e9494a_0 conda-forge
ipython_genutils 0.2.0 py_1 conda-forge
ipywidgets 7.7.0 pyhd8ed1ab_0 conda-forge
itsdangerous 2.1.2 pyhd8ed1ab_0 conda-forge
jbig 2.1 h0d85af4_2003 conda-forge
jedi 0.18.1 py39h6e9494a_1 conda-forge
jinja2 3.1.2 pyhd8ed1ab_0 conda-forge
joblib 1.1.0 pyhd8ed1ab_0 conda-forge
jpeg 9e h5eb16cf_1 conda-forge
json-c 0.16 h01d06f9_0 conda-forge
jsonschema 4.5.1 pyhd8ed1ab_0 conda-forge
jupyter 1.0.0 py39h6e9494a_7 conda-forge
jupyter_client 7.3.1 pyhd8ed1ab_0 conda-forge
jupyter_console 6.4.3 pyhd8ed1ab_0 conda-forge
jupyter_core 4.10.0 py39h6e9494a_0 conda-forge
jupyterlab_pygments 0.2.2 pyhd8ed1ab_0 conda-forge
jupyterlab_widgets 1.1.0 pyhd8ed1ab_0 conda-forge
kealib 1.4.14 ha22a8b1_3 conda-forge
kiwisolver 1.4.2 py39h7248d28_1 conda-forge
krb5 1.19.3 hb49756b_0 conda-forge
lcms2 2.12 h577c468_0 conda-forge
lerc 3.0 he49afe7_0 conda-forge
libblas 3.9.0 14_osx64_openblas conda-forge
libbrotlicommon 1.0.9 h5eb16cf_7 conda-forge
libbrotlidec 1.0.9 h5eb16cf_7 conda-forge
libbrotlienc 1.0.9 h5eb16cf_7 conda-forge
libcblas 3.9.0 14_osx64_openblas conda-forge
libclang 13.0.1 default_he082bbe_0 conda-forge
libcrc32c 1.1.2 he49afe7_0 conda-forge
libcurl 7.83.1 h372c54d_0 conda-forge
libcxx 14.0.3 hc203e6f_0 conda-forge
libdap4 3.20.6 h3e144a0_2 conda-forge
libdeflate 1.10 h0d85af4_0 conda-forge
libedit 3.1.20191231 h0678c8f_2 conda-forge
libev 4.33 haf1e3a3_1 conda-forge
libevent 2.1.10 h815e4d9_4 conda-forge
libffi 3.4.2 h0d85af4_5 conda-forge
libgdal 3.4.2 h6474519_7 conda-forge
libgfortran 5.0.0 9_3_0_h6c81a4c_23 conda-forge
libgfortran5 9.3.0 h6c81a4c_23 conda-forge
libglib 2.70.2 hf1fb8c0_4 conda-forge
libgoogle-cloud 1.36.0 h52a585b_0 conda-forge
libiconv 1.16 haf1e3a3_0 conda-forge
libkml 1.3.0 h8fd9edb_1014 conda-forge
liblapack 3.9.0 14_osx64_openblas conda-forge
libllvm11 11.1.0 hd011deb_3 conda-forge
libllvm13 13.0.1 h64f94b2_2 conda-forge
libnetcdf 4.8.1 nompi_h6609ca0_102 conda-forge
libnghttp2 1.47.0 h942079c_0 conda-forge
libopenblas 0.3.20 openmp_hb3cd9ec_0 conda-forge
libpng 1.6.37 h7cec526_2 conda-forge
libpq 14.2 hea3049e_0 conda-forge
libprotobuf 3.19.4 hcf210ce_0 conda-forge
librttopo 1.1.0 hec60dd8_9 conda-forge
libsodium 1.0.18 hbcb3906_1 conda-forge
libspatialindex 1.9.3 he49afe7_4 conda-forge
libspatialite 5.0.1 hadde3e2_15 conda-forge
libssh2 1.10.0 h52ee1ee_2 conda-forge
libthrift 0.16.0 h9702cd6_1 conda-forge
libtiff 4.3.0 h17f2ce3_3 conda-forge
libutf8proc 2.7.0 h0d85af4_0 conda-forge
libwebp 1.2.2 h28dabe5_0 conda-forge
libwebp-base 1.2.2 h0d85af4_1 conda-forge
libxcb 1.13 h0d85af4_1004 conda-forge
libxml2 2.9.12 h7e28ab6_1 conda-forge
libzip 1.8.0 h8b0c345_1 conda-forge
libzlib 1.2.11 h6c3fc93_1014 conda-forge
llvm-openmp 14.0.3 ha654fa7_0 conda-forge
llvmlite 0.38.0 py39ha9d9895_1 conda-forge
lz4-c 1.9.3 he49afe7_1 conda-forge
mapclassify 2.4.3 pyhd8ed1ab_0 conda-forge
markupsafe 2.1.1 py39h63b48b0_1 conda-forge
matplotlib 3.5.2 py39h6e9494a_0 conda-forge
matplotlib-base 3.5.2 py39h64a0072_0 conda-forge
matplotlib-inline 0.1.3 pyhd8ed1ab_0 conda-forge
mistune 0.8.4 py39h89e85a6_1005 conda-forge
munch 2.5.0 py_0 conda-forge
munkres 1.1.4 pyh9f0ad1d_0 conda-forge
mysql-common 8.0.29 h924029e_0 conda-forge
mysql-libs 8.0.29 h3cab752_0 conda-forge
nbclient 0.6.3 pyhd8ed1ab_0 conda-forge
nbconvert 6.5.0 pyhd8ed1ab_0 conda-forge
nbconvert-core 6.5.0 pyhd8ed1ab_0 conda-forge
nbconvert-pandoc 6.5.0 pyhd8ed1ab_0 conda-forge
nbformat 5.4.0 pyhd8ed1ab_0 conda-forge
ncurses 6.3 h96cf925_1 conda-forge
nest-asyncio 1.5.5 pyhd8ed1ab_0 conda-forge
networkx 2.8 pyhd8ed1ab_0 conda-forge
notebook 6.4.11 pyha770c72_0 conda-forge
nspr 4.32 hcd9eead_1 conda-forge
nss 3.77 hfce436b_0 conda-forge
numba 0.55.1 py39hc37845d_1 conda-forge
numexpr 2.8.0 py39hbd61c47_2 conda-forge
numpy 1.21.6 py39hf56e92f_0 conda-forge
openjpeg 2.4.0 h6e7aa92_1 conda-forge
openmatrix 0.3.5.0 pyhd8ed1ab_0 conda-forge
openssl 1.1.1o hfe4f2af_0 conda-forge
orc 1.7.3 h84518c8_0 conda-forge
orca 1.6 pyhd8ed1ab_0 conda-forge
packaging 21.3 pyhd8ed1ab_0 conda-forge
pandas 1.4.2 py39hbd61c47_1 conda-forge
pandoc 2.18 h694c41f_0 conda-forge
pandocfilters 1.5.0 pyhd8ed1ab_0 conda-forge
parquet-cpp 1.5.1 2 conda-forge
parso 0.8.3 pyhd8ed1ab_0 conda-forge
pcre 8.45 he49afe7_0 conda-forge
pcre2 10.37 ha16e1b2_0 conda-forge
perl 5.32.1 2_h0d85af4_perl5 conda-forge
pexpect 4.8.0 pyh9f0ad1d_2 conda-forge
pickleshare 0.7.5 py_1003 conda-forge
pillow 9.1.0 py39hd2c7aa1_2 conda-forge
pip 22.1 pyhd8ed1ab_0 conda-forge
pixman 0.40.0 hbcb3906_0 conda-forge
pluggy 1.0.0 py39h6e9494a_3 conda-forge
poppler 22.04.0 h39497b0_0 conda-forge
poppler-data 0.4.11 hd8ed1ab_0 conda-forge
postgresql 14.2 he8fe76e_0 conda-forge
proj 9.0.0 h2364a93_1 conda-forge
prometheus_client 0.14.1 pyhd8ed1ab_0 conda-forge
prompt-toolkit 3.0.29 pyha770c72_0 conda-forge
prompt_toolkit 3.0.29 hd8ed1ab_0 conda-forge
psutil 5.9.0 py39h63b48b0_1 conda-forge
pthread-stubs 0.4 hc929b4f_1001 conda-forge
ptyprocess 0.7.0 pyhd3deb0d_0 conda-forge
pure_eval 0.2.2 pyhd8ed1ab_0 conda-forge
py 1.11.0 pyh6c4a22f_0 conda-forge
pyarrow 8.0.0 py39hb9688c1_0_cpu conda-forge
pycodestyle 2.8.0 pyhd8ed1ab_0 conda-forge
pycparser 2.21 pyhd8ed1ab_0 conda-forge
pygments 2.12.0 pyhd8ed1ab_0 conda-forge
pyopenssl 22.0.0 pyhd8ed1ab_0 conda-forge
pyparsing 3.0.9 pyhd8ed1ab_0 conda-forge
pyproj 3.3.1 py39hfe197cf_0 conda-forge
pyqt 5.12.3 py39h9d385e7_4 conda-forge
pyqt5-sip 4.19.18 pypi_0 pypi
pyqtchart 5.12 pypi_0 pypi
pyqtwebengine 5.12.1 pypi_0 pypi
pyrsistent 0.18.1 py39h63b48b0_1 conda-forge
pysocks 1.7.1 py39h6e9494a_5 conda-forge
pytest 7.1.2 py39h6e9494a_0 conda-forge
pytest-cov 3.0.0 pyhd8ed1ab_0 conda-forge
pytest-datadir 1.3.1 py_0 conda-forge
pytest-regressions 2.3.1 pyhd8ed1ab_0 conda-forge
python 3.9.12 h8b4d769_1_cpython conda-forge
python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge
python-fastjsonschema 2.15.3 pyhd8ed1ab_0 conda-forge
python_abi 3.9 2_cp39 conda-forge
pytz 2022.1 pyhd8ed1ab_0 conda-forge
pyyaml 6.0 py39h63b48b0_4 conda-forge
pyzmq 22.3.0 py39hc2dc7ec_2 conda-forge
qt 5.12.9 h2a607e2_5 conda-forge
qtconsole 5.3.0 pyhd8ed1ab_0 conda-forge
qtconsole-base 5.3.0 pyhd8ed1ab_0 conda-forge
qtpy 2.1.0 pyhd8ed1ab_0 conda-forge
re2 2022.02.01 he49afe7_0 conda-forge
readline 8.1 h05e3726_0 conda-forge
requests 2.27.1 pyhd8ed1ab_0 conda-forge
rtree 1.0.0 py39h7d0d40a_1 conda-forge
scikit-learn 1.0.2 py39hd4eea88_0 conda-forge
scipy 1.8.0 py39h056f1c0_1 conda-forge
send2trash 1.8.0 pyhd8ed1ab_0 conda-forge
setuptools 62.2.0 py39h6e9494a_0 conda-forge
shapely 1.8.2 py39hd471b09_1 conda-forge
six 1.16.0 pyh6c4a22f_0 conda-forge
snappy 1.1.9 h6e38e02_0 conda-forge
soupsieve 2.3.1 pyhd8ed1ab_0 conda-forge
sqlite 3.38.5 hd9f0692_0 conda-forge
stack_data 0.2.0 pyhd8ed1ab_0 conda-forge
tables 3.6.1 pypi_0 pypi
terminado 0.13.3 py39h6e9494a_1 conda-forge
threadpoolctl 3.1.0 pyh8a188c0_0 conda-forge
tiledb 2.8.2 hf17dc58_0 conda-forge
tinycss2 1.1.1 pyhd8ed1ab_0 conda-forge
tk 8.6.12 h5dbffcc_0 conda-forge
toml 0.10.2 pyhd8ed1ab_0 conda-forge
tomli 2.0.1 pyhd8ed1ab_0 conda-forge
toolz 0.11.2 pyhd8ed1ab_0 conda-forge
tornado 6.1 py39h63b48b0_3 conda-forge
traitlets 5.2.0 pyhd8ed1ab_0 conda-forge
tzcode 2022a h5eb16cf_0 conda-forge
tzdata 2022a h191b570_0 conda-forge
unicodedata2 14.0.0 py39h63b48b0_1 conda-forge
urllib3 1.26.9 pyhd8ed1ab_0 conda-forge
wcwidth 0.2.5 pyh9f0ad1d_2 conda-forge
webencodings 0.5.1 py_1 conda-forge
werkzeug 2.1.2 pyhd8ed1ab_1 conda-forge
wheel 0.37.1 pyhd8ed1ab_0 conda-forge
widgetsnbextension 3.6.0 py39h6e9494a_0 conda-forge
xerces-c 3.2.3 h6564042_4 conda-forge
xorg-libxau 1.0.9 h35c211d_0 conda-forge
xorg-libxdmcp 1.1.3 h35c211d_0 conda-forge
xyzservices 2022.4.0 pyhd8ed1ab_0 conda-forge
xz 5.2.5 haf1e3a3_1 conda-forge
yaml 0.2.5 h0d85af4_2 conda-forge
zeromq 4.3.4 he49afe7_1 conda-forge
zipp 3.8.0 pyhd8ed1ab_0 conda-forge
zlib 1.2.11 h6c3fc93_1014 conda-forge
zstd 1.5.2 h582d3a0_0 conda-forge

@dhensle

Copy link
Copy Markdown
Contributor

I'm getting a numpy comparison error when running test_mtc_extended.py (note that test_mtc.py seems to run just find)

Sorry about that, the setup I had was pointing to some other configs. This test should be passing now.

@dhensle

Copy link
Copy Markdown
Contributor

@e-lo I believe I have addressed all of your comments. I left a couple conversations open for you to sign off on. Thanks for your helpful comments and please let me know if there's anything else I missed.

Comment threadactivitysim/examples/example_mtc/configs/annotate_households.csv Outdated
@jfdman

Copy link
Copy Markdown

Have all comments been addressed? Please advise, we have several regions waiting to pull this model into their implementation. Thanks!

@guyrousseau

Copy link
Copy Markdown

@jfdman Since all vehicle make/model coding for the NHTS (since inception) maps to NHTSA’s FARS vehicle make/mode coding scheme [https://www.nhtsa.gov/research-data/fatality-analysis-reporting-system-fars], can you confirm that our vehicle type model conforms with NHTSA’s FARS?

@i-am-sijia

i-am-sijia commented Jun 6, 2022

Copy link
Copy Markdown
Member

Have all comments been addressed? Please advise, we have several regions waiting to pull this model into their implementation. Thanks!

Confirmed all previous comments are addressed. Guy's question is the only one left. Thanks.

@jpn--
jpn-- merged commit 367cbac into ActivitySim:developJun 6, 2022
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FeatureNew feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

create vehicle type model and add vehicle table to pipeline

10 participants

@mxndrwgrdnr@bstabler@coveralls@e-lo@dhensle@jfdman@guyrousseau@i-am-sijia@toliwaga@jpn--