Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ classifiers = [
"Topic :: System :: Distributed Computing",
"Topic :: Software Development :: Libraries :: Application Frameworks",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3 :: Only",
]
requires-python = ">=3.9,<3.13"
requires-python = ">=3.10,<3.13"
dependencies = [
"aiorwlock>=1.4.0",
"bcrypt>=4.1.1",
Expand Down Expand Up @@ -116,5 +115,5 @@ include = ["src/dataclay", "src/storage", "dataclay-common", "compile_protos.py"
[tool.hatch.version]
path = "src/dataclay/__init__.py"

[tool.hatch.build.hooks.custom]
path = "compile_protos.py"
#[tool.hatch.build.hooks.custom]
#path = "compile_protos.py"
4 changes: 4 additions & 0 deletions src/dataclay/contrib/persistent_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,7 @@ def partial_sum(self, centers: np.ndarray) -> np.ndarray:
def partial_histogram(self, n_bins: int, n_dimensions: int) -> np.ndarray:
values, _ = np.histogramdd(self.block_data, n_bins, [(0, 1)] * n_dimensions)
return values

@activemethod
def block_apply(self, func, *args, **kwargs):
return func(self.block_data, *args, **kwargs)
5 changes: 4 additions & 1 deletion src/dataclay/contrib/pycompss_dummy/_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
This file contains the dummy class task used as decorator.
"""

from pycompss.util.typing_helper import typing
try:
from pycompss.util.typing_helper import typing
except ModuleNotFoundError:
import typing


class _Dummy:
Expand Down
5 changes: 4 additions & 1 deletion src/dataclay/contrib/pycompss_dummy/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@

import os

from pycompss.util.typing_helper import typing
try:
from pycompss.util.typing_helper import typing
except ModuleNotFoundError:
import typing


def compss_start(
Expand Down
2 changes: 1 addition & 1 deletion src/dataclay/contrib/pycompss_dummy/constraint.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
This file contains the dummy class constraint used as decorator.
"""

from pycompss.api.dummy._decorator import _Dummy as Dummy
from ._decorator import _Dummy as Dummy

Constraint = Dummy # pylint: disable=invalid-name
constraint = Dummy # pylint: disable=invalid-name
2 changes: 1 addition & 1 deletion src/dataclay/contrib/pycompss_dummy/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
This file contains the dummy class container used as decorator.
"""

from pycompss.api.dummy._decorator import _Dummy as Dummy
from ._decorator import _Dummy as Dummy

Container = Dummy # pylint: disable=invalid-name
container = Dummy # pylint: disable=invalid-name
9 changes: 9 additions & 0 deletions src/dataclay/contrib/pycompss_dummy/eventMaster.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class EventMaster:
def __init__(self, *args, **kwargs):
pass

def __enter__(self):
return self

def __exit__(self, exc_type, exc, tb):
return False
2 changes: 1 addition & 1 deletion src/dataclay/contrib/pycompss_dummy/on_failure.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
This file contains the dummy class on failure used as decorator.
"""

from pycompss.api.dummy._decorator import _Dummy as Dummy
from ._decorator import _Dummy as Dummy

OnFailure = Dummy # pylint: disable=invalid-name
on_failure = Dummy # pylint: disable=invalid-name
Expand Down
190 changes: 190 additions & 0 deletions src/dataclay/contrib/pycompss_dummy/parameter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
#!/usr/bin/env python3
#
# Copyright 2002-2026 Barcelona Supercomputing Center (www.bsc.es)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# -*- coding: utf-8 -*-

"""
PyCOMPSs API - Parameter definitions.

This file contains the classes needed for the parameter definition.
1. DIRECTION.
- IN
- OUT
- INOUT
- CONCURRENT
- COMMUTATIVE
- IN_DELETE
2. TYPE.
- FILE
- BOOLEAN
- STRING
- INT
- LONG
- FLOAT
- OBJECT
- COLLECTION
- DICTIONARY
- EXTERNAL_PSCO
- EXTERNAL_STREAM
- ... (check _DataType generated during installation)
3. IOSTREAM.
- STDIN
- STDOUT
- STDERR
- UNSPECIFIED
4. PREFIX.
5. ALIASES.
"""

# Numbers match both C and Java enums
class SupportedDirections: # pylint: disable=too-few-public-methods
"""Used as enum for direction types."""

IN = 0
OUT = 1
INOUT = 2
CONCURRENT = 3
COMMUTATIVE = 4
IN_DELETE = 5


# Numbers match both C and Java enums
class SupportedIoStreams: # pylint: disable=too-few-public-methods
"""Used as enum for stream types."""

STDIN = 0
STDOUT = 1
STDERR = 2
UNSPECIFIED = 3


# String that identifies the prefix
class SupportedPrefixes: # pylint: disable=too-few-public-methods
"""Used as enum for prefix."""

PREFIX = "null" # NOSONAR

class SupportedFiles: # pylint: disable=too-few-public-methods
"""Used as enum for prefix."""

FILE = None
FILE_IN = None
FILE_OUT = None
FILE_INOUT = None
FILE_CONCURRENT = None
FILE_COMMUTATIVE = None

DIRECTION = SupportedDirections()
IOSTREAM = SupportedIoStreams()
PREFIX = SupportedPrefixes()
FILES = SupportedFiles()




# Aliases for objects (just direction)
IN = DIRECTION.IN
OUT = DIRECTION.OUT
INOUT = DIRECTION.INOUT
CONCURRENT = DIRECTION.CONCURRENT
COMMUTATIVE = DIRECTION.COMMUTATIVE
IN_DELETE = DIRECTION.IN_DELETE

# Aliases for files with direction
FILE = FILES.FILE
FILE_IN = FILES.FILE_IN
FILE_OUT = FILES.FILE_OUT
FILE_INOUT = FILES.FILE_INOUT
FILE_CONCURRENT = FILES.FILE_CONCURRENT
FILE_COMMUTATIVE = FILES.FILE_COMMUTATIVE

# Aliases for files with stream
FILE_STDIN = None
FILE_STDERR = None
FILE_STDOUT = None

# Aliases for files with direction and stream
FILE_IN_STDIN = None
FILE_IN_STDERR = None
FILE_IN_STDOUT =None
FILE_OUT_STDIN = None
FILE_OUT_STDERR = None
FILE_OUT_STDOUT = None
FILE_INOUT_STDIN = None
FILE_INOUT_STDERR = None
FILE_INOUT_STDOUT = None
FILE_CONCURRENT_STDIN = None
FILE_CONCURRENT_STDERR = None
FILE_CONCURRENT_STDOUT = None
FILE_COMMUTATIVE_STDIN = None
FILE_COMMUTATIVE_STDERR = None
FILE_COMMUTATIVE_STDOUT = None
# Aliases for dirs
DIRECTORY = None
DIRECTORY_IN = None
DIRECTORY_OUT = None
DIRECTORY_INOUT = None

# Aliases for collections
COLLECTION = None
COLLECTION_IN = None
COLLECTION_INOUT = None
COLLECTION_OUT = None
COLLECTION_IN_DELETE = None
COLLECTION_FILE = None
COLLECTION_FILE_IN = None
COLLECTION_FILE_INOUT = None
COLLECTION_FILE_OUT = None

# Aliases for dictionary collections
DICTIONARY = None
DICTIONARY_IN = None
DICTIONARY_INOUT = None
DICTIONARY_OUT = None
DICTIONARY_IN_DELETE = None

# Aliases for streams
STREAM_IN = None
STREAM_OUT = None

# Aliases for std IO streams (just stream direction)
STDIN = IOSTREAM.STDIN
STDOUT = IOSTREAM.STDOUT
STDERR = IOSTREAM.STDERR

# Aliases for parameter definition as dictionary
# - Parameter type
Type = None # pylint: disable=invalid-name
# - Parameter direction
Direction = None # pylint: disable=invalid-name
# - Parameter stream
StdIOStream = None # pylint: disable=invalid-name
# - Parameter prefix
Prefix = None # pylint: disable=invalid-name
# - Collection recursive depth
Depth = None # pylint: disable=invalid-name
# - Parameter weight
Weight = None # pylint: disable=invalid-name
# - Parameter keep rename property
Keep_rename = None # pylint: disable=invalid-name
# - Enable/disable store in cache
Cache = None # pylint: disable=invalid-name

# Aliases for collection layout for native mpi tasks
block_count = None # pylint: disable=invalid-name
block_length = None # pylint: disable=invalid-name
stride = None # pylint: disable=invalid-name
2 changes: 1 addition & 1 deletion src/dataclay/contrib/pycompss_dummy/reduction.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
This file contains the dummy class reduction used as decorator.
"""

from pycompss.api.dummy._decorator import _Dummy as Dummy
from ._decorator import _Dummy as Dummy

Reduction = Dummy # pylint: disable=invalid-name
reduction = Dummy # pylint: disable=invalid-name
2 changes: 1 addition & 1 deletion src/dataclay/contrib/pycompss_dummy/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
This file contains the dummy class task used as decorator.
"""

from pycompss.api.dummy._decorator import _Dummy as Dummy
from ._decorator import _Dummy as Dummy

Task = Dummy # pylint: disable=invalid-name
task = Dummy # pylint: disable=invalid-name
18 changes: 14 additions & 4 deletions src/dataclay/proto/backend/backend_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading