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

Lab 1226 Refine Road Pricing #84

Merged
merged 10 commits into from Aug 9, 2021
Merged

Conversation

KasiaKoz
Copy link
Collaborator

Adds a Cordon class to hold information about tolling on network links.
All previous road pricing methods are retained and wraps added to have them work with this new class.
It's all pretty basic but it introduces a way to represent cordon tolls in memory that isn't dependent on OSM ids and a mapping between them and a network object.

@KasiaKoz KasiaKoz requested a review from mfitz July 30, 2021 11:11
@KasiaKoz KasiaKoz changed the title Lab 1226 road pricing refine Lab 1226 Refine Road Pricing Jul 30, 2021
Copy link
Contributor

@mfitz mfitz left a comment

Choose a reason for hiding this comment

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

Looks good.

I ran the coverage report and got:

675 passed, 1 xfailed, 442 warnings in 570.16s (0:09:30)

In separate branches, we should:

  • clean up all of those warnings
  • see if we can speed those tests up

Update: I will quickly see if using PyPy in the build pipeline makes things quicker, as per https://arupdigital.atlassian.net/browse/LAB-1179

@@ -1,3 +1,3 @@
osm_ids,osm_refs,osm_names
osm_id,osm_ref,osm_name
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah yes, the databasists would be proud of your column naming :-)

:param network: a genet.Network object with attribute_name tags
:param attribute_name: a string corresponding to the name of the link attribute of interest
:param osm_csv_path: path to a .csv config file where OSM way ids are stored in column `osm_ids`
:param outpath: path to a folder
Copy link
Contributor

Choose a reason for hiding this comment

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

Path to a directory for what? Writing output, I guess?

class Cordon:
def __init__(self, df_tolls: pd.DataFrame = None):
if df_tolls is None:
self.tolls_df = pd.DataFrame(
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we deliberately varying the member name here (df_tolls v tolls_df on the other side of the if clause at line 28)? I can see from the coverage report that line 15 is not tested, so it makes me think maybe this is a typo?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

oops, typo!

@KasiaKoz KasiaKoz merged commit 146eb6b into master Aug 9, 2021
@KasiaKoz KasiaKoz deleted the LAB-1226-road-pricing-refine branch August 9, 2021 17:13
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.

None yet

2 participants