Skip to content

Commit

Permalink
Merge pull request #10 from nens/casper-rasterfilesource
Browse files Browse the repository at this point in the history
Add default values for temporal behavior of RasterFileSource
  • Loading branch information
arjanverkerk committed Oct 22, 2019
2 parents 1087b24 + 5b1a365 commit 2d4e35b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Changelog of dask-geomodeling
When taking the difference of a geometry with a missing geometry (A - None),
geopandas < 0.6 returned A as result, while >= 0.6 returns None as result.

- Added default values for RasterFileSource's time parameters.

- Implemented the 'columns' attribute for GeometryFileSource.

Expand Down
7 changes: 4 additions & 3 deletions dask_geomodeling/raster/sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,9 @@ class RasterFileSource(RasterBlock):
the current root setting. Relative paths are interpreted relative to this
setting (but internally stored as absolute paths).
:param time_first: the timestamp of the first frame in data (in
milliseconds since 1-1-1970)
:param time_delta: the difference between two consecutive frames (in ms)
milliseconds since 1-1-1970), defaults to 1-1-1970
:param time_delta: the difference between two consecutive frames (in ms),
defaults to 5 minutes
:type url: str
:type time_first: integer or datetime
Expand All @@ -299,7 +300,7 @@ class RasterFileSource(RasterBlock):
>>> config.set({"geomodeling.root": "/my/data/path"})
"""

def __init__(self, url, time_first, time_delta):
def __init__(self, url, time_first=0, time_delta=300000):
url = utils.safe_file_url(url, config.get("geomodeling.root"))
if isinstance(time_first, datetime):
time_first = utils.dt_to_ms(time_first)
Expand Down

0 comments on commit 2d4e35b

Please sign in to comment.