Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Issue #575 This commit includes the definition of the decorator @redis_cache, which allows to cache job creation whe a function is called with the same arguments. Signed-off-by: victor <victor@seita.nl> * Fixing typos and changing hashing function. Signed-off-by: victor <victor@seita.nl> * Updating hash function: now classes with the method make_hashable can provide a tuple with the paramterers to be considered for the hash. Added some extra info to the docstrings. Signed-off-by: victor <victor@seita.nl> * The decorator allows creating new jobs in case that the previous call has failed. Signed-off-by: victor <victor@seita.nl> * Importing annotations from __future__ for typing of functions arguments. Signed-off-by: victor <victor@seita.nl> * Add more tests to handle ordering in dictionaries and in arrays. Signed-off-by: victor <victor@seita.nl> * Add test to check if serialized dictionaries (json strings) order yields different hashes. Signed-off-by: victor <victor@seita.nl> * Adding PR to changelog.rst Signed-off-by: victor <victor@seita.nl> * Adding force_new_job_creation into @redis_cache decorator to force the creation of a new job. Signed-off-by: victor <victor@seita.nl> * Simplyfying access to optional keyword argument. Signed-off-by: victor <victor@seita.nl> * Main changes: Fixed some typos. Simplified a test. Renamed @redis_cache -> @job_cache. Updated docstrings. Signed-off-by: victor <victor@seita.nl> * Fixing some typos. Signed-off-by: victor <victor@seita.nl> * Getting generic_asset attributes right Signed-off-by: victor <victor@seita.nl> * Fixing comments grammar and adding type to the @job_cache decorator. Signed-off-by: victor <victor@seita.nl> * Adding a better changelog entry for this PR. Signed-off-by: victor <victor@seita.nl> * Implementation + Tests of the requeueing feature. Signed-off-by: victor <victor@seita.nl> * Adding clarifications and argument description in docstrings. Signed-off-by: victor <victor@seita.nl> * Clarify arguments in docstring Signed-off-by: F.N. Claessen <felix@seita.nl> * Decorator docstring should list decorator arguments, rather than arguments of the function being decorated Signed-off-by: F.N. Claessen <felix@seita.nl> * Refactor: simpler lines of code Signed-off-by: F.N. Claessen <felix@seita.nl> * Remove redundant lines Signed-off-by: F.N. Claessen <felix@seita.nl> * Make the @job_cache decorator agnostic to whichever queue is passed Signed-off-by: F.N. Claessen <felix@seita.nl> * Clarification: "requeue" instead of "re-enqueue", because "enqueuing" assigns a queue, and in case of "requeuing", a queue doesn't need to be reassigned; the job already knows which queue it should go in when it is requeued. Signed-off-by: F.N. Claessen <felix@seita.nl> * Add missing argument and explain how function arguments are used Signed-off-by: F.N. Claessen <felix@seita.nl> * Hashes are not stored under queues Signed-off-by: F.N. Claessen <felix@seita.nl> * Remove redundant queue (name) argument from @job_cache Signed-off-by: F.N. Claessen <felix@seita.nl> * Adding TTL to job caching keys configured through the config variable FLEXMEASURES_JOB_CACHE_TTL. Signed-off-by: victor <victor@seita.nl> * Adding function and queue names to the hash of the Job creation call. Signed-off-by: victor <victor@seita.nl> * Adding FLEXMEASURES_JOB_CACHE_TTL into the config settings docs. Signed-off-by: victor <victor@seita.nl> * PR: Avoid redundantly recomputing jobs that are triggered without a relevant state change. Squashed commit of the following: commit 79ef71a Author: victor <victor@seita.nl> Date: Thu Mar 30 15:38:55 2023 +0200 Fixing typos on @deprecated decorator and trigger warnings through loggere. Signed-off-by: victor <victor@seita.nl> commit 7faa6e6 Author: victor <victor@seita.nl> Date: Wed Mar 29 23:28:00 2023 +0200 Adding version of sunset of a function/method to the @deprecated decorator Signed-off-by: victor <victor@seita.nl> commit fe228d2 Author: victor <victor@seita.nl> Date: Mon Mar 27 11:57:32 2023 +0200 Getting location of the new funciton directly from the importable object. Signed-off-by: victor <victor@seita.nl> commit c1be8db Author: victor <victor@seita.nl> Date: Sun Mar 26 23:26:28 2023 +0200 Adding deprecated messages for the functions that were moved. Signed-off-by: victor <victor@seita.nl> commit ac4a232 Author: victor <victor@seita.nl> Date: Thu Mar 23 22:29:48 2023 +0100 Issue #599 Forgot to add `from __future__ import annotations`. Local testing worked as I'm uing Python v3.10. Signed-off-by: victor <victor@seita.nl> commit 3ff0571 Author: victor <victor@seita.nl> Date: Thu Mar 23 22:02:11 2023 +0100 Issue #599 Moving get_asset_group_queries from data/services to data/queries Signed-off-by: victor <victor@seita.nl> commit 53fc214 Author: victor <victor@seita.nl> Date: Thu Mar 23 20:30:31 2023 +0100 Issue #599 Moving DataSources fetching from query to services. Signed-off-by: victor <victor@seita.nl> Signed-off-by: victor <victor@seita.nl> * Revert "PR: Avoid redundantly recomputing jobs that are triggered without a relevant state change." This reverts commit a694443. --------- Signed-off-by: victor <victor@seita.nl> Signed-off-by: F.N. Claessen <felix@seita.nl> Co-authored-by: F.N. Claessen <felix@seita.nl>
- Loading branch information