-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d78c42a
commit f7a45a2
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Generating Fake Data | ||
|
||
To work with MDS data, you may in fact, need to generate fake data for a variety of purposes. | ||
|
||
To facililate that, *MDS Provider* has a `mds.fake` module that assists in the development of fake data. | ||
|
||
## Examples | ||
|
||
To generate data, you'll need to setup a `ProviderDataGenerator`. | ||
```python | ||
from mds.fake.provider import ProviderDataGenerator | ||
|
||
|
||
gen = ProviderDataGenerator( | ||
boundary=boundary, | ||
speed=speed, | ||
vehicle_types=args.vehicle_types, | ||
propulsion_types=args.propulsion_types) | ||
|
||
``` | ||
|
||
The above code creates a generator. To use that generator to make trips. The following example generates trips and status changes for 1 day, as definied by the variables. | ||
|
||
```python | ||
|
||
day_status_changes, day_trips = \ | ||
gen.service_day(devices, date, hour_open, hour_closed, inactivity) | ||
``` | ||
|
||
There are a number of options to help generate fake data. For example of the options in use, see the [mds-provider-services](https://github.com/CityofSantaMonica/mds-provider-services/blob/master/fake/main.py) repo. |