Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pass through kwargs for location choice model estimation #539

Merged
merged 7 commits into from
Mar 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 20 additions & 13 deletions activitysim/estimation/larch/location_choice.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,46 +287,53 @@ def update_size_spec(model, data, result_dir=Path('.'), output_file=None):
return master_size_spec


def workplace_location_model(return_data=False):
def workplace_location_model(**kwargs):
unused = kwargs.pop('name', None)
return location_choice_model(
name="workplace_location",
return_data=return_data,
**kwargs,
)


def school_location_model(return_data=False):
def school_location_model(**kwargs):
unused = kwargs.pop('name', None)
return location_choice_model(
name="school_location",
return_data=return_data,
**kwargs,
)


def atwork_subtour_destination_model(return_data=False):
def atwork_subtour_destination_model(**kwargs):
unused = kwargs.pop('name', None)
return location_choice_model(
name="atwork_subtour_destination",
return_data=return_data,
**kwargs,
)


def joint_tour_destination_model(return_data=False):
def joint_tour_destination_model(**kwargs):
# goes with non_mandatory_tour_destination
unused = kwargs.pop('name', None)
if 'coefficients_file' not in kwargs:
kwargs['coefficients_file'] = "non_mandatory_tour_destination_coefficients.csv"
return location_choice_model(
name="joint_tour_destination",
coefficients_file="non_mandatory_tour_destination_coefficients.csv",
return_data=return_data,
**kwargs,
)


def non_mandatory_tour_destination_model(return_data=False):
def non_mandatory_tour_destination_model(**kwargs):
# goes with joint_tour_destination
unused = kwargs.pop('name', None)
return location_choice_model(
name="non_mandatory_tour_destination",
return_data=return_data,
**kwargs,
)


def trip_destination_model(return_data=False):
def trip_destination_model(**kwargs):
unused = kwargs.pop('name', None)
return location_choice_model(
name="trip_destination",
return_data=return_data,
**kwargs,
)
2 changes: 1 addition & 1 deletion conda-environments/activitysim-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ channels:
dependencies:
- python=3.9
- pip
- numpy >= 1.16.1
- numpy >= 1.16.1,<=1.21
- pandas >= 1.1.0
- pyarrow >= 2.0
- openmatrix >= 0.3.4.1
Expand Down
4 changes: 3 additions & 1 deletion conda-environments/activitysim-test-larch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ channels:
dependencies:
- python=${TRAVIS_PYTHON_VERSION}
- pip
- numpy >= 1.16.1
- numpy >= 1.16.1,<=1.21
- pandas >= 1.1.0
- pyarrow >= 2.0
- openmatrix >= 0.3.4.1
Expand All @@ -23,3 +23,5 @@ dependencies:
- coveralls
- pycodestyle
- pytest-regressions
- xarray
- sharrow
2 changes: 1 addition & 1 deletion conda-environments/activitysim-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ channels:
dependencies:
- python=${TRAVIS_PYTHON_VERSION}
- pip
- numpy >= 1.16.1
- numpy >= 1.16.1,<=1.21
- pandas >= 1.1.0
- pyarrow >= 2.0
- openmatrix >= 0.3.4.1
Expand Down