Skip to content

Network Wrangler 2.0#6

Merged
e-lo merged 32 commits intosfcta:masterfrom
sdrewc:master
Feb 12, 2015
Merged

Network Wrangler 2.0#6
e-lo merged 32 commits intosfcta:masterfrom
sdrewc:master

Conversation

@sdrewc
Copy link
Copy Markdown
Member

@sdrewc sdrewc commented Feb 12, 2015

This commit implements several changes to NetworkWrangler described below.

1. Types
Types now include 'project', 'plan', and 'seed'.
1.a. Projects. These are the code representations of changes to a hwy or trn network. They are similar to projects in older versions of wrangler, with updates described below.
1.b. Plans. Plans are a collection of projects and/or other plans. They are specified by a file called planSpecs.csv with two columns: the first indicates the path/name of the project, and the second indicates the type.
1.c. Seed. These form the baseline starting point for a network. They are similar to projects but are meant to be applied first.

2. Project Upgrades.
NetworkWrangler expects now expects every 'project', 'plan', and 'seed' to have an __init__.py file with functions to return standard information. These are similar to __init__.py files used by previous versions of wrangler with changes described below.
2.a. champVersion. This now returns a tuple of the earliest and latest versions of CHAMP this project is compatible with. This is no longer stored in champVersion.txt for hwy projects.
2.b. wranglerVersion. This is a new function that returns a tuple of the earliest and latest versions of NetworkWrangler the a project is compatible with
2.c. desc. Returns a description of the project. This is no longer stored in desc.txt for hwy projects.
2.d. year. Returns the opening year of a project, or the model year if the modelyear keyword argument is supplied.
2.e. networks. This is a new function that returns a list of the network types that the project applies to. This is used by plans so projects listed in the plan are added to the correct networks.
2.f. prereqs. This returns a list of projects which must be applied before this project.
2.g. coreqs. This returns a list of projects which should be applied with this project (order doesn't matter though).
2.h. conflicts. This returns a list of projects which are known to cause errors when applied with this project.
2.i. apply, applyFiles, and applyEdits. These are used the same as before, but we recommend using with a modelyear argument to specify the opening year of a project.

3. Changes to build_network.py.
3.a. For each 'plan' in each network's project list, the script adds its projects, seeds, and other plans. These are all checked out prior to beginning to build any network.
3.b. For each 'project' in each network's project list (including projects contained within plans), the script checks the project list for prereqs, coreqs, and conflicts, and prompts the user for review and approval before continuing.
3.c. All projects (including projects contained within plans) are checked out prior to building any network. Only after checking out all projects and checking wranglerVersion, champVersion, prereqs, coreqs, and conflicts are networks built.

… main folder, and create scripts subfolder

Signed-off-by: Drew <drew.cooper@sfcta.org>
Signed-off-by: Drew <drew.cooper@sfcta.org>
Signed-off-by: Drew <drew.cooper@sfcta.org>
Signed-off-by: Drew <drew.cooper@sfcta.org>
This will be used by planSpecs to check out projects in the plan.  It will also be used by build_network
to check out all projects and check prereqs, coreqs, conflicts, etc, before
attempting to apply projects.

Adds functions (not finished) to get prereqs, coreqs, etc from projects

Signed-off-by: Drew <drew.cooper@sfcta.org>
Signed-off-by: Drew <drew.cooper@sfcta.org>
Signed-off-by: Drew <drew.cooper@sfcta.org>
…hose that should be checked out.

Signed-off-by: Drew <drew.cooper@sfcta.org>
Signed-off-by: Drew <drew.cooper@sfcta.org>
…ist of those that should be checked out."

This reverts commit dd6e44d.
…project in test mode, but fails going through PBA projects.

Signed-off-by: Drew <drew.cooper@sfcta.org>
… the project list for matches.

Signed-off-by: Drew <drew.cooper@sfcta.org>
…ction. Create function to write to screen.

Signed-off-by: Drew <drew.cooper@sfcta.org>
…requirements were found.

and other minor i/o changes.

Signed-off-by: Drew <drew.cooper@sfcta.org>
1. remove from 'match': dir-to-subdir and subdir-to-dir
2. fix error in reporting so 'possible matches' show up
3. fix error in reporting so lines wrap correctly when multiple matches are found

Add back in section to build projects, now that everything is checked out
and prereqs, coreqs, and conflicts have been checked.

Signed-off-by: Drew <drew.cooper@sfcta.org>
Signed-off-by: Drew <drew.cooper@sfcta.org>
…commented-out code

Signed-off-by: Drew <drew.cooper@sfcta.org>
Signed-off-by: Drew <drew.cooper@sfcta.org>
This should go in the paths stored in planSpecs in the plan itself.

Signed-off-by: Drew <drew.cooper@sfcta.org>
…s it.

Signed-off-by: Drew <drew.cooper@sfcta.org>
Open up the checked-out plansSpecs instead of the Y:\networks version.

Signed-off-by: Drew <drew.cooper@sfcta.org>
2. set up for possibility of passing different set of tags to plan and
its projects
3. minor formatting

Signed-off-by: Drew <drew.cooper@sfcta.org>
Signed-off-by: Drew <drew.cooper@sfcta.org>
…rsion

Signed-off-by: Drew <drew.cooper@sfcta.org>
Signed-off-by: Drew <drew.cooper@sfcta.org>
Signed-off-by: Drew <drew.cooper@sfcta.org>
Signed-off-by: Drew <drew.cooper@sfcta.org>
Comment thread Wrangler/__init__.py
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I know you didn't write this @sdrewc , but eventually it would be good to create some tests with example data...

Comment thread utils.py Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would look thru these and eliminate what we don't actually use in wrangler (maybe all?)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@e-lo I'll review them. At least some are necessary; I added them when I started running into missing dependencies, and they were all from this set.

@e-lo
Copy link
Copy Markdown
Member

e-lo commented Feb 12, 2015

@sdrewc , This is a ton of work - thanks!

I may just not be aware of something else you were trying to accomplish with this PR, but I think there is potentially a lot of unused code that duplicates things in CHAMP (potentially detrimentally).

My personal opinion is that we should remove duplications that aren't being used so that they don't fall out of sync. i.e. if we change the ordering of disaggregate records in CHAMP but accidentally use the ordering in Wrangler....then we could be using completely wrong columns which could have bad outcomes.

I've noted a few instances of this in-line, but there might be others.

Something that might be helpful: http://www.pylint.org/

...and then again, I may be completely off. Let me know! I'll wait on the PR merge for now...

@sdrewc
Copy link
Copy Markdown
Member Author

sdrewc commented Feb 12, 2015

@e-lo,

So wrangler's main functions are to build networks, and to be used for transit assignment, right? I only changed the parts for the network building function. In the spirit of keeping wrangler whole and stand-alone I didn't touch any of the other stuff.

Do you prefer to split into two pieces, with this just network building parts in this project? I think that is a pretty big project in itself because there are so many interdependencies here.

Or maybe I'm misunderstanding. Should I pull out dataTable, Lookups, hdf5, etc? and just point to CHAMP? Then wrangler doesn't stand alone anymore, but maybe that's fine.

Drew

@e-lo
Copy link
Copy Markdown
Member

e-lo commented Feb 12, 2015

@sdrewc - this is an interesting issue that I think warrants some discussion. @lmz might have some opinions on this as well.

The idea was to be able to have network wrangler work on its own, but to be able to "drop"
a static version of it into sf-champ and have it work there too.

There is a potential conflict in that we don't want to have to go to the "network wrangler" project to be able to edit the lookups that affect all of SF-CHAMP. And...we don't want there to end up being two lookups when you copy wrangler into SF-CHAMP. But...we want NetworkWrangler to be able to use the lookups. Basically we have a dependency circle of mutually assured destruction.

Here are some thoughts about how we could address this issue:

  1. Have an _includes or _static folder in Wrangler that has all the things that it needs from SF-CHAMP in order to run by itself that would not be copied into SF-CHAMP.
  2. The assignment portion just simply doesn't function w/out SF-CHAMP.

...but for files that are not ever used by wrangler, I think those are for sure out (i.e. disaggregate record?? maybe it is used but I can't think about how that would work right now...)

Thoughts?

Signed-off-by: Drew <drew.cooper@sfcta.org>
Signed-off-by: Drew <drew.cooper@sfcta.org>
Signed-off-by: Drew <drew.cooper@sfcta.org>
Signed-off-by: Drew <drew.cooper@sfcta.org>
Signed-off-by: Drew <drew.cooper@sfcta.org>
@sdrewc
Copy link
Copy Markdown
Member Author

sdrewc commented Feb 12, 2015

@e-lo and @lmz I like the _static idea. So much, in fact, that I updated my pull request to include it. I removed unused dependencies: dataTable, Cube, and odict remain.

e-lo added a commit that referenced this pull request Feb 12, 2015
@e-lo e-lo merged commit 6575880 into sfcta:master Feb 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants