Skip to content

Commit

Permalink
pre-commit and remove RmqCoordinator to tests/util only
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz committed Jan 10, 2025
1 parent c822953 commit 44a54d8
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 95 deletions.
2 changes: 1 addition & 1 deletion src/plumpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
from .process_listener import *
from .process_states import *
from .processes import *
from .rmq import *
from .utils import *
from .workchains import *
from .rmq import *

__all__ = (
events.__all__
Expand Down
4 changes: 1 addition & 3 deletions src/plumpy/futures.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,4 @@ def create_task(coro: Callable[[], Awaitable[Any]], loop: Optional[asyncio.Abstr
# asyncio.run_coroutine_threadsafe(run_task(), loop)
# return future

return asyncio.wrap_future(
asyncio.run_coroutine_threadsafe(coro(), loop)
)
return asyncio.wrap_future(asyncio.run_coroutine_threadsafe(coro(), loop))
2 changes: 0 additions & 2 deletions src/plumpy/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
from plumpy.coordinator import Coordinator
from plumpy.exceptions import PersistenceError, TaskRejectedError

from plumpy.exceptions import PersistenceError, TaskRejectedError

from . import loaders, persistence
from .utils import PID_TYPE

Expand Down
2 changes: 2 additions & 0 deletions src/plumpy/processes.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# -*- coding: utf-8 -*-
"""The main Process module"""

from __future__ import annotations

import abc
import asyncio
import concurrent.futures
Expand Down
6 changes: 3 additions & 3 deletions src/plumpy/rmq/communications.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ def converted(communicator: kiwipy.Communicator, *args: Any, **kwargs: Any) -> k

return converted


T = TypeVar('T', bound=kiwipy.Communicator)

def wrap_communicator(
communicator: T, loop: Optional[asyncio.AbstractEventLoop] = None
) -> 'LoopCommunicator[T]':

def wrap_communicator(communicator: T, loop: Optional[asyncio.AbstractEventLoop] = None) -> 'LoopCommunicator[T]':
"""
Wrap a communicator such that all callbacks made to any subscribers are scheduled on the
given event loop.
Expand Down
85 changes: 0 additions & 85 deletions src/plumpy/rmq/coordinator.py

This file was deleted.

3 changes: 2 additions & 1 deletion src/plumpy/rmq/futures.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import kiwipy

__all__ = ['wrap_to_concurrent_future', 'unwrap_kiwi_future']
__all__ = ['unwrap_kiwi_future', 'wrap_to_concurrent_future']


def _convert_future_exc(exc):
Expand Down Expand Up @@ -112,6 +112,7 @@ def wrap_to_concurrent_future(future: asyncio.Future[Any]) -> kiwipy.Future:
_chain_future(future, new_future)
return new_future


# XXX: this required in aiida-core, see if really need this unwrap.
def unwrap_kiwi_future(future: kiwipy.Future) -> kiwipy.Future:
"""
Expand Down

0 comments on commit 44a54d8

Please sign in to comment.