Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
KWH40
fml40-reference-implementation
Commits
bc5eafa1
Commit
bc5eafa1
authored
Nov 27, 2020
by
Jiahang Chen
Browse files
update doc
parent
d4466fa7
Pipeline
#367807
passed with stages
in 34 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ml/dt_factory.py
View file @
bc5eafa1
...
...
@@ -162,11 +162,11 @@
def
build_sub_features
(
feature_ins
,
feature
):
"""
b
uild
the
ml40/fml40 sub features
B
uild
a
ml40/fml40 sub features
:param feature_ins: ml40/fml40 feature instance
:param feature_ins: ml40/fml40 feature instance
, which has a sub feature to be built
:type feature_ins: object
:param feature: ml40/fml40 feature
:param feature: ml40/fml40 feature
containing subFeatures
:type feature: dict
"""
...
...
@@ -191,11 +191,11 @@ def build_sub_features(feature_ins, feature):
def
build_sub_thing
(
feature_ins
,
feature
):
"""
b
uild
fml40
sub thing to
ml40/fml40 featur
e
B
uild
and insert a
sub thing
in
to
a feature instanc
e
:param feature_ins: ml40/fml40 feature instance
:type feature_ins: object
:param feature: ml40/fml40 feature
:param feature: ml40/fml40 feature
, which contains a sub thing
:type feature: dict
"""
...
...
@@ -208,7 +208,7 @@ def build_sub_thing(feature_ins, feature):
def
build
(
thing
,
attributes
):
"""
b
uild ml40 thing
B
uild
a
ml40 thing
instance
:param thing: ml40 thing instance
:type thing: object
...
...
@@ -232,7 +232,7 @@ def build(thing, attributes):
def
build_role
(
role
):
"""
b
uild ml40/fml40 role in a ml40 thing instance
B
uild
and insert a
ml40/fml40 role in a ml40 thing instance
:param role: ml40/fml40 role
:type role: dict
...
...
@@ -251,7 +251,7 @@ def build_role(role):
def
build_feature
(
feature
):
"""
b
uild ml40/fml40 feature in a ml40 thing instance
B
uild
and insert a
ml40/fml40 feature in a ml40 thing instance
:param feature: ml40/fml40 feature
:type feature: dict
...
...
@@ -280,7 +280,7 @@ def build_feature(feature):
def
add_function_impl_obj
(
thing
,
impl_obj
,
feature_name
):
"""
a
dd user-specific implemented object to a thing instance
A
dd user-specific implemented object to a thing instance
:param thing: ml40 thing instance
:type thing: object
...
...
@@ -307,7 +307,7 @@ def create_thing(model, grant_type="password",
secret
=
""
,
username
=
None
,
password
=
None
,
is_broker_rest
=
False
,
is_broker
=
False
,
is_repo
=
False
):
"""
c
reate a ml40 thing
instance
C
reate
and launch
a ml40 thing
with the connection to S³I
:param model: JSON of a ml40::thing model
:type model: dict
...
...
ml/tools.py
View file @
bc5eafa1
...
...
@@ -125,7 +125,8 @@ def make_thing_config(thing_id, name, roles, features=[], config_path=""):
def
load_config
(
config_filepath
):
"""load a json object from a json formatted file found at config_filepath.
"""
Load a json object from a json formatted file found at config_filepath.
:param config_filepath: Path to json formatted file.
:type config_filepath: str
...
...
@@ -138,7 +139,7 @@ def load_config(config_filepath):
def
find_broker_endpoint
(
dir_obj
,
thing_id
):
"""
f
ind the S3I-B endpoint of a thing
F
ind the S3I-B endpoint of a thing
:param dir_obj: S³I Directory Object
:type dir_obj: object
...
...
@@ -155,7 +156,7 @@ def find_broker_endpoint(dir_obj, thing_id):
def
remove_namespace
(
input_str
):
"""
r
emove the namespace like ml40 or fml40
R
emove the
specified
namespace like ml40 or fml40
:param input_str: input with namespace
:type input_str: str
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment