Skip to content
Merged
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
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Package: flowfunc
Title: Dash wrapper for flume node editor
Version: 0.1.2
Version: 0.1.3
Description: Dash wrapper for flume node editor
Depends: R (>= 3.0.2)
Imports:
Suggests:
License: MIT + file LICENSE
URL:
BugReports:
URL: https://github.com/idling-mind/flowfunc
BugReports: https://github.com/idling-mind/flowfunc/issues
Encoding: UTF-8
LazyData: true
KeepSource: true
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "Flowfunc"
uuid = "1b08a953-4be3-4667-9a23-dd0b9fbbbeab"
authors = ["Najeem Muhammed <najeem@gmail.com>"]
version = "0.1.2"
version = "0.1.3"

[deps]
Dash = "1b08a953-4be3-4667-9a23-3db579824955"
Expand Down
4 changes: 2 additions & 2 deletions R/internal.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
.flowfunc_js_metadata <- function() {
deps_metadata <- list(`flowfunc` = structure(list(name = "flowfunc",
version = "0.1.2", src = list(href = NULL,
version = "0.1.3", src = list(href = NULL,
file = "deps"), meta = NULL,
script = 'flowfunc.min.js',
stylesheet = NULL, head = NULL, attachment = NULL, package = "flowfunc",
all_files = FALSE), class = "html_dependency"),
`flowfunc` = structure(list(name = "flowfunc",
version = "0.1.2", src = list(href = NULL,
version = "0.1.3", src = list(href = NULL,
file = "deps"), meta = NULL,
script = 'flowfunc.min.js.map',
stylesheet = NULL, head = NULL, attachment = NULL, package = "flowfunc",
Expand Down
2 changes: 1 addition & 1 deletion deps/flowfunc.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion deps/flowfunc.min.js.map

Large diffs are not rendered by default.

16 changes: 14 additions & 2 deletions flowfunc/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
from enum import Enum
import inspect
from typing import Any, Callable, List, Optional, Union
from types import UnionType
try:
from typing import get_args, get_origin
from typing import get_args, get_origin, Annotated
except ImportError:
from typing_extensions import get_args, get_origin
from warnings import warn
Expand Down Expand Up @@ -55,7 +56,15 @@ def process_port(pname, pobj) -> Port:
return Port(type=ptype, name=pname, label=f"{pname} ({ptype})", py_type=ptype)
d = {}
origin = get_origin(pobj)
if origin == Union:
annotated_data = {}
if origin == Annotated:
ptypes = get_args(pobj)
if len(ptypes) > 1 and isinstance(ptypes[1], dict):
annotated_data = ptypes[1]
if len(ptypes) > 0:
pobj = ptypes[0]
origin = get_origin(pobj)
if origin == Union or origin == UnionType:
ptypes = get_args(pobj)
# Checking for Optional
# Represented as typing.Union[type, NoneType]
Expand Down Expand Up @@ -85,6 +94,7 @@ def process_port(pname, pobj) -> Port:
d["acceptTypes"] = [pobj.__name__]
d["name"] = pname
d["label"] = f"{pname} ({','.join(d['acceptTypes'])})"
d.update(annotated_data)
return Port(**d)


Expand Down Expand Up @@ -124,6 +134,8 @@ def process_output(pobj):
label=t.__name__,
)
)
for i, return_type in enumerate(return_types):
return_type.name = f"result_{i}"
return return_types
return [process_port("result", pobj)]

Expand Down
2 changes: 1 addition & 1 deletion flowfunc/flowfunc.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion flowfunc/flowfunc.min.js.map

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion flowfunc/package-info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flowfunc",
"version": "0.1.2",
"version": "0.1.3",
"description": "Dash wrapper for flume node editor",
"main": "build/index.js",
"scripts": {
Expand All @@ -15,6 +15,10 @@
},
"author": "Najeem Muhammed <najeem@gmail.com>",
"license": "MIT",
"homepage": "https://github.com/idling-mind/flowfunc",
"bugs": {
"url": "https://github.com/idling-mind/flowfunc/issues"
},
"dependencies": {
"flume": "^1.0.0",
"ramda": "^0.28.0"
Expand Down
2 changes: 1 addition & 1 deletion inst/deps/flowfunc.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/deps/flowfunc.min.js.map

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flowfunc",
"version": "0.1.2",
"version": "0.1.3",
"description": "Dash wrapper for flume node editor",
"main": "build/index.js",
"scripts": {
Expand All @@ -15,6 +15,10 @@
},
"author": "Najeem Muhammed <najeem@gmail.com>",
"license": "MIT",
"homepage": "https://github.com/idling-mind/flowfunc",
"bugs": {
"url": "https://github.com/idling-mind/flowfunc/issues"
},
"dependencies": {
"flume": "^1.0.0",
"ramda": "^0.28.0"
Expand Down
2 changes: 1 addition & 1 deletion src/Flowfunc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Flowfunc
using Dash

const resources_path = realpath(joinpath( @__DIR__, "..", "deps"))
const version = "0.1.2"
const version = "0.1.3"

include("jl/''_flowfunc.jl")

Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/Flowfunc.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as R from 'ramda'
import { NodeEditor } from 'flume';
import { FlumeConfig, Colors, Controls } from 'flume'
import PropTypes, { string } from 'prop-types';
import { standardControls } from './Controls';
import { standardControls } from '../utils/Controls';
import "./nodeeditor.css"

/**
Expand Down
File renamed without changes.
7 changes: 6 additions & 1 deletion usage.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from typing import Annotated
import dash
from dash import Input, Output, State, html
from flowfunc import Flowfunc, config, jobrunner
Expand All @@ -6,7 +7,11 @@ def add(a: int, b: int):
"""Add two numbers"""
return a + b

def subtract(a: int, b: int):

def subtract(
a: Annotated[int, {"label": "First number", "hidePort": True}],
b: Annotated[int, {"label": "Second number"}],
):
"""Subtract one number from another"""
return a - b

Expand Down