From 38f91e1e6db8e2626e4ed8ec0347bc631b1f30db Mon Sep 17 00:00:00 2001 From: Marc Monfort Date: Mon, 6 Nov 2023 16:13:45 +0100 Subject: [PATCH] Update pom.xml dependency versions --- addons/storage/dependency-reduced-pom.xml | 2 +- addons/storage/pom.xml | 10 +++++----- src/dataclay/annotated.py | 5 +++-- src/dataclay/contrib/mqtt.py | 2 +- src/dataclay/contrib/nvm.py | 11 +++++++++-- src/storage/api.py | 2 +- 6 files changed, 20 insertions(+), 12 deletions(-) diff --git a/addons/storage/dependency-reduced-pom.xml b/addons/storage/dependency-reduced-pom.xml index a72e5384..150d6fc6 100644 --- a/addons/storage/dependency-reduced-pom.xml +++ b/addons/storage/dependency-reduced-pom.xml @@ -96,7 +96,7 @@ junit junit - 4.11 + 4.13.2 test diff --git a/addons/storage/pom.xml b/addons/storage/pom.xml index 1eddb4b2..32f8c440 100644 --- a/addons/storage/pom.xml +++ b/addons/storage/pom.xml @@ -24,13 +24,13 @@ junit junit - 4.11 + 4.13.2 test redis.clients jedis - 4.3.0 + 5.0.2 com.google.code.gson @@ -40,18 +40,18 @@ io.grpc grpc-netty-shaded - 1.56.0 + 1.59.0 runtime io.grpc grpc-protobuf - 1.56.0 + 1.59.0 io.grpc grpc-stub - 1.56.0 + 1.59.0 org.apache.tomcat diff --git a/src/dataclay/annotated.py b/src/dataclay/annotated.py index 3cb9a29e..fcf2ad9c 100644 --- a/src/dataclay/annotated.py +++ b/src/dataclay/annotated.py @@ -1,6 +1,6 @@ class PropertyTransformer: """Parent class for annotations that transform object attributes. - + This class is not intended to be used by itself, but instead inherited and implemented. Right now, this class is a trivial implementation, i.e. passthrough of getter and setter. @@ -23,10 +23,11 @@ def setter(self, value): class LocalOnly: """Annotation to specify attributes that must no be persisted. - + Example:: class ComplexAlgorithm(DataClayObject): primes_cache: Annotated[list[int], LocalOnly] """ + pass diff --git a/src/dataclay/contrib/mqtt.py b/src/dataclay/contrib/mqtt.py index 82a0c39d..a604c9a7 100644 --- a/src/dataclay/contrib/mqtt.py +++ b/src/dataclay/contrib/mqtt.py @@ -16,7 +16,7 @@ class MQTTMixin: """MQTT mechanisms""" @activemethod - def produce_mqtt_msg(self, data: dict[str, Any], topic: str="dataclay"): + def produce_mqtt_msg(self, data: dict[str, Any], topic: str = "dataclay"): import os from json import dumps diff --git a/src/dataclay/contrib/nvm.py b/src/dataclay/contrib/nvm.py index 6af8e838..c0e49392 100644 --- a/src/dataclay/contrib/nvm.py +++ b/src/dataclay/contrib/nvm.py @@ -15,10 +15,16 @@ import npp2nvm except ImportError: import warnings - warnings.warn("npp2nvm package is not installed. InNVM annotation will fail. Install npp2nvm package.") + + warnings.warn( + "npp2nvm package is not installed. InNVM annotation will fail. Install npp2nvm package." + ) except KeyError: import warnings - warnings.warn("npp2nvm had a configuration error. InNVM annotation will fail. Check npp2nvm documentation.") + + warnings.warn( + "npp2nvm had a configuration error. InNVM annotation will fail. Check npp2nvm documentation." + ) class InNVM(PropertyTransformer): @@ -38,5 +44,6 @@ class Experiment(DataClayObject): >>> e.make_persistent() >>> e.observations = np.array([1,2,3]) """ + def setter(self, value): return npp2nvm.np_persist(value) diff --git a/src/storage/api.py b/src/storage/api.py index b52fce9a..75b7d624 100644 --- a/src/storage/api.py +++ b/src/storage/api.py @@ -28,7 +28,7 @@ def get_client() -> Client: """Get the global (singleton) Client instance. - + This can be run in the worker nodes (i.e., inside a task). Given the regular initialization flow of the worker (i.e., after it calls initWorker) a global Client instane is available and can be used.