Title: | |
---|---|
Description: | A collection of tools for maniputatling hydrologic and hydraulic networks |
Authors: | Mike Johnson [aut, cre] , Justin Singh-Mohudpur [aut] , ESIP [fnd] |
Maintainer: | Mike Johnson <[email protected]> |
License: | MIT |
Version: | 0.1.0 |
Built: | 2024-12-04 05:23:23 UTC |
Source: | https://github.com/mikejohnson51/climateR-catalogs |
This is a generic base class for describing
catalog data sources. Each data source must
provide a pull
and tidy
method.
(raw()
)
The data member of this data source in Arrow IPC Stream format
(character(1)
)
The given path, invisibly.
.id
(character(1)
)
.data
(arrow::Table
)
.pull
(function
)
.tidy
(function
)
.finished
(logical(1)
)TRUE
if $tidy()
has been called
successfully, otherwise FALSE
.
id
(character(1)
)
Identifier of this data source.
result
(arrow::Table
)
Result of this data source after $tidy()
is called.
(Read-only)
.id
(character(1)
)
.data
(arrow::Table
)
.pull
(function
)
.tidy
(function
)
.finished
(logical(1)
)TRUE
if $tidy()
has been called
successfully, otherwise FALSE
.
new()
Create a new catalog data source.
data_source$new(id, pull, tidy)
id
(character(1)
)
Identifier for this data source.
pull
(function
)
Pull method for this class.
The pull function may require any amount of parameters.
The pull function must return one of:
arrow::Table
, data.table::data.table
, or a data.frame
.
tidy
(function
)
Tidy method for this class. See the tidy
method for details.
The tidy function must require at least 1 argument as its
first argument that takes in, and also returns, one of:
arrow::Table
, data.table::data.table
, or a data.frame
print()
data_source$print(...)
pull()
Pull a catalog data source from its endpoint.
This method is user-defined at object creation.
data_source$pull(...)
...
(any
)
User-defined parameters that may be used.
tidy()
Tidy a raw catalog data source into the catalog schema.
data_source$tidy(...)
...
(any
)
User-defined parameters that may be used.
to_ipc_stream()
Marshal this data source to Arrow IPC Stream format
data_source$to_ipc_stream()
from_ipc_stream()
Unmarshals an Arrow IPC Stream to a data source
data_source$from_ipc_stream(stream)
stream
(raw()
)
The given Arrow IPC Stream
to_ipc_file()
Output this data source to Arrow IPC File format
data_source$to_ipc_file(path)
path
(character(1)
)
Path to file to write to. Should have extension '.arrow'.
from_ipc_file()
Read a data source from Arrow IPC File format
data_source$from_ipc_file(path)
path
(character(1)
)
Path to Arrow IPC file.
clone()
The objects of this class are cloneable with this method.
data_source$clone(deep = FALSE)
deep
Whether to make a deep clone.
If all parameters are missing, then an empty data_source is created. This is only useful for reading from IPC.
Create a new climateR.catalogs data source plugin
new_data_source(name, dir)
new_data_source(name, dir)
name |
Name of the data source |
dir |
Directory to output |