-
Notifications
You must be signed in to change notification settings - Fork 9
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
Conversation
There was a problem hiding this 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 |
There was a problem hiding this comment.
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 :-)
genet/use/road_pricing.py
Outdated
: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 |
There was a problem hiding this comment.
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?
genet/use/road_pricing.py
Outdated
class Cordon: | ||
def __init__(self, df_tolls: pd.DataFrame = None): | ||
if df_tolls is None: | ||
self.tolls_df = pd.DataFrame( |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, typo!
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.