@elaraai/create-e3 1.0.69 → 1.0.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
"""An example Python platform function owned by the ``__PACKAGE_NAME__`` package.
|
|
2
2
|
|
|
3
3
|
Platform functions let East call NATIVE Python (numpy, pandas, scikit-learn, …)
|
|
4
|
-
that East itself can't express. The ``@platform_function`` is bound to
|
|
5
|
-
its dotted ``"__PACKAGE_NAME__.<fn>"`` name, which the TypeScript
|
|
6
|
-
``src/packages/__PACKAGE_NAME__.ts`` mirrors exactly — keep the
|
|
7
|
-
|
|
4
|
+
that East itself can't express. The ``@East.platform_function`` is bound to
|
|
5
|
+
East by its dotted ``"__PACKAGE_NAME__.<fn>"`` name, which the TypeScript
|
|
6
|
+
declaration in ``src/packages/__PACKAGE_NAME__.ts`` mirrors exactly — keep the
|
|
7
|
+
two in lockstep. A python-authored East body (``functions.py``) needs no
|
|
8
|
+
declaration: the decorated function is callable inside one directly. Add
|
|
9
|
+
native dependencies to this package's ``pyproject.toml`` and import them
|
|
8
10
|
inside the body.
|
|
9
11
|
"""
|
|
10
12
|
|
|
11
|
-
from east
|
|
12
|
-
from east.types.types import ArrayType, FloatType
|
|
13
|
+
from east import ArrayType, East, FloatType
|
|
13
14
|
|
|
14
15
|
|
|
15
|
-
@platform_function(
|
|
16
|
+
@East.platform_function(
|
|
16
17
|
inputs=[ArrayType(FloatType)],
|
|
17
18
|
output=FloatType,
|
|
18
19
|
name="__PACKAGE_NAME__.example",
|
|
@@ -24,4 +25,4 @@ def example(values):
|
|
|
24
25
|
|
|
25
26
|
|
|
26
27
|
# The platform functions defined in THIS module, in definition order.
|
|
27
|
-
example_impl = platform_functions(__name__)
|
|
28
|
+
example_impl = East.platform_functions(__name__)
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"""An example project-owned Python platform function — replace it with your own.
|
|
2
2
|
|
|
3
3
|
Platform functions let East call NATIVE Python (numpy, pandas, scikit-learn, …)
|
|
4
|
-
that East itself can't express. The ``@platform_function`` is bound to
|
|
5
|
-
its dotted ``"<project>.<fn>"`` name, which the TypeScript declaration
|
|
6
|
-
``src/platform_module.ts`` mirrors exactly — keep the two in lockstep.
|
|
7
|
-
|
|
4
|
+
that East itself can't express. The ``@East.platform_function`` is bound to
|
|
5
|
+
East by its dotted ``"<project>.<fn>"`` name, which the TypeScript declaration
|
|
6
|
+
in ``src/platform_module.ts`` mirrors exactly — keep the two in lockstep. A
|
|
7
|
+
python-authored East body needs no declaration: the decorated function is
|
|
8
|
+
callable inside one directly. Add native dependencies to ``pyproject.toml``
|
|
9
|
+
and import them inside the body.
|
|
8
10
|
|
|
9
11
|
This module ends by collecting its functions into ``example_impl`` (the
|
|
10
12
|
canonical east-py idiom — ``platform_functions`` keys the registry on each
|
|
@@ -12,11 +14,10 @@ function's ``__module__``), which ``__init__.py`` spreads into the package's
|
|
|
12
14
|
top-level ``platform`` list.
|
|
13
15
|
"""
|
|
14
16
|
|
|
15
|
-
from east
|
|
16
|
-
from east.types.types import ArrayType, FloatType
|
|
17
|
+
from east import ArrayType, East, FloatType
|
|
17
18
|
|
|
18
19
|
|
|
19
|
-
@platform_function(
|
|
20
|
+
@East.platform_function(
|
|
20
21
|
inputs=[ArrayType(FloatType)],
|
|
21
22
|
output=FloatType,
|
|
22
23
|
name="__PROJECT_NAME__.example_python",
|
|
@@ -28,4 +29,4 @@ def example_python(values):
|
|
|
28
29
|
|
|
29
30
|
|
|
30
31
|
# The platform functions defined in THIS module, in definition order.
|
|
31
|
-
example_impl = platform_functions(__name__)
|
|
32
|
+
example_impl = East.platform_functions(__name__)
|