Skip to content

Commit bac1a92

Browse files
authored
Adopt central API interface (#644)
Following the [decision for unifying programming interfaces](https://github.com/pyiron/decisions/blob/main/decisions/25-001-split-api.md) within the pyiron project.
1 parent f59e6cb commit bac1a92

File tree

3 files changed

+35
-29
lines changed

3 files changed

+35
-29
lines changed

executorlib/api.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
"""
2+
External application programming interface (API) following the semantic versioning this inteface is promised to remain
3+
stable during minor releases and any change in the interface leads to a major version bump. External libraries should
4+
only use the functionality in this API in combination with the user interface defined in the root __init__.py, all other
5+
functionality is considered internal and might change during minor releases.
6+
"""
7+
8+
from executorlib.standalone.command import get_command_path
9+
from executorlib.standalone.interactive.communication import (
10+
SocketInterface,
11+
interface_bootup,
12+
interface_connect,
13+
interface_receive,
14+
interface_send,
15+
interface_shutdown,
16+
)
17+
from executorlib.standalone.interactive.spawner import MpiExecSpawner, SubprocessSpawner
18+
from executorlib.standalone.queue import cancel_items_in_queue
19+
from executorlib.standalone.serialize import cloudpickle_register
20+
21+
__all__: list[str] = [
22+
"cancel_items_in_queue",
23+
"cloudpickle_register",
24+
"get_command_path",
25+
"interface_bootup",
26+
"interface_connect",
27+
"interface_receive",
28+
"interface_send",
29+
"interface_shutdown",
30+
"MpiExecSpawner",
31+
"SocketInterface",
32+
"SubprocessSpawner",
33+
]

executorlib/standalone/__init__.py

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,3 @@
33
separation simplifies the development, testing and debugging. The functionality in executorlib.standalone is designed
44
to be used independently in other libraries.
55
"""
6-
7-
from executorlib.standalone.command import get_command_path
8-
from executorlib.standalone.interactive.communication import (
9-
SocketInterface,
10-
interface_bootup,
11-
interface_connect,
12-
interface_receive,
13-
interface_send,
14-
interface_shutdown,
15-
)
16-
from executorlib.standalone.interactive.spawner import MpiExecSpawner, SubprocessSpawner
17-
from executorlib.standalone.queue import cancel_items_in_queue
18-
from executorlib.standalone.serialize import cloudpickle_register
19-
20-
__all__: list[str] = [
21-
"cancel_items_in_queue",
22-
"cloudpickle_register",
23-
"get_command_path",
24-
"interface_bootup",
25-
"interface_connect",
26-
"interface_receive",
27-
"interface_send",
28-
"interface_shutdown",
29-
"MpiExecSpawner",
30-
"SocketInterface",
31-
"SubprocessSpawner",
32-
]

notebooks/4-developer.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
"leveraged to up-scale any executable independent of the programming language it is developed in.\n",
117117
"\n",
118118
"## External Libraries\n",
119-
"For external libraries executorlib provides a standardized interface for a subset of its internal functionality, which is designed to remain stable with minor version updates. Developers can import the following functionality from `executorlib.standalone`:\n",
119+
"For external libraries executorlib provides a standardized interface for a subset of its internal functionality, which is designed to remain stable with minor version updates. Developers can import the following functionality from `executorlib.api`:\n",
120120
"* `cancel_items_in_queue()` - Cancel items which are still waiting in the Python standard library queue - `queue.queue`.\n",
121121
"* `cloudpickle_register()` - Cloudpickle can either pickle by value or pickle by reference. The functions which are communicated have to be pickled by value rather than by reference, so the module which calls the map function is pickled by value.\n",
122122
"* `get_command_path()` - Get path of the backend executable script `executorlib.backend`.\n",
@@ -129,7 +129,7 @@
129129
"* `SocketInterface` - The `SocketInterface` is an abstraction layer on top of the zero message queue.\n",
130130
"* `SubprocessSpawner` - Subprocess interface to start serial Python process.\n",
131131
"\n",
132-
"It is not recommended to import components from other parts of executorlib in other libraries, only the interfaces in `executorlib` and `executorlib.standalone` are designed to be stable. All other classes and functions are considered for internal use only."
132+
"It is not recommended to import components from other parts of executorlib in other libraries, only the interfaces in `executorlib` and `executorlib.api` are designed to be stable. All other classes and functions are considered for internal use only."
133133
]
134134
},
135135
{

0 commit comments

Comments
 (0)