Skip to content

Separate generic data model from agency data model in trip linking / tour building #13

@nick-fournier

Description

@nick-fournier

I'm wanting to contribute to this but I'm wondering what people's thoughts on making this repo an installable package with tools that can be used individually rather than as a set daysim prep pipeline.

I propose separating the applied project specific scripts from the generic tools source code. Typically this is done with a src folder and a scripts folder. The core processing tools, like trip linking could/should be robustly unit tested to handle weird edge cases as they arise.

That way it could be easily imported and used in different analyses with comparable results both in this repo and elsewhere? @FlaviaTsang

something like....

from traveldiarytools import LinkerTinker

unlinked_trips_with_linked_trip_id, unique_linked_trips = LinkerTinker(
    unlinked_trips = trips_df,
    change_mode_code=11,
    transit_mode_codes=[12, 13, 14],
    max_dwell=120,   # max time between linked segments
    dwell_buffer=100 # max meters between linked segments
)

I'd be happy to set that framework up.

EDIT:
I don't have write access to this repo so I made a fork to do my work and make a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions