openmobisim.viz#
Figures for openmobisim runs, in one recognisable look.
pip install 'openmobisim[viz]'. Functions are named with their kind first,
so related ones sort and complete together: map_* draws on a map,
chart_* draws a plot with axes.
map_link()— a run’s traffic on its network: one ribbon per direction of every link, width = road capacity, colour = delay over free flow.map_demand()— demand as origin-destination desire lines.map_route()— the alternative routes of one origin-destination pair.map_transit()— a run’s transit: lines by kind, width = passengers on board, stops as hubs.map_parking()— a run’s parkings: car parks and bike parkings, sized by capacity, coloured by how full they got.map_hubs()— a run’s shared-bike hubs at one time: discs sized by the docks’ slots, coloured by how full they were, ringed where mostly empty or full.map_interactive()— a run and its route sets as one interactive HTML file: zoom levels, time, colour, hover, and route inspection. Needs no matplotlib.map_link_select()— the select-link analysis as one interactive HTML file: click a link to see the origin-destination pairs whose trips cross it, where they came from and went. Needs no matplotlib.chart_demand_matrix()— the origin-destination matrix as a heat-map.chart_service()— a docked bike service’s day: bikes docked and ridden, docks without a bike, and the travellers who found a dock empty.chart_mode_share()— the share of the trips each mode took, by departure time.summary()— a run’s summary as one self-contained HTML page: headline numbers, the flow map, modes, convergence, where the time went, settings.
matplotlib is imported when a figure is drawn, not when this package is, so
import openmobisim.viz works without it.
A figure that ends a notebook cell shows there. In a script or an IDE’s console, plt.show()
shows the figures drawn after import matplotlib.pyplot as plt; path= saves one to a file.
Functions#
|
Draw the origin-destination matrix as a heat-map. |
|
Draw the share of the trips each mode took, by departure time. |
|
Draw a docked bike service's day, or a taxi fleet's ( |
|
Draw demand as origin-destination desire lines on a map. |
|
Draw how full each hub's shared-bike docks were at one time of the day. |
|
Write a run and its route sets as one interactive HTML file. |
|
Draw a run's traffic on its network: one ribbon per direction of every link. |
|
Write the select-link analysis of a run as one interactive HTML file. |
|
Draw a run's parkings: car parks and bike parkings, sized and coloured. |
|
Draw the alternative routes of one origin-destination pair on the network. |
|
Draw a run's transit: lines by kind, width = passengers on board, stops as hubs. |
|
Write a run's summary as one self-contained HTML page, and return its path. |
Package Contents#
- openmobisim.viz.chart_demand_matrix(trips, *, cell_m=500.0, top=30, theme='paper', title=None, note=None, size_cm=SIZE_CM, dpi=120, credit=None, logo=True, path=None)#
Draw the origin-destination matrix as a heat-map.
Rows are origins and columns destinations, for the top cells that start or end the most trips, ordered by their total. Colour is the number of trips on the ion ramp. Cells stand in for zones until zones exist.
- Parameters:
trips (list[tuple]) – Rows in the scenario’s trips schema.
cell_m (float) – Side of the square cells that stand in for zones, in metres.
top (int) – How many of the busiest cells to show.
theme (str | openmobisim.viz._style.Theme) –
"paper"or"night".title (str | None) – Figure title.
note (str | None) – A third, italic line.
size_cm (tuple[float, float]) – Figure size, width and height in centimetres.
dpi (int) – Resolution in dots per inch (25.4 mm), the image-file convention.
credit (str | None) – A line of your own before the logo (a name, an institution).
logo (bool) – Draw the openmobisim logo at the bottom right.
path (str | None) – If given, also save the figure there.
- Returns:
A
matplotlib.figure.Figure.- Raises:
ValueError – If there are no trips.
ImportError – If matplotlib is not installed (
openmobisim[viz]).
- Return type:
Any
Draw the share of the trips each mode took, by departure time.
One stacked bar per departure bin: the share of the trips departing then that took each mode, walk at the bottom and the car at the top; each mode’s share of the day at the right. Trips count as many times as the people their traveller stands for. A trip counts under the mode it took (
Run.trip_modes): its stated mode, or with mode choice (modes) the one it chose. Bins with fewer than 1% of the busiest bin’s trips are left out, and so are trips that had no mode to choose.- Parameters:
run (Any) – A
Run.bin_s (int) – The departure bins’ length, in seconds.
theme (str | openmobisim.viz._style.Theme) –
"paper"or"night".title (str | None) – Figure title.
subtitle (str | None) – A line under the title; defaults to the trips and how many chose their mode.
note (str | None) – A third, italic line.
size_cm (tuple[float, float]) – Figure size, width and height in centimetres.
dpi (int) – Resolution in dots per inch (25.4 mm), the image-file convention.
credit (str | None) – A line of your own before the logo (a name, an institution).
logo (bool) – Draw the openmobisim logo at the bottom right.
path (str | None) – If given, also save the figure there.
- Returns:
A
matplotlib.figure.Figure.- Raises:
ValueError – If
bin_sis not positive, or no trip had a mode.ImportError – If matplotlib is not installed (
openmobisim[viz]).
- Return type:
Any
- openmobisim.viz.chart_service(run, service='bike_share', *, theme='paper', title=None, subtitle=None, note=None, size_cm=SIZE_CM, dpi=120, credit=None, logo=True, path=None)#
Draw a docked bike service’s day, or a taxi fleet’s (
servicenaming one: see below).Three panels over the run’s window. Bikes: one stacked bar per bin, the bikes docked (the docks’ time-weighted means, summed) and the bikes ridden (the fleet less those docked; bikes in an operator’s van would count here, and a run has no operator yet). Docks without a bike: the mean number of docks empty over the bin (their seconds empty over the bin’s length, summed), beside the docks: a fleet with many bikes docked can still have its busy docks empty. Travellers who found a dock empty (people): those who went on to another dock, and those who found no bike at any dock tried and walked to their destination.
A taxi fleet (
service="taxi", its name), bin by bin ofRun.taxi_vehicles()andRun.taxi_trips(): vehicles by state (the mean over the bin: carrying a passenger, driving empty to a pickup, idle, at or driving to a charger); travellers waiting for a taxi (the mean over the bin, from each request until the pickup, the cancellation, or the window’s end); requests cancelled (no taxi could pick them up within the fleet’s cancel limit), by the bin they were made in.- Parameters:
run (Any) – A
Runof a scenario with a docked bike service or a taxi fleet.service (str) – The service, by name.
theme (str | openmobisim.viz._style.Theme) –
"paper"or"night".title (str | None) – Figure title.
subtitle (str | None) – A line under the title; defaults to the fleet, the docks and the bins.
note (str | None) – A third, italic line; defaults to the trips and how they went.
size_cm (tuple[float, float]) – Figure size, width and height in centimetres.
dpi (int) – Resolution in dots per inch (25.4 mm), the image-file convention.
credit (str | None) – A line of your own before the logo (a name, an institution).
logo (bool) – Draw the openmobisim logo at the bottom right.
path (str | None) – If given, also save the figure there.
- Returns:
A
matplotlib.figure.Figure.- Raises:
ValueError – If the run had no service, or no service
service.ImportError – If matplotlib is not installed (
openmobisim[viz]).
- Return type:
Any
- openmobisim.viz.map_demand(trips, *, network=None, cell_m=500.0, top=300, theme='paper', title=None, subtitle=None, note=None, size_cm=SIZE_CM, dpi=120, credit=None, logo=True, path=None)#
Draw demand as origin-destination desire lines on a map.
Each line runs from an origin cell to a destination cell and bends to the right of its direction, so a pair and its reverse are two separate curves. Width and colour are the number of trips (traveller weights included); the largest top pairs are drawn. Trips that start and end in one cell are counted in the subtitle, not drawn.
- Parameters:
trips (list[tuple]) – Rows in the scenario’s trips schema.
network (Any | None) – If given, its links are drawn quietly underneath as a canvas.
cell_m (float) – Side of the square cells that stand in for zones, in metres.
top (int) – How many of the largest origin-destination pairs to draw.
theme (str | openmobisim.viz._style.Theme) –
"paper"or"night".title (str | None) – Figure title.
subtitle (str | None) – A line under the title; defaults to the counts.
note (str | None) – A third, italic line.
size_cm (tuple[float, float]) – Figure size, width and height in centimetres.
dpi (int) – Resolution in dots per inch (25.4 mm), the image-file convention.
credit (str | None) – A line of your own before the logo (a name, an institution).
logo (bool) – Draw the openmobisim logo at the bottom right.
path (str | None) – If given, also save the figure there.
- Returns:
A
matplotlib.figure.Figure.- Raises:
ValueError – If there are no trips.
ImportError – If matplotlib is not installed (
openmobisim[viz]).
- Return type:
Any
- openmobisim.viz.map_hubs(run, at='08:30', *, service=None, theme='paper', title=None, subtitle=None, note=None, size_cm=SIZE_CM, dpi=120, credit=None, logo=True, path=None)#
Draw how full each hub’s shared-bike docks were at one time of the day.
A hub is a place where travellers change vehicle (a stop, or a dock standing alone); its docks are added up. Each hub is a disc sized by its docks’ slots and coloured by the share of the slots holding a bike over the time bin that holds
at(the bin’s time-weighted mean,bikes_meanofRun.bike_share_docks()), from empty to full. A ring marks a hub whose docks held no bike for more than half of the bin (no bike to take: in the delay spectrum’s red), or had no free slot (no room to return one: in its gold). The run’s network is drawn quietly underneath.- Parameters:
run (Any) – A
Runof a scenario with a docked bike service.at (str | float) – The time:
"HH:MM"or seconds from midnight, inside the run’s window.service (str | None) – The service to draw, by name; every service of the run by default.
theme (str | openmobisim.viz._style.Theme) –
"paper"or"night".title (str | None) – Figure title.
subtitle (str | None) – A line under the title; defaults to the time bin and what size, colour and rings mean.
note (str | None) – A third, italic line; defaults to the bin’s bikes taken and returned and the travellers who found a dock empty.
size_cm (tuple[float, float]) – Figure size, width and height in centimetres.
dpi (int) – Resolution in dots per inch (25.4 mm), the image-file convention.
credit (str | None) – A line of your own before the logo (a name, an institution).
logo (bool) – Draw the openmobisim logo at the bottom right.
path (str | None) – If given, also save the figure there.
- Returns:
A
matplotlib.figure.Figure.- Raises:
ValueError – If the run had no service, has no service
service, oratis outside its window.ImportError – If matplotlib is not installed (
openmobisim[viz]).
- Return type:
Any
- openmobisim.viz.map_interactive(run, path=None, *, routes=True, theme='paper', title=None, note=None, credit=None, logo=True, view=None, max_route_pairs=2000, link_width=1.0, link_gap=1.0, quiet=False)#
Write a run and its route sets as one interactive HTML file.
Open the file in any modern browser: it needs no server, no network and no library. Zoom with the wheel, the buttons or the five level buttons (Overview, Region, District, Street, Detail): a large network shows its major roads first and adds minor streets as you zoom in, so it stays fast and readable at every scale. Time: a slider over the run’s time bins, all bins together, or play. Colour links by delay over free flow (the mean crossing time over the free-flow time, less one), volume, or volume over capacity. Hover a link to read it; click it to see how many routes and pairs use it and jump to one of them. Pick a pair to see its alternatives side by side, with each route’s time, detour and overlap. Layers: besides road traffic, the run’s transit lines and stops, its parkings, and the cyclists’ and walkers’ flows on their own networks, each with a switch and each off at first (the road traffic is the main view; transit over busy roads reads only when asked for). Only the layers the run has data for are offered. The page’s whole state is in its URL after the
#, so a view can be shared and reproduced. The figure is drawn at the screen’s own resolution: it stays sharp at any zoom.Size. A file holds one copy of the network’s street shapes, the per-bin results and the route sets, compressed. Andorra (23 000 links) with 3 000 route pairs is a few megabytes; a whole country is tens. To keep a file small, pass
viewto include only a region, or lowermax_route_pairs.- Parameters:
run (Any) – A
RunfromScenario.run(). Built withlink_bin_sit shows traffic; without, the network and routes only.path (str | pathlib.Path | None) – Where to write the
.htmlfile;map.htmlin the run’s output folder by default.routes (Any) –
True(default) to include the run’s route sets,FalseorNonefor none, or aRouteSetsobject (fromopenmobisim.route_sets_build) to show instead.theme (str) – The starting theme,
"paper"or"night"; the page has a button to switch.title (str | None) – The page title; defaults to a description of what is drawn.
note (str | None) – A third, italic line under the title.
credit (str | None) – A line of your own (a name, an institution) shown before the logo.
logo (bool) – Show the openmobisim logo at the bottom right.
view (tuple[tuple[float, float], tuple[float, float]] | None) –
((lon_min, lat_min), (lon_max, lat_max)): include only the links that touch this box, and only routes that lie wholly inside it.max_route_pairs (int) – At most this many origin-destination pairs are embedded, those with the most alternatives first (ties by order).
link_width (float) – The road ribbons’ width, as a multiple of the width the page chooses from the room between the roads on screen (1, the default); below 1 thinner, for a network of few, wide roads.
link_gap (float) – The space between a road’s two directions, as a multiple of the page’s own (1, the default: a fifth of the widest ribbon, 1.5 to 6 px).
quiet (bool) – Do not say where the file was written (by default a link to it is printed, or shown in a notebook).
- Returns:
The path written.
- Raises:
ValueError – If theme is unknown, view is empty, link_width or link_gap is not a positive number, or the region is too large to store (over about 200 km across; pass view).
- Return type:
pathlib.Path
- openmobisim.viz.map_link(run, *, bins=None, layer='road', colour=None, ramp='spectrum', theme='paper', title=None, subtitle=None, note=None, view=None, size_cm=SIZE_CM, dpi=120, scale=None, chevrons=None, min_volume=0.0, credit=None, logo=True, path=None)#
Draw a run’s traffic on its network: one ribbon per direction of every link.
Width is the road’s capacity per direction, the same for every road of one capacity (on the bike and walk layers, which have no capacity, volume); colour is the delay over free flow (each link’s mean crossing time over its free-flow time, less one), or volume, see colour. The two directions of a two-way street are drawn side by side, each on its own driver’s side, so they never overlap. Free-flowing links recede and congestion glows.
- Parameters:
run (Any) – A
RunfromScenario.run()on a scenario built withlink_bin_s, atflow_level2-4 for congestion to show.bins (int | str | tuple[int, int] | tuple[str, str] | None) – Which time bins to show:
Nonefor the busiest part of the run (the busiest bin and the bins around it carrying at least a quarter of its traffic),"all"for every bin from the first to the last that saw traffic, a clock time for the bin it falls in ("07:45"), a pair of clock times for the bins that cover the span (("07:30", "08:30")), or bin numbers counted from midnight: anintfor one bin,(first, stop)for a range (stopexcluded).layer (str) – Which layer’s traffic to draw:
"road"(default: cars, on the road network),"bike"or"walk"(each on its own layer’s links,network.layer(...); volume counts travellers, not PCU).colour (str | None) – What the colour shows:
"delay"(the delay over free flow, a link’s mean crossing time over its free-flow time less one, in four bands, 0-15 %, 15-50 %, 50-100 % and 100 % or more, after the Highway Capacity Manual’s levels of service; free flow counts a signal’s mean wait, so only waiting beyond it is delay; the default on the road),"volume"(the default on the bike and walk layers, where nothing is delayed), or"volume_capacity"(volume over the link’s capacity as it passes traffic — at a signal, times the green fraction — in four bands coloured as the delay’s: under 0.6, 0.6-0.8, 0.8-1.0 and over capacity; the road only).ramp (str) – For delay and volume over capacity,
"spectrum"(default: blue-green for little, gold in the middle, deeper red for more) or"ember"(the single-hue ramp of the first version).theme (str | openmobisim.viz._style.Theme) –
"paper"(print, slides) or"night"(screens, video).title (str | None) – Figure title; defaults to a description of what is drawn.
subtitle (str | None) – A line under the title; defaults to the time window and the encodings.
note (str | None) – A third, italic line, for example to say the demand is a fixture.
view (tuple[tuple[float, float], tuple[float, float]] | None) –
((lon_min, lat_min), (lon_max, lat_max))to zoom to; the whole network by default.size_cm (tuple[float, float]) – Figure size, width and height in centimetres. 40.64 x 22.86 (16:9) is a full-screen frame. The text is laid out for figures 20 cm wide or more; narrower, the footer runs into the logo and the legends crowd (a layout for a journal column is planned).
dpi (int) – Resolution in dots per inch (25.4 mm), the image-file convention.
scale (float | None) – Ribbon width multiplier; by default it follows the view, thin for a whole region and bolder when zoomed to a town.
chevrons (bool | None) – Draw a small direction triangle on each ribbon; by default only when the view is a few kilometres across.
min_volume (float) – Links carrying no more than this (PCU/h) are drawn only as canvas; the default 0 draws every link that saw any traffic, at least a fine line wide.
credit (str | None) – A line of your own before the logo (a name, an institution, your copyright). The logo is a signature, not a claim on your figure.
logo (bool) – Draw the openmobisim logo at the bottom right (
Falsefor none).path (str | None) – If given, also save the figure there (PNG, SVG or PDF by extension).
- Returns:
A
matplotlib.figure.Figure.- Raises:
ValueError – If the run has no per-link results, or colour is unknown.
ImportError – If matplotlib is not installed (
openmobisim[viz]).
- Return type:
Any
- openmobisim.viz.map_link_select(run, path=None, *, zones=None, link=None, theme='paper', title=None, bin_s=None, quiet=False)#
Write the select-link analysis of a run as one interactive HTML file.
Click a link (a road, or a bike link with the bike layer chosen) to see the origin-destination pairs whose trips cross it, as
Run.link_selectcounts them: each pair’s trips by mode, their share of the link’s users and their share of the pair’s travellers. The map draws where those users came from (filled discs) and went (rings), each sized by people, and their flow on every other link, so the roads that feed the link and those it feeds read at a glance. Departures: all of them together (the default), or one departure bin at a time with the slider. Hover a row of the table to see that pair alone. The page needs no server, no network and no library.- Parameters:
run (Any) – A
RunfromScenario.run(). The bike layer is offered when the run has per-link results (link_bin_s) and bikes ran.path (str | pathlib.Path | None) – Where to write the
.htmlfile;link_select.htmlin the run’s output folder by default.zones (Any) –
{zone: (lon, lat)}: pairs of zones (each trip end at the nearest zone point), asRun.link_select’s;None: pairs of road nodes.link (int | None) – The road link shown first; the one with the most people by default.
theme (str) – The starting theme,
"paper"or"night"; the page has a button to switch.title (str | None) – The page title.
bin_s (int | None) – The departure bins’ length in seconds: the run’s
link_bin_s, or 900.quiet (bool) – Do not say where the file was written.
- Returns:
The path written.
- Raises:
ValueError – If theme is unknown, the run does not carry its network or keep its journeys, or the region is too large to store (over about 200 km across).
- Return type:
pathlib.Path
- openmobisim.viz.map_parking(run, *, theme='paper', title=None, subtitle=None, note=None, size_cm=SIZE_CM, dpi=120, credit=None, logo=True, path=None)#
Draw a run’s parkings: car parks and bike parkings, sized and coloured.
Car parks are squares and bike parkings circles, each kind sized by its capacity on its own scale; the colour is the most vehicles parked at once over the day as a share of the capacity, from empty to full (a parking above capacity, which soft capacity allows, is full). Parkings nobody used are small hollow marks. The run’s network is drawn quietly underneath.
- Parameters:
run (Any) – A
Runof a scenario withparkings.theme (str | openmobisim.viz._style.Theme) –
"paper"or"night".title (str | None) – Figure title.
subtitle (str | None) – A line under the title; defaults to the counts and what size and colour mean.
note (str | None) – A third, italic line; defaults to the vehicles parked and how many found their parking full.
size_cm (tuple[float, float]) – Figure size, width and height in centimetres.
dpi (int) – Resolution in dots per inch (25.4 mm), the image-file convention.
credit (str | None) – A line of your own before the logo (a name, an institution).
logo (bool) – Draw the openmobisim logo at the bottom right.
path (str | None) – If given, also save the figure there.
- Returns:
A
matplotlib.figure.Figure.- Raises:
ValueError – If the run had no parkings.
ImportError – If matplotlib is not installed (
openmobisim[viz]).
- Return type:
Any
- openmobisim.viz.map_route(routes, network, pair=0, *, theme='paper', title=None, subtitle=None, note=None, size_cm=SIZE_CM, dpi=120, credit=None, logo=True, path=None)#
Draw the alternative routes of one origin-destination pair on the network.
Route 1 (the cheapest) is drawn first, in blue; the others follow in the order of their cost. Each route is shifted a little to the right of the one before, so where two routes use the same street they run side by side and the overlap is visible. The legend gives each route’s free-flow time, its detour over the best, and the share of it that overlaps an earlier route.
- Parameters:
routes (Any) –
RouteSets, fromRun.route_sets()oropenmobisim.route_sets_build.network (Any) – The network the routes are on.
pair (int | tuple[tuple[float, float], tuple[float, float]]) – Which pair: the position among the sets’ keys, or two
(lon, lat)points, snapped to their nearest nodes.theme (str | openmobisim.viz._style.Theme) –
"paper"or"night".title (str | None) – Figure title.
subtitle (str | None) – A line under the title; defaults to the counts.
note (str | None) – A third, italic line.
size_cm (tuple[float, float]) – Figure size, width and height in centimetres.
dpi (int) – Resolution in dots per inch (25.4 mm), the image-file convention.
credit (str | None) – A line of your own before the logo (a name, an institution).
logo (bool) – Draw the openmobisim logo at the bottom right.
path (str | None) – If given, also save the figure there.
- Returns:
A
matplotlib.figure.Figure.- Raises:
ValueError – If the pair has no set, or no route.
ImportError – If matplotlib is not installed (
openmobisim[viz]).
- Return type:
Any
- openmobisim.viz.map_transit(run, *, theme='paper', colour='kind', stop_labels=None, title=None, subtitle=None, note=None, size_cm=SIZE_CM, dpi=120, credit=None, logo=True, path=None)#
Draw a run’s transit: lines by kind, width = passengers on board, stops as hubs.
Each hop of every run, from one stop to the next, is a straight ribbon coloured by its kind of service (rail, metro, tram, bus, ferry, other) and as wide as the passengers on board over the whole day, summed over the runs that make it; the two directions side by side, each on the driver’s side, as on the link map; the busiest on top. Stops are drawn as hubs, sized by boardings. The run’s network is drawn quietly underneath.
- Parameters:
run (Any) – A
Runof a scenario withtransit.theme (str | openmobisim.viz._style.Theme) –
"paper"or"night".colour (str) –
"kind", each kind of service in its colour, or"line", each line in its own (eight colours, repeating past eight lines); lines that share a stretch are then drawn side by side, each right of its direction of travel.stop_labels (bool | None) – Write each stop’s name beside it.
None(the default) names them on a network of at most 40 stops, where the names fit.title (str | None) – Figure title.
subtitle (str | None) – A line under the title; defaults to the timetable’s counts.
note (str | None) – A third, italic line; defaults to the boardings.
size_cm (tuple[float, float]) – Figure size, width and height in centimetres.
dpi (int) – Resolution in dots per inch (25.4 mm), the image-file convention.
credit (str | None) – A line of your own before the logo (a name, an institution).
logo (bool) – Draw the openmobisim logo at the bottom right.
path (str | None) – If given, also save the figure there.
- Returns:
A
matplotlib.figure.Figure.- Raises:
ValueError – If the run had no timetable, or colour is unknown.
ImportError – If matplotlib is not installed (
openmobisim[viz]).
- Return type:
Any
- openmobisim.viz.summary(run, path=None, *, title=None, note=None, quiet=False)#
Write a run’s summary as one self-contained HTML page, and return its path.
The headline numbers (trips, completed, mean trip, total travel time, the roads’ PCU-km and mean speed, run time), the travel statistics (the modes’ shares, completion and mean trips; when people left, by mode; the roads’ traffic over the day, its delay by band and the busiest links; transit, parking, bikes and walking in numbers), the convergence by iteration with its verdict, the computation time in three parts (reading, running, writing; stage by stage on
timings.htmlbeside it) with each layer’s size (links, nodes, length), the settings with the fingerprint, and at the end a map per mode: car traffic, transit, bike traffic and walking, each where the run has its results (per-link results needlink_bins_s). Light and dark follow the reader’s system. Needs matplotlib for the maps.- Parameters:
run (Any) – A
Run.path (str | pathlib.Path | None) – Where to write it;
summary.htmlin the run’s output folder by default.title (str | None) – The page’s title;
Run <run_id>by default.note (str | None) – A line under the title, for example what the scenario is; none by default.
quiet (bool) – Do not say where the page was written (by default a link to it is printed, or shown in a notebook).
- Returns:
The path written, a
Path.- Return type:
pathlib.Path