Skip to content

Commit

Permalink
Apply black and isort format
Browse files Browse the repository at this point in the history
  • Loading branch information
marcmonfort committed Feb 10, 2025
1 parent 87ddbb5 commit 2201061
Show file tree
Hide file tree
Showing 22 changed files with 24 additions and 34 deletions.
2 changes: 1 addition & 1 deletion examples/proxy_acl/client_owner.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
print("Average: %f" % values.public_data())
print("Internal data: %s" % (values.values,))

client.stop()
client.stop()
4 changes: 1 addition & 3 deletions src/dataclay/backend/api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
""" Class description goes here. """

from __future__ import annotations

import asyncio
Expand All @@ -17,8 +15,8 @@
from dataclay.exceptions import (
DataClayException,
DoesNotExistError,
NoOtherBackendsAvailable,
ObjectWithWrongBackendIdError,
NoOtherBackendsAvailable
)
from dataclay.lock_manager import lock_manager
from dataclay.runtime import BackendRuntime
Expand Down
2 changes: 0 additions & 2 deletions src/dataclay/backend/servicer.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
""" Class description goes here. """

import asyncio
import logging
import os.path
Expand Down
2 changes: 0 additions & 2 deletions src/dataclay/contrib/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
""" Class description goes here. """

MODULES_TO_REGISTER = ("collections", "splitting")
2 changes: 2 additions & 0 deletions src/dataclay/contrib/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
from itertools import chain
from typing import Any, Optional
from uuid import UUID

from dataclay import DataClayObject, activemethod

from .splitting import SplittableCollectionMixin


Expand Down
2 changes: 0 additions & 2 deletions src/dataclay/contrib/dataclay_dummy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
""" Class description goes here. """

"""Deactivate dataClay to allow sequential un-modified execution.
This will allow some loaded-modules-mangling and make dataClay classes
Expand Down
2 changes: 0 additions & 2 deletions src/dataclay/contrib/dummy_pycompss.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
""" Class description goes here. """

"""Module that implements dummy (no-op) stuff for PyCOMPSs.
What happens:
Expand Down
8 changes: 6 additions & 2 deletions src/dataclay/contrib/kafka.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
"""Basic Synchronization mechanisms."""

from dataclay import activemethod
import inspect
import os
from json import dumps

from kafka import KafkaProducer

from dataclay import activemethod
from dataclay.contrib.kafka import KAFKA_PRODUCERS
import inspect

""" Kafka pool of producers """
KAFKA_PRODUCERS = dict()


class KafkaMixin(object):
"""KAFKA mechanisms"""

@activemethod
def produce_kafka_msg(self, data, topic="dataclay"):
"""Kafka message producer function
Expand Down
2 changes: 1 addition & 1 deletion src/dataclay/contrib/modeltest/family.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def __str__(self) -> str:
result.append(" - Name: %s, age: %d" % (p.name, p.age))

return "\n".join(result)

@activemethod
def add_year(self):
for p in self.members:
Expand Down
2 changes: 1 addition & 1 deletion src/dataclay/contrib/mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
In order to use this functionality, the client class has to inherit the :class:`MQTTMixin` class.
The client will be able to specify how the messages should be handled, which topics will be subscribed to,
and send messages with a topic.
and send messages with a topic.
"""

import inspect
Expand Down
2 changes: 1 addition & 1 deletion src/dataclay/contrib/nvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
dataClay includes support for non-volatile memory and in-memory processing.
If you want to manually set up the placement of data you can implement it
within active methods and the data model implementation. However, dataClay
within active methods and the data model implementation. However, dataClay
ships the :class:`InNVM` annotation; this offers a transparent and automatic
in-NVM placement for class attributes.
"""
Expand Down
6 changes: 3 additions & 3 deletions src/dataclay/contrib/zenoh_module.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""
dataClay includes support for publisher/subscriber communication via Zenoh.
In order to use this functionality, the client class has to inherit the :class:`ZenohMixin` class. Communications can
be established using pub/sub and queries.
In order to use this functionality, the client class has to inherit the :class:`ZenohMixin` class. Communications can
be established using pub/sub and queries.
The subscriber can specify how the messages will be handled and to which topics it will be subscribed. Also, it
The subscriber can specify how the messages will be handled and to which topics it will be subscribed. Also, it
can ask for the last value stored in an existing subscription using the queries.
The publisher can send messages to a specific topic.
Expand Down
2 changes: 0 additions & 2 deletions src/dataclay/data_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
import psutil

from dataclay.config import settings

from dataclay.event_loop import dc_to_thread_cpu, get_dc_event_loop
from dataclay.exceptions import DataClayException, ObjectNotFound, ObjectStorageError

from dataclay.lock_manager import lock_manager
from dataclay.utils.serialization import DataClayPickler

Expand Down
2 changes: 0 additions & 2 deletions src/dataclay/dataclay_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@

from dataclay.annotated import LocalOnly, PropertyTransformer
from dataclay.config import get_runtime

from dataclay.event_loop import get_dc_event_loop
from dataclay.exceptions import (
AliasDoesNotExistError,
DoesNotExistError,
ObjectIsMasterError,
ObjectNotRegisteredError,
)

from dataclay.metadata.kvdata import ObjectMetadata
from dataclay.utils.telemetry import trace

Expand Down
2 changes: 1 addition & 1 deletion src/dataclay/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

class DataClayException(Exception):
"""Base class for exceptions in this module."""

pass


Expand Down Expand Up @@ -203,4 +204,3 @@ class DataclayIdError(DataClayException):
"""Base exception for dataclayId errors."""

pass

6 changes: 3 additions & 3 deletions src/dataclay/paraver/__main__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Entry point for easy dump to get extrae values per method and class module.
"""Entry point for easy dump to get extrae values per method and class module.
This module can be run as a standalone and will dump a file to be read from all python nodes
(must be same event number in all nodes) to be added into PCF paraver file.
This module can be run as a standalone and will dump a file to be read from all python nodes
(must be same event number in all nodes) to be added into PCF paraver file.
"""

__author__ = "Alex Barcelo <[email protected]>"
Expand Down
2 changes: 1 addition & 1 deletion src/dataclay/proxy/__main__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""Entry point for the Proxy server."""

import asyncio
import importlib
import logging
import asyncio

from dataclay.config import ProxySettings, settings
from dataclay.metadata.api import MetadataAPI
Expand Down
2 changes: 2 additions & 0 deletions src/dataclay/proxy/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""The middleware can throw the exceptions defined below."""


class MiddlewareException(Exception):
"""Exception raised for errors in the middleware."""

status_code = None
1 change: 0 additions & 1 deletion src/dataclay/proxy/servicer.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ async def serve(
logger.info("Stopping proxy service")



class BackendProxyServicer(BackendProxyBase):
def __init__(self, metadata_client, *middleware):
self.backend_stubs = dict()
Expand Down
2 changes: 0 additions & 2 deletions src/storage/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
""" Class description goes here. """

"""High level Storage Interface for dataClay.
This package is used by PyCOMPSs, and uses dataclay.api module.
Expand Down
2 changes: 0 additions & 2 deletions src/storage/api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
""" Class description goes here. """

import asyncio
import logging
import os
Expand Down
1 change: 1 addition & 0 deletions src/storage/models/storagedict.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class StorageDict(DataClayObject):
@ClassField _dict anything
"""

_dict: dict

@activemethod
Expand Down

0 comments on commit 2201061

Please sign in to comment.