Docs¶
Read Data¶
Yahoo data API only supported as a programmtic means for querying data. Users can provide their own file locally if they want.
-
class
rescaledranges.tasks.read_data_tasks.
DataReader
¶ Bases:
prefect.core.task.Task
DataReader Subclass of Prefect Task class for reading either Dask or P
- Example
>>> data_reader = DataReader() >>> data_reader >>> <Task: DataReader> >>> data_reader.run()
-
run
(data_frame_type, data_type, ticker)¶ [summary]
- Parameters
data_frame_type ([type]) – [description]
data_type ([type]) – [description]
ticker ([type]) – [description]
- Raises
ValueError – [description]
- Returns
[description]
- Return type
[type]
Data PreProcessing¶
-
class
rescaledranges.tasks.preprocess_tasks.
PreProcess
¶ Bases:
prefect.core.task.Task
PreProcess Subclass of Prefect Task class.
- Example
>>> prep = PreProcess() >>> prep.run()
-
run
(data)¶ The run() method is called (with arguments, if appropriate) to run a task.
Note: The implemented run method cannot have *args in its signature. In addition, the following keywords are reserved: upstream_tasks, task_args and mapped.
If a task has arguments in its run() method, these can be bound either by using the functional API and _calling_ the task instance, or by using self.bind directly.
In addition to running arbitrary functions, tasks can interact with Prefect in a few ways: <ul><li> Return an optional result. When this function runs successfully,
the task is considered successful and the result (if any) can be made available to downstream tasks. </li>
<li> Raise an error. Errors are interpreted as failure. </li> <li> Raise a [signal](../engine/signals.html). Signals can include FAIL, SUCCESS,
- RETRY, SKIP, etc. and indicate that the task should be put in the indicated state.
<ul> <li> FAIL will lead to retries if appropriate </li> <li> SUCCESS will cause the task to be marked successful </li> <li> RETRY will cause the task to be marked for retry, even if max_retries
has been exceeded </li>
- <li> SKIP will skip the task and possibly propogate the skip state through the
flow, depending on whether downstream tasks have skip_on_upstream_skip=True.
</li></ul>
</li></ul>
Rescaled Range Calculations¶
This code is the guts of the package.
-
class
rescaledranges.tasks.rescaled_range_tasks.
RescaledRange
¶ Bases:
prefect.core.task.Task
RescaledRange Subclass of Prefect Task Class.
- Example
>>> rescaled_ranges = RescaledRange() >>> rescaled_ranges.run(data)
-
calc_r
(column_name)¶
-
cummean
(column_name)¶
-
cumstd
()¶
-
mean_adjust
(column_name)¶
-
run
(data)¶ [summary]
- Parameters
data ([type]) – [description]
- Returns
[description]
- Return type
[type]
Visualization Functionalities¶
Still a work in progress.
-
class
rescaledranges.tasks.visual_tasks.
Visualize
¶ Bases:
prefect.core.task.Task
Visualize Subclass of Prefect Task class.
- Example
>>> viz = Visualize() >>> viz >>> <Task: Visualize>
-
plot
(ticker_data)¶
-
run
(ticker_data)¶ The run() method is called (with arguments, if appropriate) to run a task.
Note: The implemented run method cannot have *args in its signature. In addition, the following keywords are reserved: upstream_tasks, task_args and mapped.
If a task has arguments in its run() method, these can be bound either by using the functional API and _calling_ the task instance, or by using self.bind directly.
In addition to running arbitrary functions, tasks can interact with Prefect in a few ways: <ul><li> Return an optional result. When this function runs successfully,
the task is considered successful and the result (if any) can be made available to downstream tasks. </li>
<li> Raise an error. Errors are interpreted as failure. </li> <li> Raise a [signal](../engine/signals.html). Signals can include FAIL, SUCCESS,
- RETRY, SKIP, etc. and indicate that the task should be put in the indicated state.
<ul> <li> FAIL will lead to retries if appropriate </li> <li> SUCCESS will cause the task to be marked successful </li> <li> RETRY will cause the task to be marked for retry, even if max_retries
has been exceeded </li>
- <li> SKIP will skip the task and possibly propogate the skip state through the
flow, depending on whether downstream tasks have skip_on_upstream_skip=True.
</li></ul>
</li></ul>
-
signal_summary
()¶
-
visualize_graph
(flow)¶