Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

[WIP] Update simple plot types to do rendering on client only - nodes PR:334 #452

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ The PROPHET_PREDICT node runs a Prophet model on the incoming dataframe.
This node always returns a DataContainer of a dataframe type. It will also always return an 'extra' field with a key 'prophet' of which the value is the JSONified Prophet model.
This model can be loaded as follows:

```python
from prophet.serialize import model_from_json

model = model_from_json(dc_inputs.extra["prophet"])
```

Parameters
----------
run_forecast : bool
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from flojoy import flojoy, run_in_venv, DataFrame
from flojoy import DataFrame, flojoy, run_in_venv


@flojoy
@run_in_venv(
pip_dependencies=[
"prophet==1.1.4",
"prophet==1.1.5",
]
)
def PROPHET_PREDICT(
Expand All @@ -14,9 +14,9 @@ def PROPHET_PREDICT(

import os
import sys
import pandas as pd
import numpy as np

import numpy as np
import pandas as pd
import prophet
from prophet.serialize import model_to_json

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@

[//]: # (Custom component imports)

import DocString from '@site/src/components/DocString';
import PythonCode from '@site/src/components/PythonCode';
import AppDisplay from '@site/src/components/AppDisplay';
import SectionBreak from '@site/src/components/SectionBreak';
import AppendixSection from '@site/src/components/AppendixSection';

[//]: # (Docstring)

import DocstringSource from '!!raw-loader!./a1-[autogen]/docstring.txt';
import PythonSource from '!!raw-loader!./a1-[autogen]/python_code.txt';

<DocString>{DocstringSource}</DocString>
<PythonCode GLink='IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_CALIBRATE/TINYMOVR_CALIBRATE.py'>{PythonSource}</PythonCode>

<SectionBreak />



[//]: # (Examples)

## Examples

<AppDisplay
GLink='IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_CALIBRATE'
nodeLabel='TINYMOVR_CALIBRATE'>
</AppDisplay>

<SectionBreak />



[//]: # (Appendix)

import Notes from './appendix/notes.md';
import Hardware from './appendix/hardware.md';
import Media from './appendix/media.md';

## Appendix

<AppendixSection index={0} folderPath='nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_CALIBRATE/appendix/'><Notes /></AppendixSection>
<AppendixSection index={1} folderPath='nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_CALIBRATE/appendix/'><Hardware /></AppendixSection>
<AppendixSection index={2} folderPath='nodes/IO/MOTION/MOTOR_DRIVERS/BLDC/TINYMOVR/TINYMOVR_CALIBRATE/appendix/'><Media /></AppendixSection>


Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"description": null,
"parameters": [
{
"name": "None",
"type": null,
"description": null
}
],
"returns": [
{
"name": null,
"type": "TextBlob",
"description": "Traceback error"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Discover and calibrate a connected tinymovr BLDC driver through a CANine USB-to-CAN controller.

Parameters
----------
None

Returns
-------
TextBlob
Traceback error
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from flojoy import flojoy, TextBlob

import can, traceback
from tinymovr.tee import init_tee, destroy_tee
from tinymovr.config import get_bus_config, create_device


@flojoy(deps={"tinymovr": "1.6.2"})
def TINYMOVR_CALIBRATE() -> TextBlob:


bitrate = 1000000
params = get_bus_config(["canine", "slcan_disco"])
params["bitrate"] = bitrate
tb = ""

try:
with can.Bus(**params) as bus:
init_tee(can.Bus(**params))
tm = create_device(node_id=1)
tm.controller.calibrate()
destroy_tee()
except:
tb = traceback.format_exc()

return TextBlob(text_blob=tb)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This node does not require any peripheral hardware to operate. Please see INSTRUMENTS for nodes that interact with the physical world through connected hardware.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
No supporting screenshots, photos, or videos have been added to the media.md file for this node.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
No theory or technical notes have been contributed for this node yet.
Loading